diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2019-04-08 13:51:28 +0200 |
---|---|---|
committer | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2019-08-15 08:18:49 +0200 |
commit | 86b0d64b6c44fd8c3c3dd133bf52239f5520e524 (patch) | |
tree | 7033bf5ba0645ab6a60220dc70d61cef2dbccfa4 /src/shared | |
parent | 43d8a3091894ceb4ab934167b2f3eda27564eb6d (diff) |
Client: Add safer fromObject function to scanner
Makes the scanner produce generated static functions such as
QtWaylandClient::wl_surface *wl_surface::fromObject(struct ::wl_surface *object);
Which casts from the wayland-scanner generated types, such as struct ::wl_surface *,
to types types generated by qtwaylandscanner, but performs a check to see if
the listener is set to the wrapper class first (at least for interfaces with events).
This lets us easily fix crashes in a couple of places where we receive events
with wayland objects that we didn't create.
Also adds nullptr checks whenever we use the fromWlSurface() and fromWlOutput()
functions to handle failed conversions.
Task-number: QTBUG-73801
Fixes: QTBUG-74085
Change-Id: I9f33c31c7d1a939ccb3ebbbcb0eb67af10037237
Reviewed-by: Jaroslaw Kubik <jarek@froglogic.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit 3eea45e31ef796ab6f1363f8fd2882c151becc20)
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
Diffstat (limited to 'src/shared')
0 files changed, 0 insertions, 0 deletions