NS: Set frame position when entering/exiting fullscreen (bug#71912)
* src/nsterm.h ([EmacsView adjustEmacsRectRect]): Declare. * src/nsterm.m ([EmacsView windowDidEnterFullScreen]): New method. ([EmacsView windowDidEnterFullScreen]): Call it. ([EmacsView windowDidExitFullScreen]): Call it.
This commit is contained in:
parent
74fe889a93
commit
9f7c1ace9f
2 changed files with 18 additions and 0 deletions
|
@ -522,6 +522,7 @@ enum ns_return_frame_mode
|
|||
- (void)copyRect:(NSRect)srcRect to:(NSPoint)dest;
|
||||
|
||||
/* Non-notification versions of NSView methods. Used for direct calls. */
|
||||
- (void)adjustEmacsFrameRect;
|
||||
- (void)windowWillEnterFullScreen;
|
||||
- (void)windowDidEnterFullScreen;
|
||||
- (void)windowWillExitFullScreen;
|
||||
|
|
17
src/nsterm.m
17
src/nsterm.m
|
@ -8318,6 +8318,15 @@ - (void)windowDidEnterFullScreen:(NSNotification *)notification
|
|||
[self windowDidEnterFullScreen];
|
||||
}
|
||||
|
||||
- (void)adjustEmacsFrameRect
|
||||
{
|
||||
struct frame *f = emacsframe;
|
||||
NSWindow *frame_window = [FRAME_NS_VIEW (f) window];
|
||||
NSRect r = [frame_window frame];
|
||||
f->left_pos = NSMinX (r) - NS_PARENT_WINDOW_LEFT_POS (f);
|
||||
f->top_pos = NS_PARENT_WINDOW_TOP_POS (f) - NSMaxY (r);
|
||||
}
|
||||
|
||||
- (void)windowDidEnterFullScreen /* provided for direct calls */
|
||||
{
|
||||
NSTRACE ("[EmacsView windowDidEnterFullScreen]");
|
||||
|
@ -8347,6 +8356,10 @@ - (void)windowDidEnterFullScreen /* provided for direct calls */
|
|||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Do what windowDidMove does which isn't called when entering/exiting
|
||||
fullscreen mode. */
|
||||
[self adjustEmacsFrameRect];
|
||||
}
|
||||
|
||||
- (void)windowWillExitFullScreen:(NSNotification *)notification
|
||||
|
@ -8389,6 +8402,10 @@ - (void)windowDidExitFullScreen /* provided for direct calls */
|
|||
|
||||
if (next_maximized != -1)
|
||||
[[self window] performZoom:self];
|
||||
|
||||
/* Do what windowDidMove does which isn't called when entering/exiting
|
||||
fullscreen mode. */
|
||||
[self adjustEmacsFrameRect];
|
||||
}
|
||||
|
||||
- (BOOL)fsIsNative
|
||||
|
|
Loading…
Add table
Reference in a new issue