]> git.mdlowis.com Git - proto/labwc.git/commitdiff
src/view.c: Fix minimizing the last window
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Tue, 30 Aug 2022 00:10:56 +0000 (02:10 +0200)
committerJohan Malm <johanmalm@users.noreply.github.com>
Tue, 30 Aug 2022 09:44:01 +0000 (10:44 +0100)
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
src/view.c

index 68ccd17b7c8c24bafe567f048d7bade6697af542..05f944320646efa6b2baf6912f29ec42618bff21 100644 (file)
@@ -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);
        }