From a62441ff77765cf85fe58d8ff9774cedb1d32a75 Mon Sep 17 00:00:00 2001 From: tokyo4j Date: Tue, 27 Jan 2026 17:59:02 +0900 Subject: [PATCH] cycle: show non-dialog child windows in window switcher Before this commit, the window switcher skipped all the child windows. However, as child windows not marked as modal dialogs can lose focus (ref. `desktop_focus_view()`), it will make sense to include them in the window switcher so that users can refocus them with keyboard. This behavior follows KWin. --- include/config/types.h | 2 +- src/cycle/cycle.c | 2 +- src/view.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/config/types.h b/include/config/types.h index fc293cd8..4561194e 100644 --- a/include/config/types.h +++ b/include/config/types.h @@ -71,9 +71,9 @@ enum lab_view_criteria { /* Positive criteria */ LAB_VIEW_CRITERIA_FULLSCREEN = 1 << 1, LAB_VIEW_CRITERIA_ALWAYS_ON_TOP = 1 << 2, - LAB_VIEW_CRITERIA_ROOT_TOPLEVEL = 1 << 3, /* Negative criteria */ + LAB_VIEW_CRITERIA_NO_DIALOG = 1 << 5, LAB_VIEW_CRITERIA_NO_ALWAYS_ON_TOP = 1 << 6, LAB_VIEW_CRITERIA_NO_SKIP_WINDOW_SWITCHER = 1 << 7, LAB_VIEW_CRITERIA_NO_OMNIPRESENT = 1 << 8, diff --git a/src/cycle/cycle.c b/src/cycle/cycle.c index 32a7438f..2a6f1e86 100644 --- a/src/cycle/cycle.c +++ b/src/cycle/cycle.c @@ -332,7 +332,7 @@ init_cycle(struct server *server, struct cycle_filter filter) { enum lab_view_criteria criteria = LAB_VIEW_CRITERIA_NO_SKIP_WINDOW_SWITCHER - | LAB_VIEW_CRITERIA_ROOT_TOPLEVEL; + | LAB_VIEW_CRITERIA_NO_DIALOG; if (filter.workspace == CYCLE_WORKSPACE_CURRENT) { criteria |= LAB_VIEW_CRITERIA_CURRENT_WORKSPACE; } diff --git a/src/view.c b/src/view.c index ffcbd18f..bc4369bc 100644 --- a/src/view.c +++ b/src/view.c @@ -287,8 +287,8 @@ matches_criteria(struct view *view, enum lab_view_criteria criteria) return false; } } - if (criteria & LAB_VIEW_CRITERIA_ROOT_TOPLEVEL) { - if (view != view_get_root(view)) { + if (criteria & LAB_VIEW_CRITERIA_NO_DIALOG) { + if (view_is_modal_dialog(view)) { return false; } }