summaryrefslogtreecommitdiffstats
path: root/sway/desktop/xdg_shell_v6.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_v6.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_v6.c')
-rw-r--r--sway/desktop/xdg_shell_v6.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c
index 4502c386..ffea03ad 100644
--- a/sway/desktop/xdg_shell_v6.c
+++ b/sway/desktop/xdg_shell_v6.c
@@ -194,6 +194,18 @@ static void _close(struct sway_view *view) {
194 } 194 }
195} 195}
196 196
197static 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
204static 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
197static void destroy(struct sway_view *view) { 209static void destroy(struct sway_view *view) {
198 struct sway_xdg_shell_v6_view *xdg_shell_v6_view = 210 struct sway_xdg_shell_v6_view *xdg_shell_v6_view =
199 xdg_shell_v6_view_from_view(view); 211 xdg_shell_v6_view_from_view(view);
@@ -214,6 +226,7 @@ static const struct sway_view_impl view_impl = {
214 .for_each_surface = for_each_surface, 226 .for_each_surface = for_each_surface,
215 .for_each_popup = for_each_popup, 227 .for_each_popup = for_each_popup,
216 .close = _close, 228 .close = _close,
229 .close_popups = close_popups,
217 .destroy = destroy, 230 .destroy = destroy,
218}; 231};
219 232