emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-26 de6a876 1/2: Fix redefinition of child frames on


From: Alan Third
Subject: [Emacs-diffs] emacs-26 de6a876 1/2: Fix redefinition of child frames on NS
Date: Sun, 3 Jun 2018 04:44:02 -0400 (EDT)

branch: emacs-26
commit de6a876373fde7f44f44fb46a29fcdda1d0793ba
Author: Alan Third <address@hidden>
Commit: Alan Third <address@hidden>

    Fix redefinition of child frames on NS
    
    * src/nsterm.m (x_set_parent_frame): If the NSWindow has an existing
    parent frame, remove it.
---
 src/nsterm.m | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/nsterm.m b/src/nsterm.m
index c8ae31a..df88334 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1958,12 +1958,20 @@ x_set_parent_frame (struct frame *f, Lisp_Object 
new_value, Lisp_Object old_valu
 
   if (p != FRAME_PARENT_FRAME (f))
     {
-      parent = [FRAME_NS_VIEW (p) window];
+      block_input ();
       child = [FRAME_NS_VIEW (f) window];
 
-      block_input ();
-      [parent addChildWindow: child
-                     ordered: NSWindowAbove];
+      if ([child parentWindow] != nil)
+        [[child parentWindow] removeChildWindow:child];
+
+      if (!NILP (new_value))
+        {
+          parent = [FRAME_NS_VIEW (p) window];
+
+          [parent addChildWindow: child
+                         ordered: NSWindowAbove];
+        }
+
       unblock_input ();
 
       fset_parent_frame (f, new_value);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]