aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--river/command/toggle_float.zig7
-rw-r--r--river/command/toggle_fullscreen.zig4
2 files changed, 10 insertions, 1 deletions
diff --git a/river/command/toggle_float.zig b/river/command/toggle_float.zig
index 8f57454..ac33d45 100644
--- a/river/command/toggle_float.zig
+++ b/river/command/toggle_float.zig
@@ -41,10 +41,15 @@ pub fn toggleFloat(
view.pending.float = !view.pending.float;
- // If switching from layout to float, restore the previous floating dimensions
if (view.pending.float) {
+ // If switching from layout to float, restore the previous floating
+ // dimensions.
view.pending.box = view.float_box;
view.configure();
+ } else {
+ // If switching from float to layout save the floating dimensions
+ // for next time.
+ view.float_box = view.current.box;
}
view.output.root.arrange();
diff --git a/river/command/toggle_fullscreen.zig b/river/command/toggle_fullscreen.zig
index 6e2ac2d..92f99f3 100644
--- a/river/command/toggle_fullscreen.zig
+++ b/river/command/toggle_fullscreen.zig
@@ -41,6 +41,10 @@ pub fn toggleFullscreen(
view.setFullscreen(!view.pending.fullscreen);
if (view.pending.fullscreen) {
+ // If transitioning from float -> fullscreen, save the floating
+ // dimensions.
+ if (view.pending.float) view.float_box = view.current.box;
+
const output = view.output;
view.pending.box = Box.fromWlrBox(
c.wlr_output_layout_get_box(output.root.wlr_output_layout, output.wlr_output).*,