aboutsummaryrefslogtreecommitdiff
path: root/client.h
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-10-29 16:56:23 -0500
committerLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-10-29 18:11:28 -0500
commit6a0ec2a8c3e470ce76353008e79da7e764c0af6f (patch)
treecce7820f66b796c9d97a26465def70fa06cfda20 /client.h
parent1eeb3689d3ec5b917b5ccf730a6497e4b9fcd0a6 (diff)
parent846ce52b926797dc51f9fcdc2d121ee63fb68580 (diff)
Merge remote-tracking branch 'upstream/main' into wlroots-next
Diffstat (limited to 'client.h')
-rw-r--r--client.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/client.h b/client.h
index b89a659..64d097f 100644
--- a/client.h
+++ b/client.h
@@ -287,6 +287,17 @@ client_surface_at(Client *c, double cx, double cy, double *sx, double *sy)
}
static inline int
+client_wants_focus(Client *c)
+{
+#ifdef XWAYLAND
+ return client_is_unmanaged(c)
+ && wlr_xwayland_or_surface_wants_focus(c->surface.xwayland)
+ && wlr_xwayland_icccm_input_model(c->surface.xwayland) != WLR_ICCCM_INPUT_MODEL_NONE;
+#endif
+ return 0;
+}
+
+static inline int
client_wants_fullscreen(Client *c)
{
#ifdef XWAYLAND
@@ -318,3 +329,18 @@ toplevel_from_popup(struct wlr_xdg_popup *popup)
}
}
}
+
+static inline void *
+toplevel_from_wlr_layer_surface(struct wlr_surface *s)
+{
+ Client *c;
+ struct wlr_layer_surface_v1 *wlr_layer_surface;
+
+ if ((c = client_from_wlr_surface(s)))
+ return c;
+ else if (s && wlr_surface_is_layer_surface(s)
+ && (wlr_layer_surface = wlr_layer_surface_v1_from_wlr_surface(s)))
+ return wlr_layer_surface->data;
+
+ return NULL;
+}