From b0129c6af81eece4882774422352ccf99ab9cb34 Mon Sep 17 00:00:00 2001 From: David Redondo Date: Thu, 1 Feb 2024 13:40:27 +0100 Subject: [PATCH] Do not create new wl_pointer objects when creating pointer gestures get_pointer is the method belonging to QtWayland::wl_seat creating new wl_pointer instead of using the already existing one. Since they were tracked nowhere they where also leaked. Pick-to: 6.7 Change-Id: I0b9d1914ea6a9e7b379fad905a319bde5fd7f136 Reviewed-by: Vlad Zahorodnii Reviewed-by: David Edmundson --- src/plugins/platforms/wayland/qwaylandinputdevice.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp index 988e37e3085..6f421febde7 100644 --- a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp +++ b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp @@ -448,9 +448,9 @@ void QWaylandInputDevice::seat_capabilities(uint32_t caps) MaxTouchPoints, 0, QString(), QPointingDeviceUniqueId(), this); QWindowSystemInterface::registerInputDevice(mTouchPadDevice); mPointerGesturePinch.reset(pointerGestures->createPointerGesturePinch(this)); - mPointerGesturePinch->init(pointerGestures->get_pinch_gesture(get_pointer())); + mPointerGesturePinch->init(pointerGestures->get_pinch_gesture(mPointer->object())); mPointerGestureSwipe.reset(pointerGestures->createPointerGestureSwipe(this)); - mPointerGestureSwipe->init(pointerGestures->get_swipe_gesture(get_pointer())); + mPointerGestureSwipe->init(pointerGestures->get_swipe_gesture(mPointer->object())); } } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && mPointer) { mPointer.reset();