summaryrefslogtreecommitdiffstats
path: root/src/compositor/extensions/qwaylandxdgdecorationv1_p.h
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2018-09-04 12:30:02 +0200
committerJohan Helsing <johan.helsing@qt.io>2018-09-05 11:22:46 +0000
commitdb2dc465606f455718200641974493b499876dbd (patch)
tree05009736d79121995537608f86ff7811cd4e452b /src/compositor/extensions/qwaylandxdgdecorationv1_p.h
parentcea1c904f4e4a4a50d975c5290cd2bea4588e281 (diff)
Compositor xdg-decoration: Fix crash when clients disconnect
If clients were disconnected without shutting down nicely, e.g. if Qt clients were terminated with SIGINT, then QWaylandXdgToplevelDecorationV1 would be deleted before its Wayland resource, causing a crash in the resource destroy handler. This switches to a raw pointer in the toplevel, which is now cleared when the decoration is deleted. Deletion order is also ensured by conditionally destroying the resource in the toplevel destructor. Warnings are also printed when clients destroy objects in the wrong order (protocol errors). Change-Id: I8c24becb82e298e93cd45d70a004d8d23ead382b Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/compositor/extensions/qwaylandxdgdecorationv1_p.h')
-rw-r--r--src/compositor/extensions/qwaylandxdgdecorationv1_p.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/compositor/extensions/qwaylandxdgdecorationv1_p.h b/src/compositor/extensions/qwaylandxdgdecorationv1_p.h
index 4c6c46334..3d181a919 100644
--- a/src/compositor/extensions/qwaylandxdgdecorationv1_p.h
+++ b/src/compositor/extensions/qwaylandxdgdecorationv1_p.h
@@ -83,6 +83,7 @@ public:
explicit QWaylandXdgToplevelDecorationV1(QWaylandXdgToplevel *toplevel,
QWaylandXdgDecorationManagerV1 *manager,
wl_client *client, int id);
+ ~QWaylandXdgToplevelDecorationV1() override;
DecorationMode configuredMode() const { return m_configuredMode; }
void sendConfigure(DecorationMode mode);