Window switch, add workspace info and window state (M/m/F)

This commit is contained in:
DonO 2024-03-11 17:39:03 -05:00
parent 4ecac26548
commit 7513d6abc0
4 changed files with 25 additions and 3 deletions

View file

@ -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));