cursor.c: Keep sending adjusted motion events while button is pressed

This allows to keep dragging a scrollbar or selecting text even when
moving outside of the window. Fixes #241
This commit is contained in:
Consolatis 2022-02-26 01:21:39 +01:00 committed by Johan Malm
parent afa3eb1572
commit 00b2925461
4 changed files with 35 additions and 0 deletions

View file

@ -79,6 +79,18 @@ struct seat {
/* if set, views cannot receive focus */
struct wlr_layer_surface_v1 *focused_layer;
/**
* active_view will usually be NULL and is only set on button press
* while the mouse is over a view surface and reset to NULL on button
* release.
* It is used to send cursor motion events to a surface even though
* the cursor has left the surface in the meantime.
*
* This allows to keep dragging a scrollbar or selecting text even
* when moving outside of the window.
*/
struct view *active_view;
struct wl_client *active_client_while_inhibited;
struct wl_list inputs;
struct wl_listener new_input;