summaryrefslogtreecommitdiff
path: root/sway/commands.c
diff options
context:
space:
mode:
authorDrew DeVault <[email protected]>2015-08-15 18:47:44 -0400
committerDrew DeVault <[email protected]>2015-08-15 18:47:44 -0400
commit2732c40813557882a1e5b09fd9cdf592bdcc3247 (patch)
tree5a2229d9e33968aba41c4bd4cd76dd1d11a41ab9 /sway/commands.c
parent4014b215ebe39ad4b9c624c10f57a3660d5e626d (diff)
parent3a21ba020fd0f0628a128070b72f0cf7a6b64a57 (diff)
Merge pull request #34 from taiyu-len/master
fixed fullscreen & focusing
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 742d6b86..20e0fc8d 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -286,6 +286,14 @@ static bool cmd_fullscreen(struct sway_config *config, int argc, char **argv) {
swayc_t *container = get_focused_container(&root_container);
bool current = (wlc_view_get_state(container->handle) & WLC_BIT_FULLSCREEN) > 0;
wlc_view_set_state(container->handle, WLC_BIT_FULLSCREEN, !current);
+ //Resize workspace if going from fullscreen -> notfullscreen
+ //otherwise just resize container
+ if (current) {
+ while (container->type != C_WORKSPACE) {
+ container = container->parent;
+ }
+ }
+ //Only resize container when going into fullscreen
arrange_windows(container, -1, -1);
return true;