From 24a90e5d86441fc345356eb3767e5a6880dcedbd Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Thu, 18 Oct 2018 23:08:45 +1000 Subject: 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. --- include/sway/input/seat.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'include/sway/input') 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 { bool has_focus; struct wl_list focus_stack; // list of containers in focus order struct sway_workspace *workspace; + struct sway_node *prev_focus; // If the focused layer is set, views cannot receive keyboard focus struct wlr_layer_surface_v1 *focused_layer; @@ -121,9 +122,6 @@ void seat_set_focus_workspace(struct sway_seat *seat, */ void seat_set_raw_focus(struct sway_seat *seat, struct sway_node *node); -void seat_set_focus_warp(struct sway_seat *seat, - struct sway_node *node, bool warp); - void seat_set_focus_surface(struct sway_seat *seat, struct wlr_surface *surface, bool unfocus); -- cgit v1.2.3