aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands.c
diff options
context:
space:
mode:
authorLibravatar Zandr Martin <zandrmartin@gmail.com>2016-07-31 21:45:27 -0500
committerLibravatar Zandr Martin <zandrmartin@gmail.com>2016-07-31 21:45:27 -0500
commitb18c169036ed41513971600983c0e812cd567be9 (patch)
tree9bd53e1ca6201e393a4c3d5e489542dfdc505ce5 /sway/commands.c
parentMerge pull request #808 from zandrmartin/document-kill-command (diff)
downloadsway-b18c169036ed41513971600983c0e812cd567be9.tar.gz
sway-b18c169036ed41513971600983c0e812cd567be9.tar.zst
sway-b18c169036ed41513971600983c0e812cd567be9.zip
cache floating container size when fullscreening
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 28dcc996..f0c9cc52 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -2501,6 +2501,30 @@ static struct cmd_results *cmd_fullscreen(int argc, char **argv) {
2501 swayc_t *workspace = swayc_parent_by_type(container, C_WORKSPACE); 2501 swayc_t *workspace = swayc_parent_by_type(container, C_WORKSPACE);
2502 bool current = swayc_is_fullscreen(container); 2502 bool current = swayc_is_fullscreen(container);
2503 wlc_view_set_state(container->handle, WLC_BIT_FULLSCREEN, !current); 2503 wlc_view_set_state(container->handle, WLC_BIT_FULLSCREEN, !current);
2504
2505 if (container->is_floating) {
2506 if (current) {
2507 // set dimensions back to what they were before we fullscreened this
2508 container->x = container->cached_geometry.origin.x;
2509 container->y = container->cached_geometry.origin.y;
2510 container->width = container->cached_geometry.size.w;
2511 container->height = container->cached_geometry.size.h;
2512 } else {
2513 // cache dimensions so we can reset them after we "unfullscreen" this
2514 struct wlc_geometry geo = {
2515 .origin = {
2516 .x = container->x,
2517 .y = container->y
2518 },
2519 .size = {
2520 .w = container->width,
2521 .h = container->height
2522 }
2523 };
2524 container->cached_geometry = geo;
2525 }
2526 }
2527
2504 // Resize workspace if going from fullscreen -> notfullscreen 2528 // Resize workspace if going from fullscreen -> notfullscreen
2505 // otherwise just resize container 2529 // otherwise just resize container
2506 if (!current) { 2530 if (!current) {