diff options
author | Uli Schlachter <psychon@znc.in> | 2012-01-28 22:47:30 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-31 04:55:50 +0100 |
commit | 98d34beb03018f9a0dcc371f9acabc40d9fdacce (patch) | |
tree | fa075afcf2b2a72d1ef4f3144505593b60dbacf1 /src/plugins/platforms/xcb | |
parent | 64663146259c91038dffea325bd8287fb2a26fdb (diff) |
xcb: Check for SYNC extension before using it
If we call any xcb_sync_*() function, libxcb will have to figure out
SYNC's major number. However, if that fails because the SYNC extension
is not available, xcb will disconnect from the server. Obviously,
that's not what we want and must be avoided.
Change-Id: I9a1032e1cfac074a52bafcb0772304bfd423e770
Signed-off-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbscreen.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp index de325ceb16..c93b4863e1 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.cpp +++ b/src/plugins/platforms/xcb/qxcbscreen.cpp @@ -108,7 +108,11 @@ QXcbScreen::QXcbScreen(QXcbConnection *connection, xcb_screen_t *screen, int num free(reply); - m_syncRequestSupported = m_windowManagerName != QLatin1String("KWin"); + const xcb_query_extension_reply_t *sync_reply = xcb_get_extension_data(xcb_connection(), &xcb_sync_id); + if (!sync_reply || !sync_reply->present) + m_syncRequestSupported = false; + else + m_syncRequestSupported = m_windowManagerName != QLatin1String("KWin"); m_clientLeader = xcb_generate_id(xcb_connection()); Q_XCB_CALL2(xcb_create_window(xcb_connection(), |