mirror of
https://github.com/labwc/labwc.git
synced 2026-04-07 08:21:20 -04:00
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:
parent
7223056ffc
commit
dad5e72dbf
9 changed files with 136 additions and 17 deletions
|
|
@ -243,6 +243,32 @@ set_property(const char *str, enum property *variable)
|
|||
*variable = ret ? LAB_PROP_TRUE : LAB_PROP_FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
set_taskbar_scope(const char *str, enum taskbar_scope *variable)
|
||||
{
|
||||
if (!str) {
|
||||
*variable = LAB_TASKBAR_SCOPE_UNSPECIFIED;
|
||||
return;
|
||||
}
|
||||
if (!strcasecmp(str, "here")) {
|
||||
*variable = LAB_TASKBAR_SCOPE_HERE;
|
||||
return;
|
||||
}
|
||||
if (!strcasecmp(str, "monitor")) {
|
||||
*variable = LAB_TASKBAR_SCOPE_MONITOR;
|
||||
return;
|
||||
}
|
||||
if (!strcasecmp(str, "workspace")) {
|
||||
*variable = LAB_TASKBAR_SCOPE_WORKSPACE;
|
||||
return;
|
||||
}
|
||||
if (!strcasecmp(str, "everywhere")) {
|
||||
*variable = LAB_TASKBAR_SCOPE_EVERYWHERE;
|
||||
return;
|
||||
}
|
||||
*variable = LAB_TASKBAR_SCOPE_UNSPECIFIED;
|
||||
}
|
||||
|
||||
static void
|
||||
fill_window_rule(xmlNode *node)
|
||||
{
|
||||
|
|
@ -300,6 +326,8 @@ fill_window_rule(xmlNode *node)
|
|||
set_property(content, &window_rule->ignore_configure_request);
|
||||
} else if (!strcasecmp(key, "fixedPosition")) {
|
||||
set_property(content, &window_rule->fixed_position);
|
||||
} else if (!strcasecmp(key, "taskbarScope")) {
|
||||
set_taskbar_scope(content, &window_rule->scope_taskbar);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue