container: Limit tiled focus to container geometry

container_at would maintain the current focus as long as a position was
over one of the container view's surfaces. If an oversized surface was
being clipped, this lead to weird focus behavior.

Instead, use view_container_at for this test, which intersects the
container box before looking at surfaces.
This commit is contained in:
Kenny Levinsen 2021-02-24 21:11:55 +01:00 committed by Simon Ser
parent a6544f5a64
commit d358aab8d9

View File

@ -395,7 +395,7 @@ struct sway_container *container_at(struct sway_workspace *workspace,
} }
// Tiling (focused) // Tiling (focused)
if (focus && focus->view && !is_floating) { if (focus && focus->view && !is_floating) {
if ((c = surface_at_view(focus, lx, ly, surface, sx, sy))) { if ((c = view_container_at(&focus->node, lx, ly, surface, sx, sy))) {
return c; return c;
} }
} }