macOS: Don't constrainFrameRect for child frames

* src/nsterm.m ([EmacsWindow constrainFrameRect:toScreen:]): Don't do
anything for child frames.
This commit is contained in:
Gerd Möllmann 2025-03-09 11:47:35 +01:00
parent 41c1c6ffac
commit ba20f73d8e

View file

@ -9790,6 +9790,13 @@ - (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen
NSTRACE ("[EmacsWindow constrainFrameRect:" NSTRACE_FMT_RECT " toScreen:]",
NSTRACE_ARG_RECT (frameRect));
/* Don't do anything for child frames because that leads to weird
child frame placement in some cases involving Dock placement and
Dock Hiding. */
struct frame *f = ((EmacsView *) [self delegate])->emacsframe;
if (FRAME_PARENT_FRAME (f))
return frameRect;
#ifdef NS_IMPL_COCOA
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1090
// If separate spaces is on, it is like each screen is independent. There is