summaryrefslogtreecommitdiff
path: root/src/nsterm.m
diff options
context:
space:
mode:
authorAlan Third <alan@idiocy.org>2017-10-25 14:08:43 +0100
committerAlan Third <alan@idiocy.org>2017-10-25 14:12:28 +0100
commitaee0bc877579ad606d33a9abf162da4bd50da618 (patch)
tree0c2a1c865bcbbed8cff0655f9f012d7cc94adaca /src/nsterm.m
parentd6c1a9cb8a52bd6dce91cea5d6c2f9a3a90a0b38 (diff)
downloademacs-aee0bc877579ad606d33a9abf162da4bd50da618.tar.gz
emacs-aee0bc877579ad606d33a9abf162da4bd50da618.tar.bz2
emacs-aee0bc877579ad606d33a9abf162da4bd50da618.zip
Fix non-native fullscreen on NS (bug#28872)
* src/nsterm.m (EmacsView::updateFrameSize): Handle case where FRAME_TOOLBAR_HEIGHT returns a negative number. Force WM to set size of frame.
Diffstat (limited to 'src/nsterm.m')
-rw-r--r--src/nsterm.m18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/nsterm.m b/src/nsterm.m
index 709e905ec8f..a382e5f7130 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -6804,14 +6804,19 @@ not_in_argv (NSString *arg)
if (! [self isFullscreen])
{
+ int toolbar_height;
#ifdef NS_IMPL_GNUSTEP
// GNUstep does not always update the tool bar height. Force it.
if (toolbar && [toolbar isVisible])
update_frame_tool_bar (emacsframe);
#endif
+ toolbar_height = FRAME_TOOLBAR_HEIGHT (emacsframe);
+ if (toolbar_height < 0)
+ toolbar_height = 35;
+
extra = FRAME_NS_TITLEBAR_HEIGHT (emacsframe)
- + FRAME_TOOLBAR_HEIGHT (emacsframe);
+ + toolbar_height;
}
if (wait_for_tool_bar)
@@ -6858,11 +6863,12 @@ not_in_argv (NSString *arg)
SET_FRAME_GARBAGED (emacsframe);
cancel_mouse_face (emacsframe);
- /* The next two lines appear to be setting the frame to the same
- size as it already is. Why are they there? */
- // wr = NSMakeRect (0, 0, neww, newh);
-
- // [view setFrame: wr];
+ /* The next two lines set the frame to the same size as we've
+ already set above. We need to do this when we switch back
+ from non-native fullscreen, in other circumstances it appears
+ to be a noop. (bug#28872) */
+ wr = NSMakeRect (0, 0, neww, newh);
+ [view setFrame: wr];
// to do: consider using [NSNotificationCenter postNotificationName:].
[self windowDidMove: // Update top/left.