diff options
author | Leonardo Hernández Hernández <leohdz172@proton.me> | 2024-02-07 02:27:07 +0000 |
---|---|---|
committer | Leonardo Hernández Hernández <leohdz172@proton.me> | 2024-02-07 02:27:07 +0000 |
commit | 8e0b5baf8ef9fcd0a70104a9a02fbc474ea9eb89 (patch) | |
tree | 98f8cfcb74b1ba24a5625650cc52ea884d09d857 /client.h | |
parent | 5fec98b17ac398070ca05ba12fab7c22ea56a753 (diff) | |
parent | 8006e7920085947673517c3e296a1e308f935f75 (diff) |
Merge remote-tracking branch 'upstream/main' into wlroots-next
Diffstat (limited to 'client.h')
-rw-r--r-- | client.h | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -172,14 +172,29 @@ client_get_parent(Client *c) { Client *p = NULL; #ifdef XWAYLAND - if (client_is_x11(c) && c->surface.xwayland->parent) - toplevel_from_wlr_surface(c->surface.xwayland->parent->surface, &p, NULL); + if (client_is_x11(c)) { + if (c->surface.xwayland->parent) + toplevel_from_wlr_surface(c->surface.xwayland->parent->surface, &p, NULL); + return p; + } #endif if (c->surface.xdg->toplevel->parent) toplevel_from_wlr_surface(c->surface.xdg->toplevel->parent->base->surface, &p, NULL); return p; } +static inline int +client_has_children(Client *c) +{ +#ifdef XWAYLAND + if (client_is_x11(c)) + return !wl_list_empty(&c->surface.xwayland->children); +#endif + /* surface.xdg->link is never empty because it always contains at least the + * surface itself. */ + return wl_list_length(&c->surface.xdg->link) > 1; +} + static inline const char * client_get_title(Client *c) { |