aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-03-18 00:49:47 -0600
committerLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-03-18 00:49:47 -0600
commitf1c92b05fb124d6865d4dfb0c121b3dbf7fd5407 (patch)
tree43be0f0e45b0984094233768fe0a59055065e584
parent79f85bde99e469cea01a0b44b235b53cab55aee3 (diff)
get old client by surface's node
-rw-r--r--dwl.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/dwl.c b/dwl.c
index 347178b..4df0e95 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1076,7 +1076,6 @@ focusclient(Client *c, int lift)
{
struct wlr_surface *old = seat->keyboard_state.focused_surface;
struct wlr_keyboard *kb;
- Client *w;
int i;
/* Raise client in stacking order if requested */
@@ -1114,15 +1113,11 @@ focusclient(Client *c, int lift)
))
return;
} else {
-#ifdef XWAYLAND
- if (wlr_surface_is_xwayland_surface(old))
- w = wlr_xwayland_surface_from_wlr_surface(old)->data;
- else
-#endif
- w = wlr_xdg_surface_from_wlr_surface(old)->data;
-
- for (i = 0; i < 4; i++)
- wlr_scene_rect_set_color(w->border[i], bordercolor);
+ Client *w;
+ struct wlr_scene_node *node = old->data;
+ if ((w = node->data))
+ for (i = 0; i < 4; i++)
+ wlr_scene_rect_set_color(w->border[i], bordercolor);
client_activate_surface(old, 0);
}