diff options
author | Drew DeVault <sir@cmpwn.com> | 2016-08-01 07:25:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-01 07:25:31 -0400 |
commit | c6f9767487282cb68c0496ca7115a3acc4a4d6e2 (patch) | |
tree | 9bd53e1ca6201e393a4c3d5e489542dfdc505ce5 | |
parent | Merge pull request #808 from zandrmartin/document-kill-command (diff) | |
parent | cache floating container size when fullscreening (diff) | |
download | sway-c6f9767487282cb68c0496ca7115a3acc4a4d6e2.tar.gz sway-c6f9767487282cb68c0496ca7115a3acc4a4d6e2.tar.zst sway-c6f9767487282cb68c0496ca7115a3acc4a4d6e2.zip |
Merge pull request #812 from zandrmartin/floating-fullscreen-size-fix
cache floating container size when fullscreening
-rw-r--r-- | sway/commands.c | 24 |
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) { |