diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-10-18 23:08:45 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-10-18 23:08:45 +1000 |
commit | 24a90e5d86441fc345356eb3767e5a6880dcedbd (patch) | |
tree | dbf14c684b7802c2f2876fc8b11636bec26abc3d /include | |
parent | Merge pull request #2868 from emersion/xcursor-env (diff) | |
download | sway-24a90e5d86441fc345356eb3767e5a6880dcedbd.tar.gz sway-24a90e5d86441fc345356eb3767e5a6880dcedbd.tar.zst sway-24a90e5d86441fc345356eb3767e5a6880dcedbd.zip |
Remove cursor warping from seat_set_focus
Because cursor warping was the default behaviour in seat_set_focus,
there may be cases where we may have been warping the cursor
unintentionally. This patch removes cursor warping from seat_set_focus
and only does it in the focus command. This is managed by a static
function in focus.c.
To know whether to warp or not, we need to know which node had focus
previously. To keep track of this easily, seat->prev_focus has been
introduced and is set to the previous in seat_set_focus.
Diffstat (limited to 'include')
-rw-r--r-- | include/sway/input/seat.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h index be95567e..b3b98e8d 100644 --- a/include/sway/input/seat.h +++ b/include/sway/input/seat.h | |||
@@ -52,6 +52,7 @@ struct sway_seat { | |||
52 | bool has_focus; | 52 | bool has_focus; |
53 | struct wl_list focus_stack; // list of containers in focus order | 53 | struct wl_list focus_stack; // list of containers in focus order |
54 | struct sway_workspace *workspace; | 54 | struct sway_workspace *workspace; |
55 | struct sway_node *prev_focus; | ||
55 | 56 | ||
56 | // If the focused layer is set, views cannot receive keyboard focus | 57 | // If the focused layer is set, views cannot receive keyboard focus |
57 | struct wlr_layer_surface_v1 *focused_layer; | 58 | struct wlr_layer_surface_v1 *focused_layer; |
@@ -121,9 +122,6 @@ void seat_set_focus_workspace(struct sway_seat *seat, | |||
121 | */ | 122 | */ |
122 | void seat_set_raw_focus(struct sway_seat *seat, struct sway_node *node); | 123 | void seat_set_raw_focus(struct sway_seat *seat, struct sway_node *node); |
123 | 124 | ||
124 | void seat_set_focus_warp(struct sway_seat *seat, | ||
125 | struct sway_node *node, bool warp); | ||
126 | |||
127 | void seat_set_focus_surface(struct sway_seat *seat, | 125 | void seat_set_focus_surface(struct sway_seat *seat, |
128 | struct wlr_surface *surface, bool unfocus); | 126 | struct wlr_surface *surface, bool unfocus); |
129 | 127 | ||