Subject: bug#25818: 25.2; frame moved off display does not return (OS X)

From: "Charles A. Roelli" <[email-masked]>
Date: Sat, 29 Apr 2017 13:15:10 +0200

With the current master branch, a child frame might be constrained on OS 
X 10.9+ with the "Spaces" windowing feature turned on, meaning that a 
child frame could be forced back into the screen area -- so yes, there 
could be a case where a child frame doesn't move together with its 
parent.  Maybe that will have to be fixed too; I'm on 10.6 though so I 
can't test.

Otherwise, though, when child/parent frames are not brought off screen, 
a child frame always moves with its parent.

My updated patch takes into account the case where "Spaces" is off or 
unavailable -- if you read the part above what I added:

#ifdef NS_IMPL_COCOA
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9
   // If separate spaces is on, it is like each screen is independent.  
There is
   // no spanning of frames across screens.
   if ([NSScreen screensHaveSeparateSpaces])
     {
       NSTRACE_MSG ("Screens have separate spaces");
       frameRect = [super constrainFrameRect:frameRect toScreen:screen];
       NSTRACE_RETURN_RECT (frameRect);
       return frameRect;
     }
#endif

there is nothing there to prevent a child frame from being constrained 
-- so I will need input from somebody else on that.

On 29/04/2017 12:30, martin rudalics wrote:
> > I fixed the patch so that child frames are never constrained (after
> > some testing, it seems that a child frame cannot get stuck off screen
> > as long as its parent is still visible).  To test this out, evaluate
> > the following from emacs -Q,
> >
> > (progn
> >    (setq test-frame (make-frame `((parent-frame . ,(selected-frame)))))
> >    (set-frame-position test-frame 0 500))
> >
> > and drag the parent frame down until its child is off screen.
>
> Does this mean that the child frame does _not_ move together with its
> parent frame?  That would constitute a major deviation from the other
> platforms.
>
> martin