aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/view.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r--sway/tree/view.c73
1 files changed, 4 insertions, 69 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index beeb8144..82c3ad4a 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -225,7 +225,7 @@ void view_autoconfigure(struct sway_view *view) {
struct sway_container *output = container_parent(view->swayc, C_OUTPUT);
- if (view->is_fullscreen) {
+ if (view->swayc->is_fullscreen) {
view->x = output->x;
view->y = output->y;
view->width = output->width;
@@ -233,10 +233,6 @@ void view_autoconfigure(struct sway_view *view) {
return;
}
- if (container_is_floating(view->swayc)) {
- return;
- }
-
struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
int other_views = 0;
@@ -349,68 +345,6 @@ void view_set_tiled(struct sway_view *view, bool tiled) {
}
}
-void view_set_fullscreen(struct sway_view *view, bool fullscreen) {
- if (view->is_fullscreen == fullscreen) {
- return;
- }
-
- struct sway_container *workspace =
- container_parent(view->swayc, C_WORKSPACE);
-
- if (view->impl->set_fullscreen) {
- view->impl->set_fullscreen(view, fullscreen);
- }
-
- view->is_fullscreen = fullscreen;
-
- if (fullscreen) {
- if (workspace->sway_workspace->fullscreen) {
- view_set_fullscreen(workspace->sway_workspace->fullscreen, false);
- }
- workspace->sway_workspace->fullscreen = view;
- view->saved_x = view->x;
- view->saved_y = view->y;
- view->saved_width = view->width;
- view->saved_height = view->height;
- view->swayc->saved_x = view->swayc->x;
- view->swayc->saved_y = view->swayc->y;
- view->swayc->saved_width = view->swayc->width;
- view->swayc->saved_height = view->swayc->height;
-
- struct sway_seat *seat;
- struct sway_container *focus, *focus_ws;
- wl_list_for_each(seat, &input_manager->seats, link) {
- focus = seat_get_focus(seat);
- if (focus) {
- focus_ws = focus;
- if (focus && focus_ws->type != C_WORKSPACE) {
- focus_ws = container_parent(focus_ws, C_WORKSPACE);
- }
- seat_set_focus(seat, view->swayc);
- if (focus_ws != workspace) {
- seat_set_focus(seat, focus);
- }
- }
- }
- } else {
- workspace->sway_workspace->fullscreen = NULL;
- if (container_is_floating(view->swayc)) {
- view->x = view->saved_x;
- view->y = view->saved_y;
- view->width = view->saved_width;
- view->height = view->saved_height;
- container_set_geometry_from_floating_view(view->swayc);
- } else {
- view->swayc->width = view->swayc->saved_width;
- view->swayc->height = view->swayc->saved_height;
- }
- }
-
- container_end_mouse_operation(view->swayc);
-
- ipc_event_window(view->swayc, "fullscreen_mode");
-}
-
void view_close(struct sway_view *view) {
if (view->impl->close) {
view->impl->close(view);
@@ -680,7 +614,7 @@ void view_unmap(struct sway_view *view) {
struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
struct sway_container *parent;
- if (view->is_fullscreen) {
+ if (view->swayc->is_fullscreen) {
ws->sway_workspace->fullscreen = NULL;
parent = container_destroy(view->swayc);
@@ -1133,7 +1067,8 @@ bool view_is_visible(struct sway_view *view) {
container = container->parent;
}
// Check view isn't hidden by another fullscreen view
- if (workspace->sway_workspace->fullscreen && !view->is_fullscreen) {
+ if (workspace->sway_workspace->fullscreen &&
+ !container_is_fullscreen_or_child(view->swayc)) {
return false;
}
// Check the workspace is visible