QXcbWindow::setMask(): Check for SHAPE extension

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 <psychon@znc.in>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
This commit is contained in:
Uli Schlachter 2012-07-17 23:44:01 +02:00 committed by Qt by Nokia
parent 597b99305e
commit cd398431e3

View File

@ -1718,6 +1718,8 @@ static inline xcb_rectangle_t qRectToXCBRectangle(const QRect &r)
void QXcbWindow::setMask(const QRegion &region)
{
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);