]> git.mdlowis.com Git - proto/labwc.git/commitdiff
src/xwayland-unmanaged.c: Give keyboard focus back to topmost mapped view
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Tue, 30 Aug 2022 18:10:21 +0000 (20:10 +0200)
committerJohan Malm <johanmalm@users.noreply.github.com>
Tue, 30 Aug 2022 18:20:58 +0000 (19:20 +0100)
Previously, when unmapping and not finding another unmanaged surface
to give keyboard focus to we were not doing anything. With this patch
we will give focus to the topmost mapped view which is the same
behavior that also happens when an usual X11 surface unmaps.

This fixes dmenu when being exited with ESC.

Reported-by: @Flrian
src/xwayland-unmanaged.c

index 64a83cca2a6919a47f3a88b6d6f05e90ca53025d..56befc9035c8e683749bc65c0b0a2e63c7101bb9 100644 (file)
@@ -88,6 +88,12 @@ unmanaged_handle_unmap(struct wl_listener *listener, void *data)
                        return;
                }
        }
+       /*
+        * If we don't find a surface to focus fall back
+        * to the topmost mapped view. This fixes dmenu
+        * not giving focus back when closed with ESC.
+        */
+       desktop_focus_topmost_mapped_view(unmanaged->server);
 }
 
 static void