diff --git a/source/Platform/Unix/X11Display.cpp b/source/Platform/Unix/X11Display.cpp index 94cea38..ef67380 100644 --- a/source/Platform/Unix/X11Display.cpp +++ b/source/Platform/Unix/X11Display.cpp @@ -24,6 +24,8 @@ bool X11Display::create(DisplayDescription description) XSetWindowAttributes attr; XVisualInfo* vi; Atom protocols; + Visual* visual; + Window root_win; m_disp = XGetDisplay(); if (m_disp == NULL) { @@ -32,21 +34,22 @@ bool X11Display::create(DisplayDescription description) } m_screen = DefaultScreen(m_disp); + root_win = XRootWindow(m_disp, m_screen); + visual = DefaultVisual(m_disp, m_screen); attr.border_pixel = BlackPixel(m_disp, m_screen); attr.background_pixel = WhitePixel(m_disp, m_screen); //attr.override_redirect = True; - attr.colormap = ::XCreateColormap(m_disp, RootWindow(m_disp, m_screen), DefaultVisual(m_disp, m_screen), AllocNone); + attr.colormap = ::XCreateColormap(m_disp, root_win, visual, AllocNone); // We want Keyboard,Mouse,Resize,Exposure (repaint) events. attr.event_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask | ExposureMask; - m_win = XCreateWindow(m_disp, - RootWindow(m_disp, m_screen), + m_win = XCreateWindow(m_disp, root_win, 0, 0, m_size.x, m_size.y, 0, DefaultDepth(m_disp, m_screen), - InputOutput, DefaultVisual(m_disp, m_screen), + InputOutput, visual, CWBackPixel | CWColormap | CWBorderPixel | CWEventMask, &attr); // Register event handler