From c82535143ab38aa0ed39bc2109f86415a6768bf3 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Thu, 8 Aug 2024 14:12:34 +0100 Subject: [PATCH] client: Correct argument name in input events Input events sometimes carry serials or times, sometimes both, depending on the event. The code has drifted from the spec. In the worst case we are setting a serial as a timestamp which is very wrong. Change-Id: I82397e06a432de79ef71475882673da4568743ca Reviewed-by: David Redondo --- .../platforms/wayland/qwaylandinputdevice.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp index c72c2a81452..a3f5d5ab5eb 100644 --- a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp +++ b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp @@ -735,12 +735,12 @@ public: {} }; -void QWaylandInputDevice::Pointer::pointer_leave(uint32_t time, struct wl_surface *surface) +void QWaylandInputDevice::Pointer::pointer_leave(uint32_t serial, struct wl_surface *surface) { invalidateFocus(); mButtons = Qt::NoButton; - mParent->mTime = time; + mParent->mSerial = serial; // The event may arrive after destroying the window, indicated by // a null surface. @@ -1266,9 +1266,9 @@ void QWaylandInputDevice::Keyboard::keyboard_keymap(uint32_t format, int32_t fd, #endif } -void QWaylandInputDevice::Keyboard::keyboard_enter(uint32_t time, struct wl_surface *surface, struct wl_array *keys) +void QWaylandInputDevice::Keyboard::keyboard_enter(uint32_t serial, struct wl_surface *surface, struct wl_array *keys) { - Q_UNUSED(time); + Q_UNUSED(serial); Q_UNUSED(keys); if (!surface) { @@ -1292,9 +1292,9 @@ void QWaylandInputDevice::Keyboard::keyboard_enter(uint32_t time, struct wl_surf mParent->mQDisplay->handleKeyboardFocusChanged(mParent); } -void QWaylandInputDevice::Keyboard::keyboard_leave(uint32_t time, struct wl_surface *surface) +void QWaylandInputDevice::Keyboard::keyboard_leave(uint32_t serial, struct wl_surface *surface) { - Q_UNUSED(time); + Q_UNUSED(serial); if (!surface) { // Either a compositor bug, or a race condition with wl_surface.destroy, ignore the event.