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 <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2022-08-29 15:06:07 -05:00
parent 142ec0f477
commit 58de1aac5c

View file

@ -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;
}