summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbwindow.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-10-15 00:04:09 +0300
committerQt by Nokia <qt-info@nokia.com>2011-10-17 10:28:25 +0200
commit86ea95259d3fe827e340b4691710d7d971efc35a (patch)
treee7a65e504bff4c5bdb9782a95fa13bc0437e7b01 /src/plugins/platforms/xcb/qxcbwindow.cpp
parent83611473acf442d8e7e3fea818e2e33114451b5f (diff)
Do not fail user time window creation when xcb is using xlib
QXcbWindow::updateNetWmUserTime() creates a new window using the actual window as its parent. This operation was failing when Xlib usage and GLX (or EGL) was enabled because in these cases the real window was created with a different visual using XCreateWindow. For the user time window however we were passing the xcb_screen's root_visual always, and this cannot work when Xlib+GLX/EGL is in use, resulting in a BAD_MATCH (followed by some annoying flicker on the screen on Ubuntu at least, or a full log off (X crash?) on Fedora). The patch saves the visual id used to create the actual window and passes that when creating the user time window. This way the creation of the user time window succeeds with Xlib+GLX too. Change-Id: If3925d9ac1670d385dcc7c2b475c196908569f06 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbwindow.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index f65b50456a..8c2b2d53fd 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -230,6 +230,9 @@ void QXcbWindow::create()
a.background_pixel = WhitePixel(DISPLAY_FROM_XCB(this), m_screen->screenNumber());
a.border_pixel = BlackPixel(DISPLAY_FROM_XCB(this), m_screen->screenNumber());
a.colormap = cmap;
+
+ m_visualId = visualInfo->visualid;
+
m_window = XCreateWindow(DISPLAY_FROM_XCB(this), xcb_parent_id, rect.x(), rect.y(), rect.width(), rect.height(),
0, visualInfo->depth, InputOutput, visualInfo->visual,
CWBackPixel|CWBorderPixel|CWColormap, &a);
@@ -242,6 +245,7 @@ void QXcbWindow::create()
m_window = xcb_generate_id(xcb_connection());
m_depth = m_screen->screen()->root_depth;
m_imageFormat = imageFormatForDepth(m_depth);
+ m_visualId = m_screen->screen()->root_visual;
Q_XCB_CALL(xcb_create_window(xcb_connection(),
XCB_COPY_FROM_PARENT, // depth -- same as root
@@ -253,7 +257,7 @@ void QXcbWindow::create()
rect.height(),
0, // border width
XCB_WINDOW_CLASS_INPUT_OUTPUT, // window class
- m_screen->screen()->root_visual, // visual
+ m_visualId, // visual
0, // value mask
0)); // value list
}
@@ -982,7 +986,7 @@ void QXcbWindow::updateNetWmUserTime(xcb_timestamp_t timestamp)
-1, -1, 1, 1,
0, // border width
XCB_WINDOW_CLASS_INPUT_OUTPUT, // window class
- m_screen->screen()->root_visual, // visual
+ m_visualId, // visual
0, // value mask
0)); // value list
wid = m_netWmUserTimeWindow;