From 58de1aac5cef1779ed12bc2282d519f2ff941ff7 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Mon, 29 Aug 2022 15:06:07 -0500 Subject: [PATCH] libweston-desktop: Set grab client before calling grab functions This prevents a spurious pointer focus clear at the start of a grab. This would, for example, cause an extra pointer leave when bringing up a right-click pop-up in a ttk app like weston-terminal. Signed-off-by: Derek Foreman --- libweston/desktop/seat.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libweston/desktop/seat.c b/libweston/desktop/seat.c index 827b47d91..191263c6d 100644 --- a/libweston/desktop/seat.c +++ b/libweston/desktop/seat.c @@ -299,6 +299,10 @@ weston_desktop_seat_popup_grab_start(struct weston_desktop_seat *seat, return false; } + seat->popup_grab.initial_up = + (pointer == NULL || pointer->button_count == 0); + seat->popup_grab.client = client; + if (keyboard != NULL && keyboard->grab->interface != &weston_desktop_seat_keyboard_popup_grab_interface) weston_keyboard_start_grab(keyboard, &seat->popup_grab.keyboard); @@ -311,10 +315,6 @@ weston_desktop_seat_popup_grab_start(struct weston_desktop_seat *seat, touch->grab->interface != &weston_desktop_seat_touch_popup_grab_interface) weston_touch_start_grab(touch, &seat->popup_grab.touch); - seat->popup_grab.initial_up = - (pointer == NULL || pointer->button_count == 0); - seat->popup_grab.client = client; - return true; }