]> git.mdlowis.com Git - proto/labwc.git/commit
view: only focus topmost view if unmapped view was focused
authorJohn Lindgren <john@jlindgren.net>
Sun, 15 Oct 2023 02:29:24 +0000 (22:29 -0400)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sun, 15 Oct 2023 20:15:11 +0000 (21:15 +0100)
commitb053c9e375a1a36d6ce5762b5045a05b1f3ad20c
tree9250e3d4b46de35f388ca53f592dbcd5941ce8b4
parent8920e546db69ebe170811b232e522adcc3b3235d
view: only focus topmost view if unmapped view was focused

The unmap() handlers should only call desktop_focus_topmost_view() if
the unmapped view was the focused view. Unmapping a view that was not
focused should not change the focus.

I expect this rarely had any effect in practice; it would only matter in
a focus-follows-mouse config where some view other than the one on top
was focused. But it still seems better to fix.

Rather than repeating the logic in two places, create a small
view_impl_unmap() helper. Perhaps more common "unmap" logic could be
moved there in future.
include/view-impl-common.h
src/view-impl-common.c
src/xdg.c
src/xwayland.c