diff options
| author | Alan Third | 2017-10-25 14:08:43 +0100 |
|---|---|---|
| committer | Alan Third | 2017-10-25 14:12:28 +0100 |
| commit | aee0bc877579ad606d33a9abf162da4bd50da618 (patch) | |
| tree | 0c2a1c865bcbbed8cff0655f9f012d7cc94adaca | |
| parent | d6c1a9cb8a52bd6dce91cea5d6c2f9a3a90a0b38 (diff) | |
| download | emacs-aee0bc877579ad606d33a9abf162da4bd50da618.tar.gz 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.
| -rw-r--r-- | src/nsterm.m | 18 |
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) | |||
| 6804 | 6804 | ||
| 6805 | if (! [self isFullscreen]) | 6805 | if (! [self isFullscreen]) |
| 6806 | { | 6806 | { |
| 6807 | int toolbar_height; | ||
| 6807 | #ifdef NS_IMPL_GNUSTEP | 6808 | #ifdef NS_IMPL_GNUSTEP |
| 6808 | // GNUstep does not always update the tool bar height. Force it. | 6809 | // GNUstep does not always update the tool bar height. Force it. |
| 6809 | if (toolbar && [toolbar isVisible]) | 6810 | if (toolbar && [toolbar isVisible]) |
| 6810 | update_frame_tool_bar (emacsframe); | 6811 | update_frame_tool_bar (emacsframe); |
| 6811 | #endif | 6812 | #endif |
| 6812 | 6813 | ||
| 6814 | toolbar_height = FRAME_TOOLBAR_HEIGHT (emacsframe); | ||
| 6815 | if (toolbar_height < 0) | ||
| 6816 | toolbar_height = 35; | ||
| 6817 | |||
| 6813 | extra = FRAME_NS_TITLEBAR_HEIGHT (emacsframe) | 6818 | extra = FRAME_NS_TITLEBAR_HEIGHT (emacsframe) |
| 6814 | + FRAME_TOOLBAR_HEIGHT (emacsframe); | 6819 | + toolbar_height; |
| 6815 | } | 6820 | } |
| 6816 | 6821 | ||
| 6817 | if (wait_for_tool_bar) | 6822 | if (wait_for_tool_bar) |
| @@ -6858,11 +6863,12 @@ not_in_argv (NSString *arg) | |||
| 6858 | SET_FRAME_GARBAGED (emacsframe); | 6863 | SET_FRAME_GARBAGED (emacsframe); |
| 6859 | cancel_mouse_face (emacsframe); | 6864 | cancel_mouse_face (emacsframe); |
| 6860 | 6865 | ||
| 6861 | /* The next two lines appear to be setting the frame to the same | 6866 | /* The next two lines set the frame to the same size as we've |
| 6862 | size as it already is. Why are they there? */ | 6867 | already set above. We need to do this when we switch back |
| 6863 | // wr = NSMakeRect (0, 0, neww, newh); | 6868 | from non-native fullscreen, in other circumstances it appears |
| 6864 | 6869 | to be a noop. (bug#28872) */ | |
| 6865 | // [view setFrame: wr]; | 6870 | wr = NSMakeRect (0, 0, neww, newh); |
| 6871 | [view setFrame: wr]; | ||
| 6866 | 6872 | ||
| 6867 | // to do: consider using [NSNotificationCenter postNotificationName:]. | 6873 | // to do: consider using [NSNotificationCenter postNotificationName:]. |
| 6868 | [self windowDidMove: // Update top/left. | 6874 | [self windowDidMove: // Update top/left. |