mirror of
https://github.com/labwc/labwc.git
synced 2026-03-17 05:33:47 -04:00
osd: optionally show windows on all workspaces
Also share common config option (rc.window_switcher.criteria) in osd.c and desktop.c to make sure the window lists are always consistent. Configure with `<windowSwitcher allWorkspaces="yes|no">`
This commit is contained in:
parent
41419d9479
commit
247d2b581c
6 changed files with 19 additions and 21 deletions
|
|
@ -177,7 +177,7 @@ this is for compatibility with Openbox.
|
||||||
|
|
||||||
## WINDOW SWITCHER
|
## WINDOW SWITCHER
|
||||||
|
|
||||||
*<windowSwitcher show="" preview="" outlines="">*
|
*<windowSwitcher show="" preview="" outlines="" allWorkspaces="">*
|
||||||
*show* [yes|no] Draw the OnScreenDisplay when switching between
|
*show* [yes|no] Draw the OnScreenDisplay when switching between
|
||||||
windows. Default is yes.
|
windows. Default is yes.
|
||||||
|
|
||||||
|
|
@ -187,6 +187,10 @@ this is for compatibility with Openbox.
|
||||||
*outlines* [yes|no] Draw an outline around the selected window when
|
*outlines* [yes|no] Draw an outline around the selected window when
|
||||||
switching between windows. Default is yes.
|
switching between windows. Default is yes.
|
||||||
|
|
||||||
|
*allWorkspaces* [yes|no] Show windows regardless of what workspace
|
||||||
|
they are on. Default no (that is only windows on the current workspace
|
||||||
|
are shown).
|
||||||
|
|
||||||
*<windowSwitcher><fields><field content="" width="%">*
|
*<windowSwitcher><fields><field content="" width="%">*
|
||||||
Define window switcher fields.
|
Define window switcher fields.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
Just as for window-rules, 'identifier' relates to app_id for native Wayland
|
Just as for window-rules, 'identifier' relates to app_id for native Wayland
|
||||||
windows and WM_CLASS for XWayland clients.
|
windows and WM_CLASS for XWayland clients.
|
||||||
-->
|
-->
|
||||||
<windowSwitcher show="yes" preview="yes" outlines="yes">
|
<windowSwitcher show="yes" preview="yes" outlines="yes" allWorkspaces="no">
|
||||||
<fields>
|
<fields>
|
||||||
<field content="type" width="25%" />
|
<field content="type" width="25%" />
|
||||||
<field content="trimmed_identifier" width="25%" />
|
<field content="trimmed_identifier" width="25%" />
|
||||||
|
|
|
||||||
|
|
@ -135,10 +135,12 @@ struct rcxml {
|
||||||
/* Regions */
|
/* Regions */
|
||||||
struct wl_list regions; /* struct region.link */
|
struct wl_list regions; /* struct region.link */
|
||||||
|
|
||||||
|
/* Window Switcher */
|
||||||
struct {
|
struct {
|
||||||
bool show;
|
bool show;
|
||||||
bool preview;
|
bool preview;
|
||||||
bool outlines;
|
bool outlines;
|
||||||
|
uint32_t criteria;
|
||||||
struct wl_list fields; /* struct window_switcher_field.link */
|
struct wl_list fields; /* struct window_switcher_field.link */
|
||||||
} window_switcher;
|
} window_switcher;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -894,6 +894,11 @@ entry(xmlNode *node, char *nodename, char *content)
|
||||||
set_bool(content, &rc.window_switcher.preview);
|
set_bool(content, &rc.window_switcher.preview);
|
||||||
} else if (!strcasecmp(nodename, "outlines.windowSwitcher")) {
|
} else if (!strcasecmp(nodename, "outlines.windowSwitcher")) {
|
||||||
set_bool(content, &rc.window_switcher.outlines);
|
set_bool(content, &rc.window_switcher.outlines);
|
||||||
|
} else if (!strcasecmp(nodename, "allWorkspaces.windowSwitcher")) {
|
||||||
|
if (parse_bool(content, -1) == true) {
|
||||||
|
rc.window_switcher.criteria &=
|
||||||
|
~LAB_VIEW_CRITERIA_CURRENT_WORKSPACE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Remove this long term - just a friendly warning for now */
|
/* Remove this long term - just a friendly warning for now */
|
||||||
} else if (strstr(nodename, "windowswitcher.core")) {
|
} else if (strstr(nodename, "windowswitcher.core")) {
|
||||||
|
|
@ -1148,6 +1153,9 @@ rcxml_init(void)
|
||||||
rc.window_switcher.show = true;
|
rc.window_switcher.show = true;
|
||||||
rc.window_switcher.preview = true;
|
rc.window_switcher.preview = true;
|
||||||
rc.window_switcher.outlines = true;
|
rc.window_switcher.outlines = true;
|
||||||
|
rc.window_switcher.criteria = LAB_VIEW_CRITERIA_CURRENT_WORKSPACE
|
||||||
|
| LAB_VIEW_CRITERIA_ROOT_TOPLEVEL
|
||||||
|
| LAB_VIEW_CRITERIA_NO_SKIP_WINDOW_SWITCHER;
|
||||||
|
|
||||||
rc.resize_indicator = LAB_RESIZE_INDICATOR_NEVER;
|
rc.resize_indicator = LAB_RESIZE_INDICATOR_NEVER;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -118,17 +118,7 @@ desktop_cycle_view(struct server *server, struct view *start_view,
|
||||||
bool forwards = dir == LAB_CYCLE_DIR_FORWARD;
|
bool forwards = dir == LAB_CYCLE_DIR_FORWARD;
|
||||||
iter = forwards ? view_next_no_head_stop : view_prev_no_head_stop;
|
iter = forwards ? view_next_no_head_stop : view_prev_no_head_stop;
|
||||||
|
|
||||||
/*
|
enum lab_view_criteria criteria = rc.window_switcher.criteria;
|
||||||
* TODO: These criteria are the same as in display_osd() in osd.c
|
|
||||||
* for the time being.
|
|
||||||
*
|
|
||||||
* A future improvement could be to make this configurable for example
|
|
||||||
* in rc.xml and then use rc.cycle_view_criteria (or whatever) both
|
|
||||||
* 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;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Views are listed in stacking order, topmost first. Usually the
|
* Views are listed in stacking order, topmost first. Usually the
|
||||||
|
|
|
||||||
10
src/osd.c
10
src/osd.c
|
|
@ -406,10 +406,7 @@ display_osd(struct output *output)
|
||||||
|
|
||||||
struct wl_array views;
|
struct wl_array views;
|
||||||
wl_array_init(&views);
|
wl_array_init(&views);
|
||||||
view_array_append(server, &views,
|
view_array_append(server, &views, rc.window_switcher.criteria);
|
||||||
LAB_VIEW_CRITERIA_CURRENT_WORKSPACE
|
|
||||||
| LAB_VIEW_CRITERIA_ROOT_TOPLEVEL
|
|
||||||
| LAB_VIEW_CRITERIA_NO_SKIP_WINDOW_SWITCHER);
|
|
||||||
|
|
||||||
float scale = output->wlr_output->scale;
|
float scale = output->wlr_output->scale;
|
||||||
int w = theme->osd_window_switcher_width;
|
int w = theme->osd_window_switcher_width;
|
||||||
|
|
@ -460,10 +457,7 @@ nr_entries(struct server *server)
|
||||||
{
|
{
|
||||||
struct wl_array views;
|
struct wl_array views;
|
||||||
wl_array_init(&views);
|
wl_array_init(&views);
|
||||||
view_array_append(server, &views,
|
view_array_append(server, &views, rc.window_switcher.criteria);
|
||||||
LAB_VIEW_CRITERIA_CURRENT_WORKSPACE
|
|
||||||
| LAB_VIEW_CRITERIA_ROOT_TOPLEVEL
|
|
||||||
| LAB_VIEW_CRITERIA_NO_SKIP_WINDOW_SWITCHER);
|
|
||||||
int count = wl_array_len(&views);
|
int count = wl_array_len(&views);
|
||||||
wl_array_release(&views);
|
wl_array_release(&views);
|
||||||
return count;
|
return count;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue