Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
udfn committed Aug 23, 2023
2 parents 8485911 + a908651 commit 06a3235
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions sway/desktop/layer_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ struct wlr_layer_surface_v1 *toplevel_layer_surface_from_surface(
}

// Layer surface popup
struct wlr_xdg_surface * xdg_popup = NULL;
if ((xdg_popup = wlr_xdg_surface_try_from_wlr_surface(surface)) &&
xdg_popup->role == WLR_XDG_SURFACE_ROLE_POPUP) {
if (!xdg_popup->popup->parent) {
struct wlr_xdg_surface *xdg_surface = NULL;
if ((xdg_surface = wlr_xdg_surface_try_from_wlr_surface(surface)) &&
xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP && xdg_surface->popup != NULL) {
if (!xdg_surface->popup->parent) {
return NULL;
}
surface = wlr_surface_get_root_surface(xdg_popup->popup->parent);
surface = wlr_surface_get_root_surface(xdg_surface->popup->parent);
continue;
}

Expand Down
3 changes: 2 additions & 1 deletion sway/input/cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ static struct wlr_surface *layer_surface_at(struct sway_output *output,
static bool surface_is_xdg_popup(struct wlr_surface *surface) {
struct wlr_surface *root = wlr_surface_get_root_surface(surface);
struct wlr_xdg_surface *xdg_surface = wlr_xdg_surface_try_from_wlr_surface(root);
return xdg_surface != NULL && xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP;
return xdg_surface != NULL && xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP &&
xdg_surface->popup != NULL;
}

static struct wlr_surface *layer_surface_popup_at(struct sway_output *output,
Expand Down
2 changes: 1 addition & 1 deletion sway/tree/container.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ bool surface_is_popup(struct wlr_surface *surface) {
}
struct wlr_xdg_surface *xdg_surface =
wlr_xdg_surface_try_from_wlr_surface(surface);
return xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP;
return xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP && xdg_surface->popup != NULL;
}

struct sway_container *container_at(struct sway_workspace *workspace,
Expand Down

0 comments on commit 06a3235

Please sign in to comment.