mirror of
https://codeberg.org/dwl/dwl.git
synced 2024-12-27 03:36:31 +00:00
chase wlroots!4288
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4288
This commit is contained in:
parent
25db045392
commit
d4f2c6bfd6
1 changed files with 21 additions and 18 deletions
17
client.h
17
client.h
|
@ -54,7 +54,7 @@ client_surface(Client *c)
|
||||||
static inline int
|
static inline int
|
||||||
toplevel_from_wlr_surface(struct wlr_surface *s, Client **pc, LayerSurface **pl)
|
toplevel_from_wlr_surface(struct wlr_surface *s, Client **pc, LayerSurface **pl)
|
||||||
{
|
{
|
||||||
struct wlr_xdg_surface *xdg_surface;
|
struct wlr_xdg_surface *xdg_surface, *tmp_xdg_surface;
|
||||||
struct wlr_surface *root_surface;
|
struct wlr_surface *root_surface;
|
||||||
struct wlr_layer_surface_v1 *layer_surface;
|
struct wlr_layer_surface_v1 *layer_surface;
|
||||||
Client *c = NULL;
|
Client *c = NULL;
|
||||||
|
@ -82,16 +82,20 @@ toplevel_from_wlr_surface(struct wlr_surface *s, Client **pc, LayerSurface **pl)
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((xdg_surface = wlr_xdg_surface_try_from_wlr_surface(root_surface))) {
|
xdg_surface = wlr_xdg_surface_try_from_wlr_surface(root_surface);
|
||||||
while (1) {
|
while (xdg_surface) {
|
||||||
|
tmp_xdg_surface = NULL;
|
||||||
switch (xdg_surface->role) {
|
switch (xdg_surface->role) {
|
||||||
case WLR_XDG_SURFACE_ROLE_POPUP:
|
case WLR_XDG_SURFACE_ROLE_POPUP:
|
||||||
if (!xdg_surface->popup->parent)
|
if (!xdg_surface->popup || !xdg_surface->popup->parent)
|
||||||
return -1;
|
return -1;
|
||||||
else if (!wlr_xdg_surface_try_from_wlr_surface(xdg_surface->popup->parent))
|
|
||||||
|
tmp_xdg_surface = wlr_xdg_surface_try_from_wlr_surface(xdg_surface->popup->parent);
|
||||||
|
|
||||||
|
if (!tmp_xdg_surface)
|
||||||
return toplevel_from_wlr_surface(xdg_surface->popup->parent, pc, pl);
|
return toplevel_from_wlr_surface(xdg_surface->popup->parent, pc, pl);
|
||||||
|
|
||||||
xdg_surface = wlr_xdg_surface_try_from_wlr_surface(xdg_surface->popup->parent);
|
xdg_surface = tmp_xdg_surface;
|
||||||
break;
|
break;
|
||||||
case WLR_XDG_SURFACE_ROLE_TOPLEVEL:
|
case WLR_XDG_SURFACE_ROLE_TOPLEVEL:
|
||||||
c = xdg_surface->data;
|
c = xdg_surface->data;
|
||||||
|
@ -101,7 +105,6 @@ toplevel_from_wlr_surface(struct wlr_surface *s, Client **pc, LayerSurface **pl)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
end:
|
end:
|
||||||
if (pl)
|
if (pl)
|
||||||
|
|
Loading…
Reference in a new issue