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
|
* This allows to keep dragging a scrollbar or selecting text even
|
||||||
* when moving outside of the window.
|
* 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.
|
* Both (view && !surface) and (surface && !view) are possible.
|
||||||
*/
|
*/
|
||||||
struct {
|
struct {
|
||||||
|
|
|
||||||
|
|
@ -241,7 +241,9 @@ handle_request_move(struct wl_listener *listener, void *data)
|
||||||
* want.
|
* want.
|
||||||
*/
|
*/
|
||||||
struct view *view = wl_container_of(listener, view, request_move);
|
struct view *view = wl_container_of(listener, view, request_move);
|
||||||
interactive_begin(view, LAB_INPUT_STATE_MOVE, 0);
|
if (view == view->server->seat.pressed.view) {
|
||||||
|
interactive_begin(view, LAB_INPUT_STATE_MOVE, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -257,7 +259,9 @@ handle_request_resize(struct wl_listener *listener, void *data)
|
||||||
*/
|
*/
|
||||||
struct wlr_xdg_toplevel_resize_event *event = data;
|
struct wlr_xdg_toplevel_resize_event *event = data;
|
||||||
struct view *view = wl_container_of(listener, view, request_resize);
|
struct view *view = wl_container_of(listener, view, request_resize);
|
||||||
interactive_begin(view, LAB_INPUT_STATE_RESIZE, event->edges);
|
if (view == view->server->seat.pressed.view) {
|
||||||
|
interactive_begin(view, LAB_INPUT_STATE_RESIZE, event->edges);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
|
|
@ -228,7 +228,9 @@ handle_request_move(struct wl_listener *listener, void *data)
|
||||||
* want.
|
* want.
|
||||||
*/
|
*/
|
||||||
struct view *view = wl_container_of(listener, view, request_move);
|
struct view *view = wl_container_of(listener, view, request_move);
|
||||||
interactive_begin(view, LAB_INPUT_STATE_MOVE, 0);
|
if (view == view->server->seat.pressed.view) {
|
||||||
|
interactive_begin(view, LAB_INPUT_STATE_MOVE, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -244,7 +246,9 @@ handle_request_resize(struct wl_listener *listener, void *data)
|
||||||
*/
|
*/
|
||||||
struct wlr_xwayland_resize_event *event = data;
|
struct wlr_xwayland_resize_event *event = data;
|
||||||
struct view *view = wl_container_of(listener, view, request_resize);
|
struct view *view = wl_container_of(listener, view, request_resize);
|
||||||
interactive_begin(view, LAB_INPUT_STATE_RESIZE, event->edges);
|
if (view == view->server->seat.pressed.view) {
|
||||||
|
interactive_begin(view, LAB_INPUT_STATE_RESIZE, event->edges);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue