emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] scratch/ns/next 6fd71f3 4/8: Prevent frame resizes moving


From: Alan Third
Subject: [Emacs-diffs] scratch/ns/next 6fd71f3 4/8: Prevent frame resizes moving the top left
Date: Tue, 15 Jan 2019 12:12:28 -0500 (EST)

branch: scratch/ns/next
commit 6fd71f3b99425e8be9c512fe89eb10df7b332e11
Author: Alan Third <address@hidden>
Commit: Alan Third <address@hidden>

    Prevent frame resizes moving the top left
    
    * src/nsterm.m ([EmacsView viewWillDraw]): Reset the top left when the
    frame resizes.
---
 src/nsterm.m | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/nsterm.m b/src/nsterm.m
index 9abbc52..7adc55b 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -8005,14 +8005,13 @@ not_in_argv (NSString *arg)
      another, resize it before drawing to it.  */
   if (! NSEqualSizes (curSize, newSize))
     {
-      /* FIXME: This resizes from the bottom of the frame instead of
-         the top.  I guess we have to reposition the frame's
-         origin.  */
-      [window setContentSize:newSize];
+      NSRect frame = [window frame];
+      NSPoint topLeft = NSMakePoint (NSMinX (frame), NSMaxY (frame));
 
-      [self windowDidMove: // Update top/left.
-             [NSNotification notificationWithName:NSWindowDidMoveNotification
-                                           object:window]];
+      /* This resizes such that the top edge of the frame moves, so we
+         need to reset the top-left origin.  */
+      [window setContentSize:newSize];
+      [window setFrameTopLeftPoint:topLeft];
     }
 }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]