diff options
author | 2018-04-18 08:35:28 +1000 | |
---|---|---|
committer | 2018-04-18 08:35:28 +1000 | |
commit | 35ccdd67a89280c1d906ed914d67918cfb382e1f (patch) | |
tree | 6800043b2527e9f9baf9dba0f811d6a97a5e2ea3 /sway | |
parent | Fullscreen fixes. (diff) | |
download | sway-35ccdd67a89280c1d906ed914d67918cfb382e1f.tar.gz sway-35ccdd67a89280c1d906ed914d67918cfb382e1f.tar.zst sway-35ccdd67a89280c1d906ed914d67918cfb382e1f.zip |
More fullscreen fixes.
* Render fullscreen views without wlr function, which makes popups and
lockscreen work.
* Don't allow input events to surfaces behind fullscreen views.
* Use correct output dimensions (for rotated outputs).
Diffstat (limited to 'sway')
-rw-r--r-- | sway/desktop/output.c | 10 | ||||
-rw-r--r-- | sway/input/cursor.c | 8 | ||||
-rw-r--r-- | sway/tree/layout.c | 4 |
3 files changed, 15 insertions, 7 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 361a92d0..a5f2f71f 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -229,7 +229,11 @@ static void render_container_iterator(struct sway_container *con, | |||
229 | 229 | ||
230 | static void render_container(struct sway_output *output, | 230 | static void render_container(struct sway_output *output, |
231 | struct sway_container *con) { | 231 | struct sway_container *con) { |
232 | container_descendants(con, C_VIEW, render_container_iterator, output); | 232 | if (con->type == C_VIEW) { // Happens if a view is fullscreened |
233 | render_container_iterator(con, output); | ||
234 | } else { | ||
235 | container_descendants(con, C_VIEW, render_container_iterator, output); | ||
236 | } | ||
233 | } | 237 | } |
234 | 238 | ||
235 | static struct sway_container *output_get_active_workspace( | 239 | static struct sway_container *output_get_active_workspace( |
@@ -277,10 +281,8 @@ static void render_output(struct sway_output *output, struct timespec *when, | |||
277 | struct sway_container *workspace = output_get_active_workspace(output); | 281 | struct sway_container *workspace = output_get_active_workspace(output); |
278 | 282 | ||
279 | if (workspace->sway_workspace->fullscreen) { | 283 | if (workspace->sway_workspace->fullscreen) { |
280 | wlr_output_set_fullscreen_surface(wlr_output, | 284 | render_container(output, workspace->sway_workspace->fullscreen->swayc); |
281 | workspace->sway_workspace->fullscreen->surface); | ||
282 | } else { | 285 | } else { |
283 | wlr_output_set_fullscreen_surface(wlr_output, NULL); | ||
284 | render_layer(output, | 286 | render_layer(output, |
285 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND]); | 287 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND]); |
286 | render_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM]); | 288 | render_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM]); |
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 15a61cbf..6d14c12c 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include "sway/layers.h" | 12 | #include "sway/layers.h" |
13 | #include "sway/output.h" | 13 | #include "sway/output.h" |
14 | #include "sway/tree/view.h" | 14 | #include "sway/tree/view.h" |
15 | #include "sway/tree/workspace.h" | ||
15 | #include "wlr-layer-shell-unstable-v1-protocol.h" | 16 | #include "wlr-layer-shell-unstable-v1-protocol.h" |
16 | 17 | ||
17 | static struct wlr_surface *layer_surface_at(struct sway_output *output, | 18 | static struct wlr_surface *layer_surface_at(struct sway_output *output, |
@@ -89,6 +90,13 @@ static struct sway_container *container_at_cursor(struct sway_cursor *cursor, | |||
89 | return ws; | 90 | return ws; |
90 | } | 91 | } |
91 | 92 | ||
93 | if (ws->sway_workspace->fullscreen) { | ||
94 | *sx = ox; | ||
95 | *sy = oy; | ||
96 | *surface = ws->sway_workspace->fullscreen->surface; | ||
97 | return ws->sway_workspace->fullscreen->swayc; | ||
98 | } | ||
99 | |||
92 | struct sway_container *c; | 100 | struct sway_container *c; |
93 | if ((c = container_at(ws, cursor->cursor->x, cursor->cursor->y, | 101 | if ((c = container_at(ws, cursor->cursor->x, cursor->cursor->y, |
94 | surface, sx, sy))) { | 102 | surface, sx, sy))) { |
diff --git a/sway/tree/layout.c b/sway/tree/layout.c index d931c4dc..56d4e1d2 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c | |||
@@ -598,10 +598,8 @@ void arrange_windows(struct sway_container *container, | |||
598 | 598 | ||
599 | if (container->type == C_WORKSPACE | 599 | if (container->type == C_WORKSPACE |
600 | && container->sway_workspace->fullscreen) { | 600 | && container->sway_workspace->fullscreen) { |
601 | struct wlr_output *wlr_output | ||
602 | = container->parent->sway_output->wlr_output; | ||
603 | view_configure(container->sway_workspace->fullscreen, 0, 0, | 601 | view_configure(container->sway_workspace->fullscreen, 0, 0, |
604 | wlr_output->width, wlr_output->height); | 602 | container->parent->width, container->parent->height); |
605 | } | 603 | } |
606 | 604 | ||
607 | double x = 0, y = 0; | 605 | double x = 0, y = 0; |