diff options
Diffstat (limited to 'sway/desktop/xdg_shell.c')
-rw-r--r-- | sway/desktop/xdg_shell.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c index 0f45399d..da3a1cdd 100644 --- a/sway/desktop/xdg_shell.c +++ b/sway/desktop/xdg_shell.c | |||
@@ -108,6 +108,19 @@ static void set_activated(struct sway_view *view, bool activated) { | |||
108 | } | 108 | } |
109 | } | 109 | } |
110 | 110 | ||
111 | static void set_tiled(struct sway_view *view, bool tiled) { | ||
112 | if (xdg_shell_view_from_view(view) == NULL) { | ||
113 | return; | ||
114 | } | ||
115 | struct wlr_xdg_surface *surface = view->wlr_xdg_surface; | ||
116 | enum wlr_edges edges = WLR_EDGE_NONE; | ||
117 | if (tiled) { | ||
118 | edges = WLR_EDGE_LEFT | WLR_EDGE_RIGHT | WLR_EDGE_TOP | | ||
119 | WLR_EDGE_BOTTOM; | ||
120 | } | ||
121 | wlr_xdg_toplevel_set_tiled(surface, edges); | ||
122 | } | ||
123 | |||
111 | static void set_fullscreen(struct sway_view *view, bool fullscreen) { | 124 | static void set_fullscreen(struct sway_view *view, bool fullscreen) { |
112 | if (xdg_shell_view_from_view(view) == NULL) { | 125 | if (xdg_shell_view_from_view(view) == NULL) { |
113 | return; | 126 | return; |
@@ -157,6 +170,7 @@ static const struct sway_view_impl view_impl = { | |||
157 | .get_string_prop = get_string_prop, | 170 | .get_string_prop = get_string_prop, |
158 | .configure = configure, | 171 | .configure = configure, |
159 | .set_activated = set_activated, | 172 | .set_activated = set_activated, |
173 | .set_tiled = set_tiled, | ||
160 | .set_fullscreen = set_fullscreen, | 174 | .set_fullscreen = set_fullscreen, |
161 | .wants_floating = wants_floating, | 175 | .wants_floating = wants_floating, |
162 | .for_each_surface = for_each_surface, | 176 | .for_each_surface = for_each_surface, |
@@ -288,8 +302,6 @@ void handle_xdg_shell_surface(struct wl_listener *listener, void *data) { | |||
288 | wlr_log(L_DEBUG, "New xdg_shell toplevel title='%s' app_id='%s'", | 302 | wlr_log(L_DEBUG, "New xdg_shell toplevel title='%s' app_id='%s'", |
289 | xdg_surface->toplevel->title, xdg_surface->toplevel->app_id); | 303 | xdg_surface->toplevel->title, xdg_surface->toplevel->app_id); |
290 | wlr_xdg_surface_ping(xdg_surface); | 304 | wlr_xdg_surface_ping(xdg_surface); |
291 | wlr_xdg_toplevel_set_tiled(xdg_surface, WLR_EDGE_LEFT | WLR_EDGE_RIGHT | | ||
292 | WLR_EDGE_TOP | WLR_EDGE_BOTTOM); | ||
293 | 305 | ||
294 | struct sway_xdg_shell_view *xdg_shell_view = | 306 | struct sway_xdg_shell_view *xdg_shell_view = |
295 | calloc(1, sizeof(struct sway_xdg_shell_view)); | 307 | calloc(1, sizeof(struct sway_xdg_shell_view)); |