diff --git a/docs/labwc-config.5.scd b/docs/labwc-config.5.scd index 2ba5ce19..1d8114dc 100644 --- a/docs/labwc-config.5.scd +++ b/docs/labwc-config.5.scd @@ -206,7 +206,7 @@ this is for compatibility with Openbox. *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 windows and WM_CLASS for XWayland clients) diff --git a/include/config/rcxml.h b/include/config/rcxml.h index 277db849..707f00d4 100644 --- a/include/config/rcxml.h +++ b/include/config/rcxml.h @@ -141,6 +141,7 @@ struct rcxml { bool show; bool preview; bool outlines; + bool allworkspaces; uint32_t criteria; struct wl_list fields; /* struct window_switcher_field.link */ } window_switcher; diff --git a/src/config/rcxml.c b/src/config/rcxml.c index e672aebd..220a78fb 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -895,9 +895,13 @@ entry(xmlNode *node, char *nodename, char *content) } else if (!strcasecmp(nodename, "outlines.windowSwitcher")) { set_bool(content, &rc.window_switcher.outlines); } else if (!strcasecmp(nodename, "allWorkspaces.windowSwitcher")) { + set_bool(content, &rc.window_switcher.allworkspaces); if (parse_bool(content, -1) == true) { rc.window_switcher.criteria &= ~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 */ @@ -1155,6 +1159,7 @@ rcxml_init(void) rc.window_switcher.show = true; rc.window_switcher.preview = true; rc.window_switcher.outlines = true; + rc.window_switcher.allworkspaces = false; rc.window_switcher.criteria = LAB_VIEW_CRITERIA_CURRENT_WORKSPACE | LAB_VIEW_CRITERIA_ROOT_TOPLEVEL | LAB_VIEW_CRITERIA_NO_SKIP_WINDOW_SWITCHER; diff --git a/src/osd.c b/src/osd.c index b0b59a78..fc70fea5 100644 --- a/src/osd.c +++ b/src/osd.c @@ -230,10 +230,10 @@ get_type(struct view *view) { switch (view->type) { case LAB_XDG_SHELL_VIEW: - return "[xdg-shell]"; + return "[W] "; #if HAVE_XWAYLAND case LAB_XWAYLAND_VIEW: - return "[xwayland]"; + return "[X] "; #endif } return ""; @@ -362,7 +362,23 @@ render_osd(struct server *server, cairo_t *cairo, int w, int h, switch (field->content) { 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)); + if (rc.window_switcher.allworkspaces && + wl_list_length(&server->outputs) > 1) { + buf_add(&buf, (*view)->output->wlr_output->name); + } break; case LAB_FIELD_IDENTIFIER: buf_add(&buf, get_app_id(*view));