From: Consolatis <35009135+Consolatis@users.noreply.github.com> Date: Tue, 30 Aug 2022 00:10:56 +0000 (+0200) Subject: src/view.c: Fix minimizing the last window X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=ce5e7e153c7046c96cb8f1ebfb49d1f3cfcdfaf9;p=proto%2Flabwc.git src/view.c: Fix minimizing the last window Before this patch, minimizing the last un-minimized window would not cause it to be set to inactive. This in turn would confuse panels which depend on the 'active' flag to decide when to either activate or minimize the clicked on window. Reported-by: @Flrian Predicted-by: @johanmalm --- diff --git a/src/view.c b/src/view.c index 68ccd17b..05f94432 100644 --- a/src/view.c +++ b/src/view.c @@ -217,6 +217,18 @@ view_minimize(struct view *view, bool minimized) if (minimized) { view->impl->unmap(view); desktop_move_to_back(view); + _view_set_activated(view, false); + if (view == view->server->focused_view) { + /* + * Prevents clearing the active view when + * we don't actually have keyboard focus. + * + * This may happen when using a custom mouse + * focus configuration or by using the foreign + * toplevel protocol via some panel. + */ + view->server->focused_view = NULL; + } } else { view->impl->map(view); }