summaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar crondog <crondog@gmail.com>2016-01-05 10:55:29 +1100
committerLibravatar crondog <crondog@gmail.com>2016-01-05 10:55:29 +1100
commitb755fd073e29819486b4899a40fb3a46dba0a81a (patch)
tree2d1c79afba126dac16a8c934ca509c6b20551417 /sway
parentMerge pull request #430 from crondog/swaybarlog (diff)
downloadsway-b755fd073e29819486b4899a40fb3a46dba0a81a.tar.gz
sway-b755fd073e29819486b4899a40fb3a46dba0a81a.tar.zst
sway-b755fd073e29819486b4899a40fb3a46dba0a81a.zip
Return focus to fullscreen view
This fixes https://github.com/SirCmpwn/sway/issues/431 by returning focus to the fullscreen view. Also it fixes the issue with the fullscreen view pointer not being set which did my head in
Diffstat (limited to 'sway')
-rw-r--r--sway/commands.c2
-rw-r--r--sway/handlers.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 38019be5..9cc33b9c 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -1464,7 +1464,7 @@ static struct cmd_results *cmd_fullscreen(int argc, char **argv) {
1464 wlc_view_set_state(container->handle, WLC_BIT_FULLSCREEN, !current); 1464 wlc_view_set_state(container->handle, WLC_BIT_FULLSCREEN, !current);
1465 // Resize workspace if going from fullscreen -> notfullscreen 1465 // Resize workspace if going from fullscreen -> notfullscreen
1466 // otherwise just resize container 1466 // otherwise just resize container
1467 if (current) { 1467 if (!current) {
1468 arrange_windows(workspace, -1, -1); 1468 arrange_windows(workspace, -1, -1);
1469 workspace->fullscreen = container; 1469 workspace->fullscreen = container;
1470 } else { 1470 } else {
diff --git a/sway/handlers.c b/sway/handlers.c
index 6c6d0e60..3cc5cf3e 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -220,6 +220,10 @@ static bool handle_view_created(wlc_handle handle) {
220 // refocus in-between command lists 220 // refocus in-between command lists
221 set_focused_container(newview); 221 set_focused_container(newview);
222 } 222 }
223 swayc_t *workspace = swayc_parent_by_type(focused, C_WORKSPACE);
224 if (workspace && workspace->fullscreen) {
225 set_focused_container(workspace->fullscreen);
226 }
223 } else { 227 } else {
224 swayc_t *output = swayc_parent_by_type(focused, C_OUTPUT); 228 swayc_t *output = swayc_parent_by_type(focused, C_OUTPUT);
225 wlc_handle *h = malloc(sizeof(wlc_handle)); 229 wlc_handle *h = malloc(sizeof(wlc_handle));