mirror of
https://codeberg.org/dwl/dwl.git
synced 2025-11-02 09:01:42 -05:00
guarantee client_get_{title,appid} never return NULL
ΔSLOC: -6
This commit is contained in:
parent
1b805ddd38
commit
93068810ef
2 changed files with 14 additions and 14 deletions
14
client.h
14
client.h
|
|
@ -124,11 +124,14 @@ client_set_bounds(Client *c, int32_t width, int32_t height)
|
|||
static inline const char *
|
||||
client_get_appid(Client *c)
|
||||
{
|
||||
const char *app_id;
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c))
|
||||
return c->surface.xwayland->class;
|
||||
app_id = c->surface.xwayland->class;
|
||||
else
|
||||
#endif
|
||||
return c->surface.xdg->toplevel->app_id;
|
||||
app_id = c->surface.xdg->toplevel->app_id;
|
||||
return app_id ? app_id : "broken";
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
|
@ -198,11 +201,14 @@ client_has_children(Client *c)
|
|||
static inline const char *
|
||||
client_get_title(Client *c)
|
||||
{
|
||||
const char *title;
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c))
|
||||
return c->surface.xwayland->title;
|
||||
title = c->surface.xwayland->title;
|
||||
else
|
||||
#endif
|
||||
return c->surface.xdg->toplevel->title;
|
||||
title = c->surface.xdg->toplevel->title;
|
||||
return title ? title : "broken";
|
||||
}
|
||||
|
||||
static inline int
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue