From 52420cc24d61db8d22cf0d391f1f84b37bf087d5 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Mon, 16 Apr 2018 20:36:40 +1000 Subject: Implement fullscreen. --- sway/input/seat.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'sway/input') diff --git a/sway/input/seat.c b/sway/input/seat.c index 09927a1a..f60c43b5 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -448,6 +448,20 @@ void seat_set_focus_warp(struct sway_seat *seat, return; } + struct sway_container *last_workspace = last_focus; + if (last_workspace && last_workspace->type != C_WORKSPACE) { + last_workspace = container_parent(last_workspace, C_WORKSPACE); + } + struct sway_container *new_workspace = container; + if (new_workspace && new_workspace->type != C_WORKSPACE) { + new_workspace = container_parent(new_workspace, C_WORKSPACE); + } + + if (last_workspace == new_workspace && last_workspace->fullscreen + && !container->sway_view->is_fullscreen) { + return; + } + struct sway_container *last_output = last_focus; if (last_output && last_output->type != C_OUTPUT) { last_output = container_parent(last_output, C_OUTPUT); -- cgit v1.2.3 From c685ef081f090d1e15428f55426e02f2274312d0 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Tue, 17 Apr 2018 09:31:34 +1000 Subject: Create sway_workspace struct. --- sway/input/seat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sway/input') diff --git a/sway/input/seat.c b/sway/input/seat.c index f60c43b5..23b7ef76 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -18,6 +18,7 @@ #include "sway/output.h" #include "sway/tree/container.h" #include "sway/tree/view.h" +#include "sway/tree/workspace.h" #include "log.h" static void seat_device_destroy(struct sway_seat_device *seat_device) { @@ -457,7 +458,8 @@ void seat_set_focus_warp(struct sway_seat *seat, new_workspace = container_parent(new_workspace, C_WORKSPACE); } - if (last_workspace == new_workspace && last_workspace->fullscreen + if (last_workspace == new_workspace + && last_workspace->sway_workspace->fullscreen && !container->sway_view->is_fullscreen) { return; } -- cgit v1.2.3 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') 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/input/cursor.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'sway/input') 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 From 777800e37ab84de9deb64586d8155a9eb600b4c2 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 19 Apr 2018 09:15:21 -0400 Subject: Fix qutebrowser crash on context menu dismissal --- sway/input/seat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sway/input') diff --git a/sway/input/seat.c b/sway/input/seat.c index 23b7ef76..8bba7d8f 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -458,7 +458,7 @@ void seat_set_focus_warp(struct sway_seat *seat, new_workspace = container_parent(new_workspace, C_WORKSPACE); } - if (last_workspace == new_workspace + if (last_workspace && last_workspace == new_workspace && last_workspace->sway_workspace->fullscreen && !container->sway_view->is_fullscreen) { return; -- cgit v1.2.3