summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2017-01-02 13:15:36 +0100
committerJani Heikkinen <jani.heikkinen@qt.io>2017-01-03 05:06:33 +0000
commit39033d83bb87632cce43bf89325e24b887803536 (patch)
tree8bdcd50e7166b25b17e3e56a4c77d878a6d6b4b2
parent9a83bd7e8d7f17db2c09c800d413c5c9b43913c0 (diff)
Fix crash when starting clients
Don't send wl_surface::set_input_region requests before the wl_surface has been initialized. The shapedclock example used to crash in wl_proxy_marshal prior to this fix. Task-number: QTBUG-57757 Change-Id: I0a459d374bfb88fb22d048eda3722a41112d67a4 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
-rw-r--r--src/client/qwaylandwindow.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index d16746bac..0e3c0b285 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -350,8 +350,11 @@ void QWaylandWindow::setMask(const QRegion &mask)
mMask = mask;
+ if (!isInitialized())
+ return;
+
if (mMask.isEmpty()) {
- set_input_region(0);
+ set_input_region(nullptr);
} else {
struct ::wl_region *region = mDisplay->createRegion(mMask);
set_input_region(region);