From cd398431e370eddb80707e4aa195453036598d67 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Tue, 17 Jul 2012 23:44:01 +0200 Subject: [PATCH] QXcbWindow::setMask(): Check for SHAPE extension MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit If the SHAPE extension is not available and we try to use it, the xcb connection will shut down and go into an error state. This is bad because there would be no error message that would give a hint on what went wrong. Change-Id: I1a6734bd146ca179a990b6ce896813bf76007b66 Signed-off-by: Uli Schlachter Reviewed-by: Friedemann Kleint Reviewed-by: Samuel Rødal --- src/plugins/platforms/xcb/qxcbwindow.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 55ba045..d07442e 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -1718,6 +1718,8 @@ static inline xcb_rectangle_t qRectToXCBRectangle(const QRect &r) void QXcbWindow::setMask(const QRegion ®ion) { + if (!connection()->hasXShape()) + return; if (region.isEmpty()) { xcb_shape_mask(connection()->xcb_connection(), XCB_SHAPE_SO_SET, XCB_SHAPE_SK_BOUNDING, xcb_window(), 0, 0, XCB_NONE); -- 2.7.4