aboutsummaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-05-23 09:14:21 -0500
committerLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-05-23 10:55:28 -0500
commit40449fa64fcacb98372e576cc21e192ab783162f (patch)
treed3e074ec9b6d5c1e4068e83b72bb51b1910f1e18 /dwl.c
parentecbc2c61db180dc8ab1053b7cdc1e4817be33d36 (diff)
add a new function to get a client from a wlr_surface
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/dwl.c b/dwl.c
index b4b4b0d..81ad91e 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1142,8 +1142,7 @@ focusclient(Client *c, int lift)
return;
} else {
Client *w;
- struct wlr_scene_node *node = old->data;
- if (old->role_data && (w = node->data))
+ if (old->role_data && (w = client_from_wlr_surface(old)))
for (i = 0; i < 4; i++)
wlr_scene_rect_set_color(w->border[i], bordercolor);
@@ -2336,11 +2335,7 @@ void
urgent(struct wl_listener *listener, void *data)
{
struct wlr_xdg_activation_v1_request_activate_event *event = data;
- Client *c;
-
- if (!wlr_surface_is_xdg_surface(event->surface))
- return;
- c = wlr_xdg_surface_from_wlr_surface(event->surface)->data;
+ Client *c = client_from_wlr_surface(event->surface);
if (c != selclient()) {
c->isurgent = 1;
printstatus();