Subject: Re: bug#29953: 26.0.90; Moving a child frame before making it visible makes the child frame not showing any more on macOS

From: jiegec <[email-masked]>
Date: Thu, 4 Jan 2018 16:38:18 +0800

开 3 January 2018 在 10:07:12 PM, Alan Third ([email-masked]) 写到:
On Wed, Jan 03, 2018 at 07:55:12AM +0800, Jiege Chen wrote: 
> 
> Snippet: 
> 
> This code uses `oddp', which might not be available from `emacs -Q'. 

You can replace it with (= 1 (mod count 2)) 
Yup, that’s right.

> On my macOS Sierra, the frame only shows once and never shows again. 

There were two issues interacting here: invisible child frames lose 
track of their parents in NS, and frames that are off‐screen don’t 
have an associated screen but our positioning code will only position 
a frame if it knows it’s screen. 

I’ve fixed the first issue so that we look up the parent through the 
Emacs frame structs, and the second by positioning according to the 
main screen if the frame doesn’t have a screen. 

I also fixed what I think is a bug when child frames are positioned 
with negative values. On X it looks as though a negative value always 
results in positioning according to the bottom‐right of the parent 
frame, but on NS it would be positioned to the left and above the 
parent frame. NS now behaves like X. 

Patch attached. 
I have tested it locally, and it fixes the problem for me. Both the snippet and lsp-ui work well now.

> Related issue: https://github.com/emacs-lsp/lsp-ui/issues/21 . 

Are you using threads? GUI calls and threads don’t mix well yet, 
unfortunately. 

-- 
Alan Third 

Best regards,
Jiajie Chen