window-rules: add root-toplevel critiera

This commit is contained in:
Johan Malm 2024-01-30 18:04:43 +00:00 committed by Consolatis
parent c71fccbcec
commit 79bca44cb1
4 changed files with 8 additions and 0 deletions

View file

@ -265,6 +265,7 @@ 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_ALWAYS_ON_TOP = 1 << 6,

View file

@ -127,6 +127,7 @@ desktop_cycle_view(struct server *server, struct view *start_view,
* here and in the osd.c window-switcher code
*/
enum lab_view_criteria criteria = LAB_VIEW_CRITERIA_CURRENT_WORKSPACE
| LAB_VIEW_CRITERIA_ROOT_TOPLEVEL
| LAB_VIEW_CRITERIA_NO_SKIP_WINDOW_SWITCHER;
/*

View file

@ -410,6 +410,7 @@ display_osd(struct output *output)
wl_array_init(&views);
view_array_append(server, &views,
LAB_VIEW_CRITERIA_CURRENT_WORKSPACE
| LAB_VIEW_CRITERIA_ROOT_TOPLEVEL
| LAB_VIEW_CRITERIA_NO_SKIP_WINDOW_SWITCHER);
float scale = output->wlr_output->scale;

View file

@ -108,6 +108,11 @@ 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)) {
return false;
}
}
if (criteria & LAB_VIEW_CRITERIA_NO_ALWAYS_ON_TOP) {
if (view_is_always_on_top(view)) {
return false;