From 824a3d81aad8e3eb81c80d07bf6554be9fe214cf Mon Sep 17 00:00:00 2001 From: taiyu Date: Sat, 15 Aug 2015 14:32:14 -0700 Subject: fixed fullscreen & focusing --- sway/commands.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sway/commands.c') 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; -- cgit v1.2.3