From 51c79967c3af3f912074a0112cbe7e00cf5073f9 Mon Sep 17 00:00:00 2001 From: Alan Third Date: Mon, 27 Sep 2021 13:33:49 +0100 Subject: [PATCH] Fix resizing glitches in NS port (bug#50413) * src/nsterm.m ([EmacsView resizeWithOldSuperviewSize:]): Use the superview's size instead of trusting the view's size. --- src/nsterm.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/nsterm.m b/src/nsterm.m index 1970a7a1c1a..a6c2e7505b5 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -6974,13 +6974,18 @@ not_in_argv (NSString *arg) if (! FRAME_LIVE_P (emacsframe)) return; - frame = [self frame]; + frame = [[self superview] bounds]; width = (int)NSWidth (frame); height = (int)NSHeight (frame); NSTRACE_SIZE ("New size", NSMakeSize (width, height)); NSTRACE_SIZE ("Original size", size); + /* Reset the frame size to match the bounds of the superview (the + NSWindow's contentView). We need to do this as sometimes the + view's frame isn't resized correctly, or can end up with the + wrong origin. */ + [self setFrame:frame]; change_frame_size (emacsframe, width, height, false, YES, false); SET_FRAME_GARBAGED (emacsframe); -- 2.39.5