aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authorLibravatar Josh Shone <josh.shone@gmail.com>2020-03-27 10:56:47 +0100
committerLibravatar Simon Ser <contact@emersion.fr>2020-03-27 21:32:26 +0100
commit82d02ce7828b7cedd7bb548b982b56d6d6f672f3 (patch)
tree8a7a9701372997a94bfcf1d1f8cac46930ee7644 /sway/tree/container.c
parentcheck for workspace command name arg (diff)
downloadsway-82d02ce7828b7cedd7bb548b982b56d6d6f672f3.tar.gz
sway-82d02ce7828b7cedd7bb548b982b56d6d6f672f3.tar.zst
sway-82d02ce7828b7cedd7bb548b982b56d6d6f672f3.zip
Fix hit test for floaters that cross outputs
In the case of multiple overlapping floating windows, this commit fixes an issue where the wrong window would be focused in response to a cursor if one of the windows came from a different output (overhanging).
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r--sway/tree/container.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index afb0f927..0c40af0a 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -289,7 +289,10 @@ static struct sway_container *container_at_linear(struct sway_node *parent,
289 289
290static struct sway_container *floating_container_at(double lx, double ly, 290static struct sway_container *floating_container_at(double lx, double ly,
291 struct wlr_surface **surface, double *sx, double *sy) { 291 struct wlr_surface **surface, double *sx, double *sy) {
292 for (int i = 0; i < root->outputs->length; ++i) { 292 // For outputs with floating containers that overhang the output bounds,
293 // those at the end of the output list appear on top of floating
294 // containers from other outputs, so iterate the list in reverse.
295 for (int i = root->outputs->length - 1; i >= 0; --i) {
293 struct sway_output *output = root->outputs->items[i]; 296 struct sway_output *output = root->outputs->items[i];
294 for (int j = 0; j < output->workspaces->length; ++j) { 297 for (int j = 0; j < output->workspaces->length; ++j) {
295 struct sway_workspace *ws = output->workspaces->items[j]; 298 struct sway_workspace *ws = output->workspaces->items[j];