diff options
author | emersion <contact@emersion.fr> | 2018-04-19 23:31:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-19 23:31:25 +0100 |
commit | a5719f9f432b5f9378ebd2136f8a2cde46dfb407 (patch) | |
tree | 1735e7c33fe5547acfaa56b893fc0b450c0d9483 /sway/input | |
parent | 2f0120e458cae47f38a3c09af174bae60964151c (diff) | |
parent | 6afccd07d95582a72e36b49454266ab0cebec7c0 (diff) |
Merge pull request #1817 from RyanDwyer/fullscreen
Implement fullscreen
Diffstat (limited to 'sway/input')
-rw-r--r-- | sway/input/cursor.c | 11 | ||||
-rw-r--r-- | sway/input/seat.c | 16 |
2 files changed, 27 insertions, 0 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 15a61cbf..a19f0752 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, @@ -83,6 +84,16 @@ 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))) { diff --git a/sway/input/seat.c b/sway/input/seat.c index 09927a1a..8bba7d8f 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) { @@ -448,6 +449,21 @@ 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 && last_workspace == new_workspace + && last_workspace->sway_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); |