commit 5af4e747d311a5b4059561078976c167df057bd8
parent f9b92783c5d8e20273acf7865f628d988249d7a2
Author: Mikkel Oscar Lyderik <mikkeloscar@gmail.com>
Date: Tue, 5 Jan 2016 01:14:28 +0100
Merge pull request #433 from crondog/issue431
Return focus to fullscreen view
Diffstat:
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/sway/commands.c b/sway/commands.c
@@ -1464,7 +1464,7 @@ static struct cmd_results *cmd_fullscreen(int argc, char **argv) {
wlc_view_set_state(container->handle, WLC_BIT_FULLSCREEN, !current);
// Resize workspace if going from fullscreen -> notfullscreen
// otherwise just resize container
- if (current) {
+ if (!current) {
arrange_windows(workspace, -1, -1);
workspace->fullscreen = container;
} else {
diff --git a/sway/handlers.c b/sway/handlers.c
@@ -220,6 +220,10 @@ static bool handle_view_created(wlc_handle handle) {
// refocus in-between command lists
set_focused_container(newview);
}
+ swayc_t *workspace = swayc_parent_by_type(focused, C_WORKSPACE);
+ if (workspace && workspace->fullscreen) {
+ set_focused_container(workspace->fullscreen);
+ }
} else {
swayc_t *output = swayc_parent_by_type(focused, C_OUTPUT);
wlc_handle *h = malloc(sizeof(wlc_handle));