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.
This commit is contained in:
parent
d6c1a9cb8a
commit
aee0bc8775
1 changed files with 12 additions and 6 deletions
18
src/nsterm.m
18
src/nsterm.m
|
@ -6804,14 +6804,19 @@ - (void) updateFrameSize: (BOOL) delay
|
||||||
|
|
||||||
if (! [self isFullscreen])
|
if (! [self isFullscreen])
|
||||||
{
|
{
|
||||||
|
int toolbar_height;
|
||||||
#ifdef NS_IMPL_GNUSTEP
|
#ifdef NS_IMPL_GNUSTEP
|
||||||
// GNUstep does not always update the tool bar height. Force it.
|
// GNUstep does not always update the tool bar height. Force it.
|
||||||
if (toolbar && [toolbar isVisible])
|
if (toolbar && [toolbar isVisible])
|
||||||
update_frame_tool_bar (emacsframe);
|
update_frame_tool_bar (emacsframe);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
toolbar_height = FRAME_TOOLBAR_HEIGHT (emacsframe);
|
||||||
|
if (toolbar_height < 0)
|
||||||
|
toolbar_height = 35;
|
||||||
|
|
||||||
extra = FRAME_NS_TITLEBAR_HEIGHT (emacsframe)
|
extra = FRAME_NS_TITLEBAR_HEIGHT (emacsframe)
|
||||||
+ FRAME_TOOLBAR_HEIGHT (emacsframe);
|
+ toolbar_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wait_for_tool_bar)
|
if (wait_for_tool_bar)
|
||||||
|
@ -6858,11 +6863,12 @@ - (void) updateFrameSize: (BOOL) delay
|
||||||
SET_FRAME_GARBAGED (emacsframe);
|
SET_FRAME_GARBAGED (emacsframe);
|
||||||
cancel_mouse_face (emacsframe);
|
cancel_mouse_face (emacsframe);
|
||||||
|
|
||||||
/* The next two lines appear to be setting the frame to the same
|
/* The next two lines set the frame to the same size as we've
|
||||||
size as it already is. Why are they there? */
|
already set above. We need to do this when we switch back
|
||||||
// wr = NSMakeRect (0, 0, neww, newh);
|
from non-native fullscreen, in other circumstances it appears
|
||||||
|
to be a noop. (bug#28872) */
|
||||||
// [view setFrame: wr];
|
wr = NSMakeRect (0, 0, neww, newh);
|
||||||
|
[view setFrame: wr];
|
||||||
|
|
||||||
// to do: consider using [NSNotificationCenter postNotificationName:].
|
// to do: consider using [NSNotificationCenter postNotificationName:].
|
||||||
[self windowDidMove: // Update top/left.
|
[self windowDidMove: // Update top/left.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue