window-rules/foreign-toplevel: add per-window <taskbarScope> with 4 visibility modes

Introduce a per-window rule `<taskbarScope>` that controls where a window's
*taskbar entry* appears. This affects taskbar listing only (via foreign-toplevel
output membership); it does not change sticky/omnipresent state, focus, or
workspace membership.

Supported values (case-insensitive):
- here       -> show only when both match: the window's monitor AND its active workspace
- monitor    -> show only on the window's monitor, across that monitor's workspaces
                (default if the key is omitted)
- workspace  -> show on all monitors currently on the window's workspace
- everywhere -> show on all monitors and all workspaces
This commit is contained in:
Maik Broemme 2025-11-02 22:29:51 +01:00
parent 7223056ffc
commit dad5e72dbf
No known key found for this signature in database
GPG key ID: 27BE1125704B8B02
9 changed files with 136 additions and 17 deletions

View file

@ -9,5 +9,6 @@ struct foreign_toplevel *foreign_toplevel_create(struct view *view);
void foreign_toplevel_set_parent(struct foreign_toplevel *toplevel,
struct foreign_toplevel *parent);
void foreign_toplevel_destroy(struct foreign_toplevel *toplevel);
void foreign_toplevel_refresh_outputs(struct foreign_toplevel *toplevel);
#endif /* LABWC_FOREIGN_TOPLEVEL_H */

View file

@ -35,5 +35,6 @@ void wlr_foreign_toplevel_init(struct wlr_foreign_toplevel *wlr_toplevel,
void wlr_foreign_toplevel_set_parent(struct wlr_foreign_toplevel *wlr_toplevel,
struct wlr_foreign_toplevel *parent);
void wlr_foreign_toplevel_finish(struct wlr_foreign_toplevel *wlr_toplevel);
void wlr_foreign_toplevel_refresh_outputs(struct wlr_foreign_toplevel *wlr_toplevel);
#endif /* LABWC_WLR_FOREIGN_TOPLEVEL_H */

View file

@ -17,6 +17,22 @@ enum property {
LAB_PROP_TRUE,
};
/*
* Taskbar scope for per-window task listing.
* - 'UNSPECIFIED' backward compatible fallback to: monitor
* - 'HERE' THIS monitor & THIS workspace
* - 'MONITOR' THIS monitor & ALL workspaces (default)
* - 'WORKSPACE' ALL monitors & THIS workspace
* - 'EVERYWHERE' ALL monitors & ALL workspaces
*/
enum taskbar_scope {
LAB_TASKBAR_SCOPE_UNSPECIFIED = 0,
LAB_TASKBAR_SCOPE_HERE,
LAB_TASKBAR_SCOPE_MONITOR,
LAB_TASKBAR_SCOPE_WORKSPACE,
LAB_TASKBAR_SCOPE_EVERYWHERE,
};
/*
* 'identifier' represents:
* - 'app_id' for native Wayland windows
@ -41,6 +57,8 @@ struct window_rule {
enum property fixed_position;
enum property icon_prefer_client;
enum taskbar_scope scope_taskbar;
struct wl_list link; /* struct rcxml.window_rules */
};
@ -48,5 +66,6 @@ struct view;
void window_rules_apply(struct view *view, enum window_rule_event event);
enum property window_rules_get_property(struct view *view, const char *property);
enum taskbar_scope window_rules_get_taskbar_scope(struct view *view, const char *scope);
#endif /* LABWC_WINDOW_RULES_H */