diff options
author | Tudor Brindus <me@tbrindus.ca> | 2020-05-04 17:34:28 -0400 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-05-25 10:01:00 +0200 |
commit | 5d13f647f9384e59012c0f829651911564bb5365 (patch) | |
tree | b768fac3dac8328d1efc7c9b4e96aa461ab7c9a5 /include | |
parent | common/log: use bright black rather than black for SWAY_DEBUG (diff) | |
download | sway-5d13f647f9384e59012c0f829651911564bb5365.tar.gz sway-5d13f647f9384e59012c0f829651911564bb5365.tar.zst sway-5d13f647f9384e59012c0f829651911564bb5365.zip |
input/tablet: add seatop_down entry for tablet input
Currently, when tablet input exits a window during an implicit grab, it
passes focus to another window.
For instance, this is problematic when trying to drag a scrollbar, and
exiting the window — the scrollbar motion stops. Additionally,
without `focus_follows_mouse no`, the tablet passes focus to whatever
surface it goes over regardless of if there is an active implicit.
If the tablet is over a surface that does not bind tablet handlers, sway
will fall back to pointer emulation, and all of this works fine. It
probably should have consistent behavior between emulated and
not-emulated input, though.
This commit adds a condition for entering seatop_down when a tablet's
tool tip goes down, and exiting when it goes up. Since events won't be
routed through seatop_default, this prevents windows losing focus during
implicit grabs.
Closes #5302.
Diffstat (limited to 'include')
-rw-r--r-- | include/sway/input/seat.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h index 66f8f7e4..e313a206 100644 --- a/include/sway/input/seat.h +++ b/include/sway/input/seat.h | |||
@@ -23,6 +23,8 @@ struct sway_seatop_impl { | |||
23 | void (*rebase)(struct sway_seat *seat, uint32_t time_msec); | 23 | void (*rebase)(struct sway_seat *seat, uint32_t time_msec); |
24 | void (*tablet_tool_motion)(struct sway_seat *seat, | 24 | void (*tablet_tool_motion)(struct sway_seat *seat, |
25 | struct sway_tablet_tool *tool, uint32_t time_msec, double dx, double dy); | 25 | struct sway_tablet_tool *tool, uint32_t time_msec, double dx, double dy); |
26 | void (*tablet_tool_tip)(struct sway_seat *seat, struct sway_tablet_tool *tool, | ||
27 | uint32_t time_msec, enum wlr_tablet_tool_tip_state state); | ||
26 | void (*end)(struct sway_seat *seat); | 28 | void (*end)(struct sway_seat *seat); |
27 | void (*unref)(struct sway_seat *seat, struct sway_container *con); | 29 | void (*unref)(struct sway_seat *seat, struct sway_container *con); |
28 | void (*render)(struct sway_seat *seat, struct sway_output *output, | 30 | void (*render)(struct sway_seat *seat, struct sway_output *output, |
@@ -269,6 +271,10 @@ void seatop_pointer_motion(struct sway_seat *seat, uint32_t time_msec, | |||
269 | void seatop_pointer_axis(struct sway_seat *seat, | 271 | void seatop_pointer_axis(struct sway_seat *seat, |
270 | struct wlr_event_pointer_axis *event); | 272 | struct wlr_event_pointer_axis *event); |
271 | 273 | ||
274 | void seatop_tablet_tool_tip(struct sway_seat *seat, | ||
275 | struct sway_tablet_tool *tool, uint32_t time_msec, | ||
276 | enum wlr_tablet_tool_tip_state state); | ||
277 | |||
272 | void seatop_tablet_tool_motion(struct sway_seat *seat, | 278 | void seatop_tablet_tool_motion(struct sway_seat *seat, |
273 | struct sway_tablet_tool *tool, uint32_t time_msec, double dx, double dy); | 279 | struct sway_tablet_tool *tool, uint32_t time_msec, double dx, double dy); |
274 | 280 | ||