mirror of
https://codeberg.org/FabricSoul/dwl.git
synced 2025-08-04 04:20:24 -04:00
guarantee client_get_{title,appid} never return NULL
ΔSLOC: -6
This commit is contained in:
parent
e454f7ae81
commit
07aeef1f7e
2 changed files with 8 additions and 14 deletions
8
client.h
8
client.h
|
@ -126,9 +126,9 @@ client_get_appid(Client *c)
|
|||
{
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c))
|
||||
return c->surface.xwayland->class;
|
||||
return c->surface.xwayland->class ? c->surface.xwayland->class : "broken";
|
||||
#endif
|
||||
return c->surface.xdg->toplevel->app_id;
|
||||
return c->surface.xdg->toplevel->app_id ? c->surface.xdg->toplevel->app_id : "broken";
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
@ -200,9 +200,9 @@ client_get_title(Client *c)
|
|||
{
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c))
|
||||
return c->surface.xwayland->title;
|
||||
return c->surface.xwayland->title ? c->surface.xwayland->title : "broken";
|
||||
#endif
|
||||
return c->surface.xdg->toplevel->title;
|
||||
return c->surface.xdg->toplevel->title ? c->surface.xdg->toplevel->title : "broken";
|
||||
}
|
||||
|
||||
static inline int
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue