summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@gmail.com>2021-09-05 11:45:27 -0500
committerDevin J. Pohly <djpohly@gmail.com>2021-09-05 11:45:27 -0500
commit417e958a15d2c4b5fec22f5beeb4ee92c2f42e51 (patch)
treee157ce9c89c11943a2fb9420faa571b7e5c47698
parent55bbbc3dcb3d6b938623776993f7ab8494e90763 (diff)
parent2e9c4d8ea90e47667ef4fa417aa3e6f46034699e (diff)
Merge branch 'main' into wlroots-next
-rw-r--r--client.h30
1 files changed, 14 insertions, 16 deletions
diff --git a/client.h b/client.h
index 56e3089..4fd1863 100644
--- a/client.h
+++ b/client.h
@@ -5,7 +5,7 @@
* that they will simply compile out if the chosen #defines leave them unused.
*/
-/* Leave this function first; it's used in the others */
+/* Leave these functions first; they're used in the others */
static inline int
client_is_x11(Client *c)
{
@@ -16,6 +16,16 @@ client_is_x11(Client *c)
#endif
}
+static inline struct wlr_surface *
+client_surface(Client *c)
+{
+#ifdef XWAYLAND
+ if (client_is_x11(c))
+ return c->surface.xwayland->surface;
+#endif
+ return c->surface.xdg->surface;
+}
+
/* The others */
static inline void
client_activate_surface(struct wlr_surface *s, int activated)
@@ -35,14 +45,12 @@ client_activate_surface(struct wlr_surface *s, int activated)
static inline void
client_for_each_surface(Client *c, wlr_surface_iterator_func_t fn, void *data)
{
+ wlr_surface_for_each_surface(client_surface(c), fn, data);
#ifdef XWAYLAND
- if (client_is_x11(c)) {
- wlr_surface_for_each_surface(c->surface.xwayland->surface,
- fn, data);
+ if (client_is_x11(c))
return;
- }
#endif
- wlr_xdg_surface_for_each_surface(c->surface.xdg, fn, data);
+ wlr_xdg_surface_for_each_popup_surface(c->surface.xdg, fn, data);
}
static inline const char *
@@ -153,16 +161,6 @@ client_set_tiled(Client *c, uint32_t edges)
}
static inline struct wlr_surface *
-client_surface(Client *c)
-{
-#ifdef XWAYLAND
- if (client_is_x11(c))
- return c->surface.xwayland->surface;
-#endif
- return c->surface.xdg->surface;
-}
-
-static inline struct wlr_surface *
client_surface_at(Client *c, double cx, double cy, double *sx, double *sy)
{
#ifdef XWAYLAND