Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.12.1
-
None
-
-
3eea45e31ef796ab6f1363f8fd2882c151becc20 (qt/qtwayland/dev) 86b0d64b6c44fd8c3c3dd133bf52239f5520e524 (qt/qtwayland/5.12)
Description
Hi,
When creating a custom wayland surface, by getting a wl_compositor and calling wl_compositor_create_surface, it's userdata is not filled with what Qt expects.
Thus, as there is no check of ownership, when the pointer enters a non-Qt wl_surface running on the same wayland client connection, Qt tries to cast the userdata and it results in a segfault.
Here is the relevant code in src/client/qwaylandinputdevice.cpp:447
void QWaylandInputDevice::Pointer::pointer_enter(uint32_t serial, struct wl_surface *surface, wl_fixed_t sx, wl_fixed_t sy) { if (!surface) return; QWaylandWindow *window = QWaylandWindow::fromWlSurface(surface); mFocus = window; mSurfacePos = QPointF(wl_fixed_to_double(sx), wl_fixed_to_double(sy)); mGlobalPos = window->window()->mapToGlobal(mSurfacePos.toPoint());
I haven't tested many QtWayland version but I believe It should happens in every QtWayland versions.
Maybe something derived from this can be done to fix this issue?
https://github.com/alexandre-janniaux/qtwayland/pull/1/files
Stacktrace is attached: stacktrace_qt_pointer.md
Attachments
Issue Links
- relates to
-
QTBUG-73801 Support for transient parents by xdg-foreign protocol
-
- Open
-
For Gerrit Dashboard: QTBUG-74085 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
258788,2 | Client: Add safer fromObject function to scanner | dev | qt/qtwayland | Status: MERGED | +2 | 0 |
264595,3 | Client: Add safer fromObject function to scanner | 5.12 | qt/qtwayland | Status: MERGED | +2 | 0 |