Skip to content

Commit

Permalink
Merge pull request #2688 from cwensley/curtis/mac-fix-window-positioning
Browse files Browse the repository at this point in the history
Mac: Fix position of window with AutoSize or changing ClientSize
  • Loading branch information
cwensley authored Oct 1, 2024
2 parents 11fa415 + e4a29a5 commit d368424
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/Eto.Mac/Forms/MacWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -952,13 +952,6 @@ public override Size ClientSize
get { return Control.ContentView.Frame.Size.ToEtoSize(); }
set
{
if (value.Height != -1)
{
var oldFrame = Control.Frame;
var oldSize = Control.ContentView.Frame;
Control.SetFrameOrigin(new CGPoint(oldFrame.X, (nfloat)Math.Max(0, oldFrame.Y - (value.Height - oldSize.Height))));
}

PreferredClientSize = value;
if (value.Width != -1 && value.Height != -1)
UserPreferredSize = new Size(-1, -1);
Expand Down Expand Up @@ -1181,6 +1174,7 @@ void SetSize(CGSize newSize)
}

var frame = Control.Frame;
frame.Y += frame.Height - newSize.Height;
frame.Size = newSize;
Control.SetFrame(frame, Widget.Loaded, AnimateSizeChanges);
}
Expand Down

0 comments on commit d368424

Please sign in to comment.