From: Johan Malm Date: Sun, 2 Jan 2022 15:53:05 +0000 (+0000) Subject: desktop: simplify desktop_focus_and_activate_view() X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=a47931bba24a8058dfeda4f0c3976bf7f781564d;p=proto%2Flabwc.git desktop: simplify desktop_focus_and_activate_view() ...following view->surface checks in 295d5172 --- diff --git a/src/desktop.c b/src/desktop.c index ba562c29..277e331d 100644 --- a/src/desktop.c +++ b/src/desktop.c @@ -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; }