summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Djärv <jan.h.d@swipnet.se>2013-03-16 15:15:42 +0100
committerJan Djärv <jan.h.d@swipnet.se>2013-03-16 15:15:42 +0100
commit960ce48010f19dcaef060fc2f869968ac7fa757d (patch)
tree7b7c301585d583c39db41070c168582c8a987a8a
parent8f2906f551da4a06c0097887e8ad61b8144baeac (diff)
downloademacs-960ce48010f19dcaef060fc2f869968ac7fa757d.tar.gz
* nsterm.m (updateFrameSize:): Change resize increments if needed.
-rw-r--r--src/ChangeLog2
-rw-r--r--src/nsterm.m14
2 files changed, 16 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d924772abad..06618a543e2 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,7 @@
2013-03-16 Jan Djärv <jan.h.d@swipnet.se>
+ * nsterm.m (updateFrameSize:): Change resize increments if needed.
+
* nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
and getDirectory.
diff --git a/src/nsterm.m b/src/nsterm.m
index 1f09e031592..be586010c81 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -5448,12 +5448,26 @@ not_in_argv (NSString *arg)
if (oldr != rows || oldc != cols || neww != oldw || newh != oldh)
{
+ struct frame *f = emacsframe;
NSView *view = FRAME_NS_VIEW (emacsframe);
+ NSWindow *win = [view window];
+ NSSize sz = [win resizeIncrements];
+
FRAME_PIXEL_WIDTH (emacsframe) = neww;
FRAME_PIXEL_HEIGHT (emacsframe) = newh;
change_frame_size (emacsframe, rows, cols, 0, delay, 0);
SET_FRAME_GARBAGED (emacsframe);
cancel_mouse_face (emacsframe);
+
+ // Did resize increments change because of a font change?
+ if (sz.width != FRAME_COLUMN_WIDTH (emacsframe) ||
+ sz.height != FRAME_LINE_HEIGHT (emacsframe))
+ {
+ sz.width = FRAME_COLUMN_WIDTH (emacsframe);
+ sz.height = FRAME_LINE_HEIGHT (emacsframe);
+ [win setResizeIncrements: sz];
+ }
+
[view setFrame: NSMakeRect (0, 0, neww, newh)];
[self windowDidMove:nil]; // Update top/left.
}