X11: Cleanup

We can use C99 now and also we will need the event mask below.
master
Camilla Löwy ago%!(EXTRA string=5 years)
parent 74a46dfa0c
commit 8149a5fc00
  1. 70
      src/x11_window.c

@ -613,46 +613,40 @@ static GLFWbool createNativeWindow(_GLFWwindow* window,
window->x11.transparent = _glfwIsVisualTransparentX11(visual); window->x11.transparent = _glfwIsVisualTransparentX11(visual);
// Create the actual window XSetWindowAttributes wa = { 0 };
{ wa.colormap = window->x11.colormap;
XSetWindowAttributes wa; wa.event_mask = StructureNotifyMask | KeyPressMask | KeyReleaseMask |
const unsigned long wamask = CWBorderPixel | CWColormap | CWEventMask; PointerMotionMask | ButtonPressMask | ButtonReleaseMask |
ExposureMask | FocusChangeMask | VisibilityChangeMask |
wa.colormap = window->x11.colormap; EnterWindowMask | LeaveWindowMask | PropertyChangeMask;
wa.border_pixel = 0;
wa.event_mask = StructureNotifyMask | KeyPressMask | KeyReleaseMask | _glfwGrabErrorHandlerX11();
PointerMotionMask | ButtonPressMask | ButtonReleaseMask |
ExposureMask | FocusChangeMask | VisibilityChangeMask | window->x11.handle = XCreateWindow(_glfw.x11.display,
EnterWindowMask | LeaveWindowMask | PropertyChangeMask; _glfw.x11.root,
0, 0, // Position
_glfwGrabErrorHandlerX11(); width, height,
0, // Border width
window->x11.handle = XCreateWindow(_glfw.x11.display, depth, // Color depth
_glfw.x11.root, InputOutput,
0, 0, visual,
width, height, CWBorderPixel | CWColormap | CWEventMask,
0, // Border width &wa);
depth, // Color depth
InputOutput, _glfwReleaseErrorHandlerX11();
visual,
wamask, if (!window->x11.handle)
&wa); {
_glfwInputErrorX11(GLFW_PLATFORM_ERROR,
_glfwReleaseErrorHandlerX11(); "X11: Failed to create window");
return GLFW_FALSE;
if (!window->x11.handle)
{
_glfwInputErrorX11(GLFW_PLATFORM_ERROR,
"X11: Failed to create window");
return GLFW_FALSE;
}
XSaveContext(_glfw.x11.display,
window->x11.handle,
_glfw.x11.context,
(XPointer) window);
} }
XSaveContext(_glfw.x11.display,
window->x11.handle,
_glfw.x11.context,
(XPointer) window);
if (!wndconfig->decorated) if (!wndconfig->decorated)
_glfwPlatformSetWindowDecorated(window, GLFW_FALSE); _glfwPlatformSetWindowDecorated(window, GLFW_FALSE);

Loading…
Cancel
Save