aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-08-19 21:50:33 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-08-19 21:50:33 +1000
commit4afb2e3f240f737fc965ee574f0ecdfc7208070b (patch)
treee4edaebe2859785a460231eccd4da741a78b7693 /sway/tree/container.c
parentMerge pull request #2487 from RyanDwyer/workspace-floating-list (diff)
downloadsway-4afb2e3f240f737fc965ee574f0ecdfc7208070b.tar.gz
sway-4afb2e3f240f737fc965ee574f0ecdfc7208070b.tar.zst
sway-4afb2e3f240f737fc965ee574f0ecdfc7208070b.zip
Allow subsurfaces which overflow the container to be interacted with
Fixes #2492.
Diffstat (limited to 'sway/tree/container.c')
-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,
704 return NULL; 704 return NULL;
705 } 705 }
706 struct sway_container *c; 706 struct sway_container *c;
707 // Focused view's popups
708 struct sway_seat *seat = input_manager_current_seat(input_manager); 707 struct sway_seat *seat = input_manager_current_seat(input_manager);
709 struct sway_container *focus = 708 struct sway_container *focus =
710 seat_get_focus_inactive(seat, &root_container); 709 seat_get_focus_inactive(seat, &root_container);
710 bool is_floating = focus && container_is_floating_or_child(focus);
711 // Focused view's popups
711 if (focus && focus->type == C_VIEW) { 712 if (focus && focus->type == C_VIEW) {
712 surface_at_view(focus, lx, ly, surface, sx, sy); 713 surface_at_view(focus, lx, ly, surface, sx, sy);
713 if (*surface && surface_is_popup(*surface)) { 714 if (*surface && surface_is_popup(*surface)) {
@@ -715,11 +716,27 @@ struct sway_container *container_at(struct sway_container *workspace,
715 } 716 }
716 *surface = NULL; 717 *surface = NULL;
717 } 718 }
718 // Floating 719 // If focused is floating, focused view's non-popups
720 if (focus && focus->type == C_VIEW && is_floating) {
721 surface_at_view(focus, lx, ly, surface, sx, sy);
722 if (*surface) {
723 return focus;
724 }
725 *surface = NULL;
726 }
727 // Floating (non-focused)
719 if ((c = floating_container_at(lx, ly, surface, sx, sy))) { 728 if ((c = floating_container_at(lx, ly, surface, sx, sy))) {
720 return c; 729 return c;
721 } 730 }
722 // Tiling 731 // If focused is tiling, focused view's non-popups
732 if (focus && focus->type == C_VIEW && !is_floating) {
733 surface_at_view(focus, lx, ly, surface, sx, sy);
734 if (*surface) {
735 return focus;
736 }
737 *surface = NULL;
738 }
739 // Tiling (non-focused)
723 if ((c = tiling_container_at(workspace, lx, ly, surface, sx, sy))) { 740 if ((c = tiling_container_at(workspace, lx, ly, surface, sx, sy))) {
724 return c; 741 return c;
725 } 742 }