From 7727d54faf2939e30f82da562de83dbcda1749db Mon Sep 17 00:00:00 2001 From: Jonathan Buch Date: Thu, 27 Sep 2018 18:32:55 +0200 Subject: Fix focusing topmost floating windows Re-focus on the container on which the cursor hovers over. A special case is, if there are menus or other subsurfaces open in the focused container. It will prefer the focused container as long as there are subsurfaces. This commit starts caching the previous node as well as the previous x/y cursor position. Re-calculating the previous focused node by looking at the current state of the cursor position does not work, if the environment changes. --- include/sway/input/cursor.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/sway/input/cursor.h') diff --git a/include/sway/input/cursor.h b/include/sway/input/cursor.h index 7ec45120..4d47ab42 100644 --- a/include/sway/input/cursor.h +++ b/include/sway/input/cursor.h @@ -10,6 +10,7 @@ struct sway_cursor { struct wlr_cursor *cursor; struct { double x, y; + struct sway_node *node; } previous; struct wlr_xcursor_manager *xcursor_manager; -- cgit v1.2.3-54-g00ecf