aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/view.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2019-01-25 08:29:21 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2019-01-25 08:29:21 +1000
commit20aa8ee67dc528299dbc8735220a1c081c7ff9f6 (patch)
tree685de48be3db51fc01510ccf051e2b63a4655fba /sway/tree/view.c
parentUpdate for swaywm/wlroots#1402 (diff)
downloadsway-20aa8ee67dc528299dbc8735220a1c081c7ff9f6.tar.gz
sway-20aa8ee67dc528299dbc8735220a1c081c7ff9f6.tar.zst
sway-20aa8ee67dc528299dbc8735220a1c081c7ff9f6.zip
Implement fullscreen global
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r--sway/tree/view.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 8795e04f..561c6ef1 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -203,12 +203,18 @@ void view_autoconfigure(struct sway_view *view) {
203 } 203 }
204 struct sway_output *output = con->workspace->output; 204 struct sway_output *output = con->workspace->output;
205 205
206 if (con->is_fullscreen) { 206 if (con->fullscreen_mode == FULLSCREEN_WORKSPACE) {
207 con->content_x = output->lx; 207 con->content_x = output->lx;
208 con->content_y = output->ly; 208 con->content_y = output->ly;
209 con->content_width = output->width; 209 con->content_width = output->width;
210 con->content_height = output->height; 210 con->content_height = output->height;
211 return; 211 return;
212 } else if (con->fullscreen_mode == FULLSCREEN_GLOBAL) {
213 con->content_x = root->x;
214 con->content_y = root->y;
215 con->content_width = root->width;
216 con->content_height = root->height;
217 return;
212 } 218 }
213 219
214 struct sway_workspace *ws = view->container->workspace; 220 struct sway_workspace *ws = view->container->workspace;
@@ -648,7 +654,10 @@ void view_unmap(struct sway_view *view) {
648 workspace_consider_destroy(ws); 654 workspace_consider_destroy(ws);
649 } 655 }
650 656
651 if (ws && !ws->node.destroying) { 657 if (root->fullscreen_global) {
658 // Container may have been a child of the root fullscreen container
659 arrange_root();
660 } else if (ws && !ws->node.destroying) {
652 arrange_workspace(ws); 661 arrange_workspace(ws);
653 workspace_detect_urgent(ws); 662 workspace_detect_urgent(ws);
654 } 663 }
@@ -1008,14 +1017,11 @@ bool view_is_visible(struct sway_view *view) {
1008 con = con->parent; 1017 con = con->parent;
1009 } 1018 }
1010 // Check view isn't hidden by another fullscreen view 1019 // Check view isn't hidden by another fullscreen view
1011 if (workspace->fullscreen && 1020 struct sway_container *fs = root->fullscreen_global ?
1012 !container_is_fullscreen_or_child(view->container)) { 1021 root->fullscreen_global : workspace->fullscreen;
1013 // However, if we're transient for the fullscreen view and we allow 1022 if (fs && !container_is_fullscreen_or_child(view->container) &&
1014 // "popups" during fullscreen then it might be visible 1023 !container_is_transient_for(view->container, fs)) {
1015 if (!container_is_transient_for(view->container, 1024 return false;
1016 workspace->fullscreen)) {
1017 return false;
1018 }
1019 } 1025 }
1020 return true; 1026 return true;
1021} 1027}