From a47931bba24a8058dfeda4f0c3976bf7f781564d Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Sun, 2 Jan 2022 15:53:05 +0000 Subject: [PATCH] desktop: simplify desktop_focus_and_activate_view() ...following view->surface checks in 295d5172 --- src/desktop.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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; }