From 9160423fe883d11ebcc8c8512e42923922d134bb Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Fri, 30 Oct 2015 22:43:16 -0700 Subject: [PATCH] Fix Xlib window intialization --- lib/x11/WindowXCB.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/lib/x11/WindowXCB.cpp b/lib/x11/WindowXCB.cpp index 853a41b..e69cc2e 100644 --- a/lib/x11/WindowXCB.cpp +++ b/lib/x11/WindowXCB.cpp @@ -390,25 +390,20 @@ public: XFree(visualList); /* Create colormap */ - m_colormapId = XCreateColormap(m_xDisp, m_windowId, selectedVisual, AllocNone); + m_colormapId = XCreateColormap(m_xDisp, screen->root, selectedVisual, AllocNone); /* Create window */ int x, y, w, h; genFrameDefault(screen, &x, &y, &w, &h); - XSetWindowAttributes valueMasks[] = - { - 0, - KeyPressMask | KeyReleaseMask | - ButtonPressMask | ButtonReleaseMask | - PointerMotionMask | ExposureMask | - StructureNotifyMask, - m_colormapId, - 0 - }; + XSetWindowAttributes swa; + swa.colormap = m_colormapId; + swa.border_pixmap = None; + swa.event_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask | ExposureMask | StructureNotifyMask; + m_windowId = XCreateWindow(display, screen->root, x, y, w, h, 10, CopyFromParent, CopyFromParent, selectedVisual, - CWBorderPixel | CWEventMask | CWColormap, valueMasks); - + CWBorderPixel | CWEventMask | CWColormap, &swa); + /* The XInput 2.1 extension enables per-pixel smooth scrolling trackpads */ XIEventMask mask = {XIAllMasterDevices, XIMaskLen(XI_LASTEVENT)};