aboutsummaryrefslogtreecommitdiff
path: root/client.h
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-06-16 16:05:07 -0500
committerLeonardo Hernández <leohdz172@protonmail.com>2022-10-15 18:00:24 -0500
commit332ceb7136da268ff3e62f32d40bc8969f0aca37 (patch)
tree0c613894cd081b192cb5a8b13cf367b3353e2c48 /client.h
parent9e912cf790b6f4120dd4baaee1aad924f279581b (diff)
allow unmanaged clients (like dzen or dmenu) to have keyboard focus
Diffstat (limited to 'client.h')
-rw-r--r--client.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/client.h b/client.h
index 09e7609..49982e0 100644
--- a/client.h
+++ b/client.h
@@ -276,6 +276,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