diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-01-27 18:06:50 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-27 18:06:50 -0500 |
commit | 783fadab284c79c8e13625e5e2a2eefae02c75d3 (patch) | |
tree | 795c5c69a7fcfc9336115ac157a41b943190f206 /sway/tree/view.c | |
parent | Merge pull request #3519 from emersion/pointer-frame (diff) | |
parent | Implement fullscreen global (diff) | |
download | sway-783fadab284c79c8e13625e5e2a2eefae02c75d3.tar.gz sway-783fadab284c79c8e13625e5e2a2eefae02c75d3.tar.zst sway-783fadab284c79c8e13625e5e2a2eefae02c75d3.zip |
Merge pull request #3423 from RyanDwyer/fullscreen-global
Implement fullscreen global
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r-- | sway/tree/view.c | 26 |
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 | } |