From 952fde68a3cb1871f39c464d56f999d5a966e7a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?= Date: Sat, 8 Oct 2022 13:00:03 -0500 Subject: correctly handle cursor motion when button is held (for layer surfaces) --- client.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'client.h') diff --git a/client.h b/client.h index 4ecdd47..09e7609 100644 --- a/client.h +++ b/client.h @@ -307,3 +307,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; +} -- cgit v1.2.3 From 332ceb7136da268ff3e62f32d40bc8969f0aca37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?= Date: Thu, 16 Jun 2022 16:05:07 -0500 Subject: allow unmanaged clients (like dzen or dmenu) to have keyboard focus --- client.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'client.h') diff --git a/client.h b/client.h index 09e7609..49982e0 100644 --- a/client.h +++ b/client.h @@ -275,6 +275,17 @@ client_surface_at(Client *c, double cx, double cy, double *sx, double *sy) return wlr_xdg_surface_surface_at(c->surface.xdg, cx, cy, sx, 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) { -- cgit v1.2.3