diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-06-30 22:46:25 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-06-30 22:46:25 +1000 |
commit | e396af853b01438f7e5ef34bfa6fd2507d11ce5a (patch) | |
tree | 323739dc80680dd774acfdcf43eb76cfe93aa64c /sway/tree | |
parent | fc6fde7d90ee031539252cb8832e11c38cfed686 (diff) | |
parent | 9ba72433b6c87086f2772405e09e8ac8c0136a01 (diff) |
Merge remote-tracking branch 'upstream/master' into atomic
Diffstat (limited to 'sway/tree')
-rw-r--r-- | sway/tree/container.c | 13 | ||||
-rw-r--r-- | sway/tree/view.c | 13 |
2 files changed, 15 insertions, 11 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index ab3d9dbd..6f6137c4 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -522,21 +522,11 @@ static struct sway_container *container_at_view(struct sway_container *swayc, view_sx, view_sy, &_sx, &_sy); break; case SWAY_VIEW_XDG_SHELL_V6: - // the top left corner of the sway container is the - // coordinate of the top left corner of the window geometry - view_sx += sview->wlr_xdg_surface_v6->geometry.x; - view_sy += sview->wlr_xdg_surface_v6->geometry.y; - _surface = wlr_xdg_surface_v6_surface_at( sview->wlr_xdg_surface_v6, view_sx, view_sy, &_sx, &_sy); break; case SWAY_VIEW_XDG_SHELL: - // the top left corner of the sway container is the - // coordinate of the top left corner of the window geometry - view_sx += sview->wlr_xdg_surface->geometry.x; - view_sy += sview->wlr_xdg_surface->geometry.y; - _surface = wlr_xdg_surface_surface_at( sview->wlr_xdg_surface, view_sx, view_sy, &_sx, &_sy); @@ -954,6 +944,9 @@ void container_set_floating(struct sway_container *container, bool enable) { container_add_child(workspace, container); container->width = container->parent->width; container->height = container->parent->height; + if (container->type == C_VIEW) { + view_set_tiled(container->sway_view, true); + } container->is_sticky = false; container_reap_empty_recursive(workspace->sway_workspace->floating); } diff --git a/sway/tree/view.c b/sway/tree/view.c index 9f85bac0..6263bfb0 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -164,6 +164,9 @@ void view_init_floating(struct sway_view *view) { view->border_left = view->border_right = true; container_set_geometry_from_floating_view(view->swayc); + + // Don't maximize floating windows + view_set_tiled(view, false); } void view_autoconfigure(struct sway_view *view) { @@ -275,6 +278,7 @@ void view_autoconfigure(struct sway_view *view) { view->y = y; view->width = width; view->height = height; + view_set_tiled(view, true); } void view_set_activated(struct sway_view *view, bool activated) { @@ -283,6 +287,13 @@ void view_set_activated(struct sway_view *view, bool activated) { } } +void view_set_tiled(struct sway_view *view, bool tiled) { + view->border = tiled ? config->border : B_NONE; + if (view->impl->set_tiled) { + view->impl->set_tiled(view, tiled); + } +} + void view_set_fullscreen(struct sway_view *view, bool fullscreen) { if (view->is_fullscreen == fullscreen) { return; @@ -948,7 +959,7 @@ bool view_is_visible(struct sway_view *view) { // Check view isn't in a tabbed or stacked container on an inactive tab struct sway_seat *seat = input_manager_current_seat(input_manager); struct sway_container *container = view->swayc; - while (container->type != C_WORKSPACE) { + while (container->type != C_WORKSPACE && container->layout != L_FLOATING) { if (container->parent->layout == L_TABBED || container->parent->layout == L_STACKED) { if (seat_get_active_child(seat, container->parent) != container) { |