diff options
author | emersion <contact@emersion.fr> | 2018-08-02 08:11:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-02 08:11:10 +0100 |
commit | 47bf4ed0cbf104d09bba7f39acbf2ceb84c2c694 (patch) | |
tree | 8f0085c1829ab97a920acd9d5116732779177631 /sway/desktop/xdg_shell.c | |
parent | Correctly track saved surfaces during multiple transactions (diff) | |
parent | Merge pull request #2391 from RyanDwyer/fix-popups-v2 (diff) | |
download | sway-47bf4ed0cbf104d09bba7f39acbf2ceb84c2c694.tar.gz sway-47bf4ed0cbf104d09bba7f39acbf2ceb84c2c694.tar.zst sway-47bf4ed0cbf104d09bba7f39acbf2ceb84c2c694.zip |
Merge branch 'master' into fix-resize-wiggle
Diffstat (limited to 'sway/desktop/xdg_shell.c')
-rw-r--r-- | sway/desktop/xdg_shell.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c index e6e1527e..b364663d 100644 --- a/sway/desktop/xdg_shell.c +++ b/sway/desktop/xdg_shell.c | |||
@@ -179,6 +179,14 @@ static void for_each_surface(struct sway_view *view, | |||
179 | user_data); | 179 | user_data); |
180 | } | 180 | } |
181 | 181 | ||
182 | static void for_each_popup(struct sway_view *view, | ||
183 | wlr_surface_iterator_func_t iterator, void *user_data) { | ||
184 | if (xdg_shell_view_from_view(view) == NULL) { | ||
185 | return; | ||
186 | } | ||
187 | wlr_xdg_surface_for_each_popup(view->wlr_xdg_surface, iterator, user_data); | ||
188 | } | ||
189 | |||
182 | static void _close(struct sway_view *view) { | 190 | static void _close(struct sway_view *view) { |
183 | if (xdg_shell_view_from_view(view) == NULL) { | 191 | if (xdg_shell_view_from_view(view) == NULL) { |
184 | return; | 192 | return; |
@@ -189,6 +197,18 @@ static void _close(struct sway_view *view) { | |||
189 | } | 197 | } |
190 | } | 198 | } |
191 | 199 | ||
200 | static void close_popups_iterator(struct wlr_surface *surface, | ||
201 | int sx, int sy, void *data) { | ||
202 | struct wlr_xdg_surface *xdg_surface = | ||
203 | wlr_xdg_surface_from_wlr_surface(surface); | ||
204 | wlr_xdg_surface_send_close(xdg_surface); | ||
205 | } | ||
206 | |||
207 | static void close_popups(struct sway_view *view) { | ||
208 | wlr_xdg_surface_for_each_popup(view->wlr_xdg_surface, | ||
209 | close_popups_iterator, NULL); | ||
210 | } | ||
211 | |||
192 | static void destroy(struct sway_view *view) { | 212 | static void destroy(struct sway_view *view) { |
193 | struct sway_xdg_shell_view *xdg_shell_view = | 213 | struct sway_xdg_shell_view *xdg_shell_view = |
194 | xdg_shell_view_from_view(view); | 214 | xdg_shell_view_from_view(view); |
@@ -207,7 +227,9 @@ static const struct sway_view_impl view_impl = { | |||
207 | .set_fullscreen = set_fullscreen, | 227 | .set_fullscreen = set_fullscreen, |
208 | .wants_floating = wants_floating, | 228 | .wants_floating = wants_floating, |
209 | .for_each_surface = for_each_surface, | 229 | .for_each_surface = for_each_surface, |
230 | .for_each_popup = for_each_popup, | ||
210 | .close = _close, | 231 | .close = _close, |
232 | .close_popups = close_popups, | ||
211 | .destroy = destroy, | 233 | .destroy = destroy, |
212 | }; | 234 | }; |
213 | 235 | ||