mirror of
https://github.com/labwc/labwc.git
synced 2026-04-13 08:21:15 -04:00
Window switch, add workspace info and window state (M/m/F)
This commit is contained in:
parent
4ecac26548
commit
7513d6abc0
4 changed files with 25 additions and 3 deletions
|
|
@ -206,7 +206,7 @@ this is for compatibility with Openbox.
|
||||||
|
|
||||||
*content* defines what the field shows and can be any of:
|
*content* defines what the field shows and can be any of:
|
||||||
|
|
||||||
- *type* Show view type ("xdg-shell" or "xwayland")
|
- *type* Show view type ("W" for xdg-shell or "X" for xwayland)
|
||||||
|
|
||||||
- *identifier* Show identifier (app_id for native Wayland
|
- *identifier* Show identifier (app_id for native Wayland
|
||||||
windows and WM_CLASS for XWayland clients)
|
windows and WM_CLASS for XWayland clients)
|
||||||
|
|
|
||||||
|
|
@ -141,6 +141,7 @@ struct rcxml {
|
||||||
bool show;
|
bool show;
|
||||||
bool preview;
|
bool preview;
|
||||||
bool outlines;
|
bool outlines;
|
||||||
|
bool allworkspaces;
|
||||||
uint32_t criteria;
|
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;
|
||||||
|
|
|
||||||
|
|
@ -895,9 +895,13 @@ entry(xmlNode *node, char *nodename, char *content)
|
||||||
} 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")) {
|
} else if (!strcasecmp(nodename, "allWorkspaces.windowSwitcher")) {
|
||||||
|
set_bool(content, &rc.window_switcher.allworkspaces);
|
||||||
if (parse_bool(content, -1) == true) {
|
if (parse_bool(content, -1) == true) {
|
||||||
rc.window_switcher.criteria &=
|
rc.window_switcher.criteria &=
|
||||||
~LAB_VIEW_CRITERIA_CURRENT_WORKSPACE;
|
~LAB_VIEW_CRITERIA_CURRENT_WORKSPACE;
|
||||||
|
} else {
|
||||||
|
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 */
|
||||||
|
|
@ -1155,6 +1159,7 @@ 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.allworkspaces = false;
|
||||||
rc.window_switcher.criteria = LAB_VIEW_CRITERIA_CURRENT_WORKSPACE
|
rc.window_switcher.criteria = LAB_VIEW_CRITERIA_CURRENT_WORKSPACE
|
||||||
| LAB_VIEW_CRITERIA_ROOT_TOPLEVEL
|
| LAB_VIEW_CRITERIA_ROOT_TOPLEVEL
|
||||||
| LAB_VIEW_CRITERIA_NO_SKIP_WINDOW_SWITCHER;
|
| LAB_VIEW_CRITERIA_NO_SKIP_WINDOW_SWITCHER;
|
||||||
|
|
|
||||||
20
src/osd.c
20
src/osd.c
|
|
@ -230,10 +230,10 @@ get_type(struct view *view)
|
||||||
{
|
{
|
||||||
switch (view->type) {
|
switch (view->type) {
|
||||||
case LAB_XDG_SHELL_VIEW:
|
case LAB_XDG_SHELL_VIEW:
|
||||||
return "[xdg-shell]";
|
return "[W] ";
|
||||||
#if HAVE_XWAYLAND
|
#if HAVE_XWAYLAND
|
||||||
case LAB_XWAYLAND_VIEW:
|
case LAB_XWAYLAND_VIEW:
|
||||||
return "[xwayland]";
|
return "[X] ";
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
|
|
@ -362,7 +362,23 @@ render_osd(struct server *server, cairo_t *cairo, int w, int h,
|
||||||
|
|
||||||
switch (field->content) {
|
switch (field->content) {
|
||||||
case LAB_FIELD_TYPE:
|
case LAB_FIELD_TYPE:
|
||||||
|
if (rc.window_switcher.allworkspaces) {
|
||||||
|
buf_add(&buf, (*view)->workspace->name);
|
||||||
|
if ((*view)->maximized) {
|
||||||
|
buf_add(&buf, " M ");
|
||||||
|
} else if ((*view)->minimized) {
|
||||||
|
buf_add(&buf, " m ");
|
||||||
|
} else if ((*view)->fullscreen) {
|
||||||
|
buf_add(&buf, " F ");
|
||||||
|
} else {
|
||||||
|
buf_add(&buf, " ");
|
||||||
|
}
|
||||||
|
}
|
||||||
buf_add(&buf, get_type(*view));
|
buf_add(&buf, get_type(*view));
|
||||||
|
if (rc.window_switcher.allworkspaces &&
|
||||||
|
wl_list_length(&server->outputs) > 1) {
|
||||||
|
buf_add(&buf, (*view)->output->wlr_output->name);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case LAB_FIELD_IDENTIFIER:
|
case LAB_FIELD_IDENTIFIER:
|
||||||
buf_add(&buf, get_app_id(*view));
|
buf_add(&buf, get_app_id(*view));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue