diff options
Diffstat (limited to 'sway/desktop/xdg_shell_v6.c')
-rw-r--r-- | sway/desktop/xdg_shell_v6.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c index df48345c..4b50093f 100644 --- a/sway/desktop/xdg_shell_v6.c +++ b/sway/desktop/xdg_shell_v6.c | |||
@@ -57,6 +57,16 @@ static void set_activated(struct sway_view *view, bool activated) { | |||
57 | } | 57 | } |
58 | } | 58 | } |
59 | 59 | ||
60 | static void close(struct sway_view *view) { | ||
61 | if (!assert_xdg(view)) { | ||
62 | return; | ||
63 | } | ||
64 | struct wlr_xdg_surface_v6 *surface = view->wlr_xdg_surface_v6; | ||
65 | if (surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL) { | ||
66 | wlr_xdg_toplevel_v6_send_close(surface); | ||
67 | } | ||
68 | } | ||
69 | |||
60 | static void handle_commit(struct wl_listener *listener, void *data) { | 70 | static void handle_commit(struct wl_listener *listener, void *data) { |
61 | struct sway_xdg_surface_v6 *sway_surface = | 71 | struct sway_xdg_surface_v6 *sway_surface = |
62 | wl_container_of(listener, sway_surface, commit); | 72 | wl_container_of(listener, sway_surface, commit); |
@@ -107,6 +117,7 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) { | |||
107 | sway_view->iface.set_size = set_size; | 117 | sway_view->iface.set_size = set_size; |
108 | sway_view->iface.set_position = set_position; | 118 | sway_view->iface.set_position = set_position; |
109 | sway_view->iface.set_activated = set_activated; | 119 | sway_view->iface.set_activated = set_activated; |
120 | sway_view->iface.close = close; | ||
110 | sway_view->wlr_xdg_surface_v6 = xdg_surface; | 121 | sway_view->wlr_xdg_surface_v6 = xdg_surface; |
111 | sway_view->sway_xdg_surface_v6 = sway_surface; | 122 | sway_view->sway_xdg_surface_v6 = sway_surface; |
112 | sway_view->surface = xdg_surface->surface; | 123 | sway_view->surface = xdg_surface->surface; |