diff options
Diffstat (limited to 'sway/desktop/xdg_shell_v6.c')
-rw-r--r-- | sway/desktop/xdg_shell_v6.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c index 5feee3e4..ffea03ad 100644 --- a/sway/desktop/xdg_shell_v6.c +++ b/sway/desktop/xdg_shell_v6.c | |||
@@ -175,6 +175,15 @@ static void for_each_surface(struct sway_view *view, | |||
175 | user_data); | 175 | user_data); |
176 | } | 176 | } |
177 | 177 | ||
178 | static void for_each_popup(struct sway_view *view, | ||
179 | wlr_surface_iterator_func_t iterator, void *user_data) { | ||
180 | if (xdg_shell_v6_view_from_view(view) == NULL) { | ||
181 | return; | ||
182 | } | ||
183 | wlr_xdg_surface_v6_for_each_popup(view->wlr_xdg_surface_v6, iterator, | ||
184 | user_data); | ||
185 | } | ||
186 | |||
178 | static void _close(struct sway_view *view) { | 187 | static void _close(struct sway_view *view) { |
179 | if (xdg_shell_v6_view_from_view(view) == NULL) { | 188 | if (xdg_shell_v6_view_from_view(view) == NULL) { |
180 | return; | 189 | return; |
@@ -185,6 +194,18 @@ static void _close(struct sway_view *view) { | |||
185 | } | 194 | } |
186 | } | 195 | } |
187 | 196 | ||
197 | static void close_popups_iterator(struct wlr_surface *surface, | ||
198 | int sx, int sy, void *data) { | ||
199 | struct wlr_xdg_surface_v6 *xdg_surface_v6 = | ||
200 | wlr_xdg_surface_v6_from_wlr_surface(surface); | ||
201 | wlr_xdg_surface_v6_send_close(xdg_surface_v6); | ||
202 | } | ||
203 | |||
204 | static void close_popups(struct sway_view *view) { | ||
205 | wlr_xdg_surface_v6_for_each_popup(view->wlr_xdg_surface_v6, | ||
206 | close_popups_iterator, NULL); | ||
207 | } | ||
208 | |||
188 | static void destroy(struct sway_view *view) { | 209 | static void destroy(struct sway_view *view) { |
189 | struct sway_xdg_shell_v6_view *xdg_shell_v6_view = | 210 | struct sway_xdg_shell_v6_view *xdg_shell_v6_view = |
190 | xdg_shell_v6_view_from_view(view); | 211 | xdg_shell_v6_view_from_view(view); |
@@ -203,7 +224,9 @@ static const struct sway_view_impl view_impl = { | |||
203 | .set_fullscreen = set_fullscreen, | 224 | .set_fullscreen = set_fullscreen, |
204 | .wants_floating = wants_floating, | 225 | .wants_floating = wants_floating, |
205 | .for_each_surface = for_each_surface, | 226 | .for_each_surface = for_each_surface, |
227 | .for_each_popup = for_each_popup, | ||
206 | .close = _close, | 228 | .close = _close, |
229 | .close_popups = close_popups, | ||
207 | .destroy = destroy, | 230 | .destroy = destroy, |
208 | }; | 231 | }; |
209 | 232 | ||