aboutsummaryrefslogtreecommitdiff
path: root/sway/tree
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-08-19 21:50:33 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-08-19 21:50:33 +1000
commit4afb2e3f240f737fc965ee574f0ecdfc7208070b (patch)
treee4edaebe2859785a460231eccd4da741a78b7693 /sway/tree
parent2c91afbb34f649fcd4de690be5bedba4d989a7f0 (diff)
Allow subsurfaces which overflow the container to be interacted with
Fixes #2492.
Diffstat (limited to 'sway/tree')
-rw-r--r--sway/tree/container.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index ea20991c..ff947ca8 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -704,10 +704,11 @@ struct sway_container *container_at(struct sway_container *workspace,
return NULL;
}
struct sway_container *c;
- // Focused view's popups
struct sway_seat *seat = input_manager_current_seat(input_manager);
struct sway_container *focus =
seat_get_focus_inactive(seat, &root_container);
+ bool is_floating = focus && container_is_floating_or_child(focus);
+ // Focused view's popups
if (focus && focus->type == C_VIEW) {
surface_at_view(focus, lx, ly, surface, sx, sy);
if (*surface && surface_is_popup(*surface)) {
@@ -715,11 +716,27 @@ struct sway_container *container_at(struct sway_container *workspace,
}
*surface = NULL;
}
- // Floating
+ // If focused is floating, focused view's non-popups
+ if (focus && focus->type == C_VIEW && is_floating) {
+ surface_at_view(focus, lx, ly, surface, sx, sy);
+ if (*surface) {
+ return focus;
+ }
+ *surface = NULL;
+ }
+ // Floating (non-focused)
if ((c = floating_container_at(lx, ly, surface, sx, sy))) {
return c;
}
- // Tiling
+ // If focused is tiling, focused view's non-popups
+ if (focus && focus->type == C_VIEW && !is_floating) {
+ surface_at_view(focus, lx, ly, surface, sx, sy);
+ if (*surface) {
+ return focus;
+ }
+ *surface = NULL;
+ }
+ // Tiling (non-focused)
if ((c = tiling_container_at(workspace, lx, ly, surface, sx, sy))) {
return c;
}