From 98d34beb03018f9a0dcc371f9acabc40d9fdacce Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 28 Jan 2012 22:47:30 +0100 Subject: xcb: Check for SYNC extension before using it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Samuel Rødal --- src/plugins/platforms/xcb/qxcbscreen.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms') 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(), -- cgit v1.2.3