From 39033d83bb87632cce43bf89325e24b887803536 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Mon, 2 Jan 2017 13:15:36 +0100 Subject: 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 --- src/client/qwaylandwindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3