diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2017-01-02 13:15:36 +0100 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2017-01-03 05:06:33 +0000 |
commit | 39033d83bb87632cce43bf89325e24b887803536 (patch) | |
tree | 8bdcd50e7166b25b17e3e56a4c77d878a6d6b4b2 | |
parent | 9a83bd7e8d7f17db2c09c800d413c5c9b43913c0 (diff) | |
download | qtwayland-39033d83bb87632cce43bf89325e24b887803536.tar.gz |
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.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index d16746ba..0e3c0b28 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); |