view: save and restore floating dimensions
When a floating view is fullscreened and returned to floating, it should remember its previous floating size/position.
This commit is contained in:
@ -34,7 +34,7 @@ pub fn toggleFloat(
|
||||
// Don't float fullscreen views
|
||||
if (view.pending.fullscreen) return;
|
||||
|
||||
if (!view.pending.float) view.pending.box = view.getDefaultFloatBox();
|
||||
if (!view.pending.float) view.pending.box = view.float_box;
|
||||
view.pending.float = !view.pending.float;
|
||||
view.output.root.arrange();
|
||||
}
|
||||
|
@ -30,6 +30,9 @@ pub fn toggleFullscreen(
|
||||
if (args.len > 1) return Error.TooManyArguments;
|
||||
|
||||
if (seat.focused_view) |view| {
|
||||
// If transitionng from fullscreen -> float, return to the saved
|
||||
// floating dimensions.
|
||||
if (view.pending.fullscreen and view.pending.float) view.pending.box = view.float_box;
|
||||
view.setFullscreen(!view.pending.fullscreen);
|
||||
view.output.root.arrange();
|
||||
}
|
||||
|
Reference in New Issue
Block a user