diff options
Diffstat (limited to 'sway/tree')
-rw-r--r-- | sway/tree/container.c | 3 | ||||
-rw-r--r-- | sway/tree/view.c | 11 |
2 files changed, 14 insertions, 0 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index af55a54e..d8d5c34a 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -943,6 +943,9 @@ void container_set_floating(struct sway_container *container, bool enable) { | |||
943 | container_add_child(workspace, container); | 943 | container_add_child(workspace, container); |
944 | container->width = container->parent->width; | 944 | container->width = container->parent->width; |
945 | container->height = container->parent->height; | 945 | container->height = container->parent->height; |
946 | if (container->type == C_VIEW) { | ||
947 | view_set_tiled(container->sway_view, true); | ||
948 | } | ||
946 | container->is_sticky = false; | 949 | container->is_sticky = false; |
947 | container_reap_empty_recursive(workspace->sway_workspace->floating); | 950 | container_reap_empty_recursive(workspace->sway_workspace->floating); |
948 | } | 951 | } |
diff --git a/sway/tree/view.c b/sway/tree/view.c index de4ce2e6..98637c33 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -141,6 +141,9 @@ static void view_autoconfigure_floating(struct sway_view *view) { | |||
141 | view->border_top = view->border_bottom = true; | 141 | view->border_top = view->border_bottom = true; |
142 | view->border_left = view->border_right = true; | 142 | view->border_left = view->border_right = true; |
143 | 143 | ||
144 | // Don't maximize floating windows | ||
145 | view_set_tiled(view, false); | ||
146 | |||
144 | view_configure(view, lx, ly, width, height); | 147 | view_configure(view, lx, ly, width, height); |
145 | } | 148 | } |
146 | 149 | ||
@@ -248,6 +251,7 @@ void view_autoconfigure(struct sway_view *view) { | |||
248 | 251 | ||
249 | view->x = x; | 252 | view->x = x; |
250 | view->y = y; | 253 | view->y = y; |
254 | view_set_tiled(view, true); | ||
251 | view_configure(view, x, y, width, height); | 255 | view_configure(view, x, y, width, height); |
252 | } | 256 | } |
253 | 257 | ||
@@ -257,6 +261,13 @@ void view_set_activated(struct sway_view *view, bool activated) { | |||
257 | } | 261 | } |
258 | } | 262 | } |
259 | 263 | ||
264 | void view_set_tiled(struct sway_view *view, bool tiled) { | ||
265 | view->border = tiled ? config->border : B_NONE; | ||
266 | if (view->impl->set_tiled) { | ||
267 | view->impl->set_tiled(view, tiled); | ||
268 | } | ||
269 | } | ||
270 | |||
260 | // Set fullscreen, but without IPC events or arranging windows. | 271 | // Set fullscreen, but without IPC events or arranging windows. |
261 | void view_set_fullscreen_raw(struct sway_view *view, bool fullscreen) { | 272 | void view_set_fullscreen_raw(struct sway_view *view, bool fullscreen) { |
262 | if (view->is_fullscreen == fullscreen) { | 273 | if (view->is_fullscreen == fullscreen) { |