From 4383579db688a17d4b463bd0c6fd6aad406024e6 Mon Sep 17 00:00:00 2001 From: Johannes Schlatow Date: Wed, 19 May 2021 10:45:00 +0200 Subject: [PATCH] window_layouter: improve focus history If no window has ever been focused, next() always returns an invalid window id. As a consequence, there is no way to cycle through the focus history without an explicit focus event (e.g. mouse hover). Instead, next() should return the first window from the focus history if the currently focused window is not present. Fixes genodelabs/genode#4164 --- repos/gems/src/app/window_layouter/focus_history.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repos/gems/src/app/window_layouter/focus_history.h b/repos/gems/src/app/window_layouter/focus_history.h index 3cd8af3d0c..9e267e6803 100644 --- a/repos/gems/src/app/window_layouter/focus_history.h +++ b/repos/gems/src/app/window_layouter/focus_history.h @@ -76,7 +76,7 @@ class Window_layouter::Focus_history Entry * const entry = _lookup(window_id); if (!entry) - return Window_id(); + return first->window_id; Entry * const next = entry->next(); return next ? next->window_id : first->window_id;