diff options
author | Kirill Primak <vyivel@eclair.cafe> | 2023-07-26 20:32:33 +0300 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2023-08-21 18:41:32 +0200 |
commit | a9086518219c0ace4a5d81c2f7219dae3b6aa20c (patch) | |
tree | 5593753d34eee2ea4651bfecd1c238cfe18263c9 | |
parent | chase wlroots!4316 (diff) | |
download | sway-a9086518219c0ace4a5d81c2f7219dae3b6aa20c.tar.gz sway-a9086518219c0ace4a5d81c2f7219dae3b6aa20c.tar.zst sway-a9086518219c0ace4a5d81c2f7219dae3b6aa20c.zip |
chore: chase wlroots xdg-surface role rework
-rw-r--r-- | sway/desktop/layer_shell.c | 10 | ||||
-rw-r--r-- | sway/input/cursor.c | 3 | ||||
-rw-r--r-- | sway/tree/container.c | 2 |
3 files changed, 8 insertions, 7 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c index d990d92a..8c6cedfe 100644 --- a/sway/desktop/layer_shell.c +++ b/sway/desktop/layer_shell.c | |||
@@ -35,13 +35,13 @@ struct wlr_layer_surface_v1 *toplevel_layer_surface_from_surface( | |||
35 | } | 35 | } |
36 | 36 | ||
37 | // Layer surface popup | 37 | // Layer surface popup |
38 | struct wlr_xdg_surface * xdg_popup = NULL; | 38 | struct wlr_xdg_surface *xdg_surface = NULL; |
39 | if ((xdg_popup = wlr_xdg_surface_try_from_wlr_surface(surface)) && | 39 | if ((xdg_surface = wlr_xdg_surface_try_from_wlr_surface(surface)) && |
40 | xdg_popup->role == WLR_XDG_SURFACE_ROLE_POPUP) { | 40 | xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP && xdg_surface->popup != NULL) { |
41 | if (!xdg_popup->popup->parent) { | 41 | if (!xdg_surface->popup->parent) { |
42 | return NULL; | 42 | return NULL; |
43 | } | 43 | } |
44 | surface = wlr_surface_get_root_surface(xdg_popup->popup->parent); | 44 | surface = wlr_surface_get_root_surface(xdg_surface->popup->parent); |
45 | continue; | 45 | continue; |
46 | } | 46 | } |
47 | 47 | ||
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 62c74d04..44a5d6f7 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -56,7 +56,8 @@ static struct wlr_surface *layer_surface_at(struct sway_output *output, | |||
56 | static bool surface_is_xdg_popup(struct wlr_surface *surface) { | 56 | static bool surface_is_xdg_popup(struct wlr_surface *surface) { |
57 | struct wlr_xdg_surface *xdg_surface = | 57 | struct wlr_xdg_surface *xdg_surface = |
58 | wlr_xdg_surface_try_from_wlr_surface(surface); | 58 | wlr_xdg_surface_try_from_wlr_surface(surface); |
59 | return xdg_surface != NULL && xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP; | 59 | return xdg_surface != NULL && xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP && |
60 | xdg_surface->popup != NULL; | ||
60 | } | 61 | } |
61 | 62 | ||
62 | static struct wlr_surface *layer_surface_popup_at(struct sway_output *output, | 63 | static struct wlr_surface *layer_surface_popup_at(struct sway_output *output, |
diff --git a/sway/tree/container.c b/sway/tree/container.c index d2c4ffc4..8c344a6d 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -394,7 +394,7 @@ static bool surface_is_popup(struct wlr_surface *surface) { | |||
394 | } | 394 | } |
395 | struct wlr_xdg_surface *xdg_surface = | 395 | struct wlr_xdg_surface *xdg_surface = |
396 | wlr_xdg_surface_try_from_wlr_surface(surface); | 396 | wlr_xdg_surface_try_from_wlr_surface(surface); |
397 | return xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP; | 397 | return xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP && xdg_surface->popup != NULL; |
398 | } | 398 | } |
399 | 399 | ||
400 | struct sway_container *container_at(struct sway_workspace *workspace, | 400 | struct sway_container *container_at(struct sway_workspace *workspace, |