From 35ccdd67a89280c1d906ed914d67918cfb382e1f Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Wed, 18 Apr 2018 08:35:28 +1000 Subject: 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). --- sway/input/cursor.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sway/input/cursor.c') 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 @@ #include "sway/layers.h" #include "sway/output.h" #include "sway/tree/view.h" +#include "sway/tree/workspace.h" #include "wlr-layer-shell-unstable-v1-protocol.h" 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, return ws; } + if (ws->sway_workspace->fullscreen) { + *sx = ox; + *sy = oy; + *surface = ws->sway_workspace->fullscreen->surface; + return ws->sway_workspace->fullscreen->swayc; + } + struct sway_container *c; if ((c = container_at(ws, cursor->cursor->x, cursor->cursor->y, surface, sx, sy))) { -- cgit v1.2.3 From 8d06b222f048e5a27c4c5b0bc46ceaab7639502f Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Wed, 18 Apr 2018 13:06:10 +1000 Subject: Fullscreen rendering and input fixes. * Render background when using fullscreen, because transparency. * Check that fullscreen surface allows input. * Don't look for surfaces in top layer if there's a fullscreen view. --- sway/desktop/output.c | 4 ++-- sway/input/cursor.c | 17 ++++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) (limited to 'sway/input/cursor.c') diff --git a/sway/desktop/output.c b/sway/desktop/output.c index a5f2f71f..299b57f1 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -280,11 +280,11 @@ static void render_output(struct sway_output *output, struct timespec *when, struct sway_container *workspace = output_get_active_workspace(output); + render_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND]); + if (workspace->sway_workspace->fullscreen) { render_container(output, workspace->sway_workspace->fullscreen->swayc); } else { - render_layer(output, - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND]); render_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM]); render_container(output, workspace); diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 6d14c12c..a19f0752 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -84,19 +84,22 @@ static struct sway_container *container_at_cursor(struct sway_cursor *cursor, ox, oy, sx, sy))) { return ws; } + if (ws->sway_workspace->fullscreen) { + struct wlr_surface *wlr_surface = ws->sway_workspace->fullscreen->surface; + if (wlr_surface_point_accepts_input(wlr_surface, ox, oy)) { + *sx = ox; + *sy = oy; + *surface = wlr_surface; + return ws->sway_workspace->fullscreen->swayc; + } + return NULL; + } if ((*surface = layer_surface_at(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], ox, oy, sx, sy))) { return ws; } - if (ws->sway_workspace->fullscreen) { - *sx = ox; - *sy = oy; - *surface = ws->sway_workspace->fullscreen->surface; - return ws->sway_workspace->fullscreen->swayc; - } - struct sway_container *c; if ((c = container_at(ws, cursor->cursor->x, cursor->cursor->y, surface, sx, sy))) { -- cgit v1.2.3