aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/xdg_shell.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-07-31 19:58:34 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-07-31 19:58:34 +1000
commit7a59508da467a3b793e355e28ae67ce04633761c (patch)
tree0f72b5b1804f6f6afa3b2317a4d9e3cc402fda9a /sway/desktop/xdg_shell.c
parentFix popups (diff)
downloadsway-7a59508da467a3b793e355e28ae67ce04633761c.tar.gz
sway-7a59508da467a3b793e355e28ae67ce04633761c.tar.zst
sway-7a59508da467a3b793e355e28ae67ce04633761c.zip
Close popups when changing focus
Also reverts the send frame done changes from the previous commit.
Diffstat (limited to 'sway/desktop/xdg_shell.c')
-rw-r--r--sway/desktop/xdg_shell.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c
index 9f94bd74..b364663d 100644
--- a/sway/desktop/xdg_shell.c
+++ b/sway/desktop/xdg_shell.c
@@ -197,6 +197,18 @@ static void _close(struct sway_view *view) {
197 } 197 }
198} 198}
199 199
200static 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
207static 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
200static void destroy(struct sway_view *view) { 212static void destroy(struct sway_view *view) {
201 struct sway_xdg_shell_view *xdg_shell_view = 213 struct sway_xdg_shell_view *xdg_shell_view =
202 xdg_shell_view_from_view(view); 214 xdg_shell_view_from_view(view);
@@ -217,6 +229,7 @@ static const struct sway_view_impl view_impl = {
217 .for_each_surface = for_each_surface, 229 .for_each_surface = for_each_surface,
218 .for_each_popup = for_each_popup, 230 .for_each_popup = for_each_popup,
219 .close = _close, 231 .close = _close,
232 .close_popups = close_popups,
220 .destroy = destroy, 233 .destroy = destroy,
221}; 234};
222 235