mirror of
https://github.com/labwc/labwc.git
synced 2026-04-12 08:21:13 -04:00
Option to show full app_id in window switcher
It is now possible to specify whether to show full application identifier or the trimmed variant in window switcher OSD.
This commit is contained in:
parent
702c7fc68b
commit
5e09b3f85e
5 changed files with 24 additions and 2 deletions
15
src/osd.c
15
src/osd.c
|
|
@ -41,6 +41,15 @@ static const char *
|
|||
get_formatted_app_id(struct view *view)
|
||||
{
|
||||
char *s = (char *)view_get_string_prop(view, "app_id");
|
||||
if (!s) {
|
||||
return NULL;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
static const char *
|
||||
get_trimmed_app_id(char *s)
|
||||
{
|
||||
if (!s) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -355,6 +364,12 @@ render_osd(struct server *server, cairo_t *cairo, int w, int h,
|
|||
case LAB_FIELD_IDENTIFIER:
|
||||
buf_add(&buf, get_app_id(*view));
|
||||
break;
|
||||
case LAB_FIELD_TRIMMED_IDENTIFIER:
|
||||
{
|
||||
char *s = (char *)get_app_id(*view);
|
||||
buf_add(&buf, get_trimmed_app_id(s));
|
||||
break;
|
||||
}
|
||||
case LAB_FIELD_TITLE:
|
||||
buf_add(&buf, get_title(*view));
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue