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
1 changed files with 1 additions and 1 deletions

View File

@ -395,7 +395,7 @@ struct sway_container *container_at(struct sway_workspace *workspace,
}
// Tiling (focused)
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;
}
}