mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
view: validate move/resize request from clients
Move/resize requests from xwayland views and xdg toplevels should be ignored when the view is not pressed. This is relevant for touchpad taps with <tapAndDrag> disabled. When the user taps the client surface (e.g. chromium and mpv) with the setting above, libinput sends button press & release signals so quickly that the compositor receives move/resize request from the client AFTER the button release signal is processed, so `interactive_finish()` is never called.
This commit is contained in:
parent
f6d588507e
commit
e00f7cd6db
3 changed files with 16 additions and 4 deletions
|
|
@ -135,6 +135,10 @@ struct seat {
|
|||
* This allows to keep dragging a scrollbar or selecting text even
|
||||
* when moving outside of the window.
|
||||
*
|
||||
* It is also used to:
|
||||
* - determine the target view for action in "Drag" mousebind
|
||||
* - validate view move/resize requests from CSD clients
|
||||
*
|
||||
* Both (view && !surface) and (surface && !view) are possible.
|
||||
*/
|
||||
struct {
|
||||
|
|
|
|||
|
|
@ -241,8 +241,10 @@ handle_request_move(struct wl_listener *listener, void *data)
|
|||
* want.
|
||||
*/
|
||||
struct view *view = wl_container_of(listener, view, request_move);
|
||||
if (view == view->server->seat.pressed.view) {
|
||||
interactive_begin(view, LAB_INPUT_STATE_MOVE, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
handle_request_resize(struct wl_listener *listener, void *data)
|
||||
|
|
@ -257,8 +259,10 @@ handle_request_resize(struct wl_listener *listener, void *data)
|
|||
*/
|
||||
struct wlr_xdg_toplevel_resize_event *event = data;
|
||||
struct view *view = wl_container_of(listener, view, request_resize);
|
||||
if (view == view->server->seat.pressed.view) {
|
||||
interactive_begin(view, LAB_INPUT_STATE_RESIZE, event->edges);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
handle_request_minimize(struct wl_listener *listener, void *data)
|
||||
|
|
|
|||
|
|
@ -228,8 +228,10 @@ handle_request_move(struct wl_listener *listener, void *data)
|
|||
* want.
|
||||
*/
|
||||
struct view *view = wl_container_of(listener, view, request_move);
|
||||
if (view == view->server->seat.pressed.view) {
|
||||
interactive_begin(view, LAB_INPUT_STATE_MOVE, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
handle_request_resize(struct wl_listener *listener, void *data)
|
||||
|
|
@ -244,8 +246,10 @@ handle_request_resize(struct wl_listener *listener, void *data)
|
|||
*/
|
||||
struct wlr_xwayland_resize_event *event = data;
|
||||
struct view *view = wl_container_of(listener, view, request_resize);
|
||||
if (view == view->server->seat.pressed.view) {
|
||||
interactive_begin(view, LAB_INPUT_STATE_RESIZE, event->edges);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
handle_associate(struct wl_listener *listener, void *data)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue