]> git.mdlowis.com Git - proto/labwc.git/commitdiff
desktop: simplify desktop_focus_and_activate_view()
authorJohan Malm <jgm323@gmail.com>
Sun, 2 Jan 2022 15:53:05 +0000 (15:53 +0000)
committerJohan Malm <jgm323@gmail.com>
Sun, 2 Jan 2022 15:53:05 +0000 (15:53 +0000)
...following view->surface checks in 295d5172

src/desktop.c

index ba562c29f2407b8fc65074e6f4a8509c8b2a1ec6..277e331d8dbb7f080702ff41e5299b36f9e4ebb5 100644 (file)
@@ -103,7 +103,16 @@ desktop_focus_and_activate_view(struct seat *seat, struct view *view)
                return;
        }
 
-       if (view->surface && input_inhibit_blocks_surface(seat, view->surface->resource)) {
+       /*
+        * Guard against views with no mapped surfaces when handling
+        * 'request_activate' and 'request_minimize'.
+        * See notes by isfocusable()
+        */
+       if (!view->surface) {
+               return;
+       }
+
+       if (input_inhibit_blocks_surface(seat, view->surface->resource)) {
                return;
        }
 
@@ -116,7 +125,7 @@ desktop_focus_and_activate_view(struct seat *seat, struct view *view)
                return;
        }
 
-       if (!view->mapped || !view->surface) {
+       if (!view->mapped) {
                return;
        }