Window switcher, more changes

This commit is contained in:
DonO 2024-03-12 16:25:25 -05:00
parent 12a9aba0fd
commit 7e8c8b6a5a
4 changed files with 31 additions and 20 deletions

View file

@ -206,8 +206,14 @@ fill_window_switcher_field(char *nodename, char *content)
current_field->content = LAB_FIELD_TRIMMED_IDENTIFIER;
} else if (!strcmp(content, "title")) {
current_field->content = LAB_FIELD_TITLE;
} else if (!strcmp(content, "winfo")) {
current_field->content = LAB_FIELD_WINFO;
} else if (!strcmp(content, "workspace")) {
current_field->content = LAB_FIELD_WORKSPACE;
} else if (!strcmp(content, "state")) {
current_field->content = LAB_FIELD_WIN_STATE;
} else if (!strcmp(content, "type_short")) {
current_field->content = LAB_FIELD_TYPE_SHORT;
} else if (!strcmp(content, "output")) {
current_field->content = LAB_FIELD_OUTPUT;
} else {
wlr_log(WLR_ERROR, "bad windowSwitcher field '%s'", content);
}
@ -897,8 +903,7 @@ 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.all_workspaces);
if (rc.window_switcher.all_workspaces) {
if (parse_bool(content, -1) == true) {
rc.window_switcher.criteria &=
~LAB_VIEW_CRITERIA_CURRENT_WORKSPACE;
}

View file

@ -378,20 +378,24 @@ render_osd(struct server *server, cairo_t *cairo, int w, int h,
case LAB_FIELD_TYPE:
buf_add(&buf, get_type(*view));
break;
case LAB_FIELD_WINFO:
if (rc.window_switcher.all_workspaces) {
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, " ");
}
case LAB_FIELD_TYPE_SHORT:
buf_add(&buf, get_winfo(*view));
break;
case LAB_FIELD_WORKSPACE:
buf_add(&buf, (*view)->workspace->name);
break;
case LAB_FIELD_WIN_STATE:
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, " ");
}
break;
case LAB_FIELD_OUTPUT:
if (wl_list_length(&server->outputs) > 1 &&
output_is_usable((*view)->output)) {
buf_add(&buf, (*view)->output->wlr_output->name);