correctly handle cursor motion when button is held (for layer surfaces)

This commit is contained in:
Leonardo Hernández Hernández 2022-10-08 13:00:03 -05:00
parent 0d1ca4663c
commit 952fde68a3
No known key found for this signature in database
GPG key ID: E538897EE11B9624
2 changed files with 22 additions and 4 deletions

View file

@ -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;
}