GNU bug report logs - #36672
27.0.50; NS build: Creating child frame leads to empty space

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Andrii Kolomoiets <andreyk.mad@HIDDEN>; dated Mon, 15 Jul 2019 17:39:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at submit <at>

Received: (at submit) by; 15 Jul 2019 17:38:40 +0000
From debbugs-submit-bounces <at> Mon Jul 15 13:38:39 2019
Received: from localhost ([]:48957
	by with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at>>)
	id 1hn4vv-0005zZ-KD
	for submit <at>; Mon, 15 Jul 2019 13:38:39 -0400
Received: from ([]:37774)
 by with esmtp (Exim 4.84_2)
 (envelope-from <andreyk.mad@HIDDEN>) id 1hn4vs-0005zQ-RN
 for submit <at>; Mon, 15 Jul 2019 13:38:37 -0400
Received: from ([2001:470:142:3::10]:48036)
 by with esmtp (Exim 4.86_2)
 (envelope-from <andreyk.mad@HIDDEN>) id 1hn4vr-000898-UH
 for bug-gnu-emacs@HIDDEN; Mon, 15 Jul 2019 13:38:36 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM
 autolearn=disabled version=3.3.2
Received: from Debian-exim by with spam-scanned (Exim 4.71)
 (envelope-from <andreyk.mad@HIDDEN>) id 1hn4vr-0007JU-1Y
 for bug-gnu-emacs@HIDDEN; Mon, 15 Jul 2019 13:38:35 -0400
Received: from ([2a00:1450:4864:20::42c]:39292)
 by with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <andreyk.mad@HIDDEN>)
 id 1hn4vq-0007Ip-Ma
 for bug-gnu-emacs@HIDDEN; Mon, 15 Jul 2019 13:38:34 -0400
Received: by with SMTP id x4so18000721wrt.6
 for <bug-gnu-emacs@HIDDEN>; Mon, 15 Jul 2019 10:38:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025;
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025;
X-Gm-Message-State: APjAAAXx4SfEJU1Y4HPhJWX+RW8kxUzot5wdaA1v9cwBf+S38qUF9VFb
X-Google-Smtp-Source: APXvYqz3ITU0wnPj6SeWRoPYpJ86UHP7+5t96CtT0HivA9QeltFbC4cFTXoQ+/eJ65951zwQIw5kqQ==
X-Received: by 2002:a5d:5450:: with SMTP id w16mr31405543wrv.128.1563212312933; 
 Mon, 15 Jul 2019 10:38:32 -0700 (PDT)
Received: from [] ([])
 by with ESMTPSA id c78sm24643303wmd.16.2019.
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 15 Jul 2019 10:38:32 -0700 (PDT)
From: Andrii Kolomoiets <andreyk.mad@HIDDEN>
Content-Type: multipart/mixed;
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\))
Subject: 27.0.50; NS build: Creating child frame leads to empty space
Message-Id: <04CF7A6F-C1E7-4FE5-B648-8DA8CBD3B1ED@HIDDEN>
Date: Mon, 15 Jul 2019 20:38:31 +0300
To: bug-gnu-emacs@HIDDEN
X-Mailer: Apple Mail (2.3445.104.11)
X-detected-operating-system: by Genre and OS details not
X-Received-From: 2a00:1450:4864:20::42c
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at>
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <>
List-Unsubscribe: <>, 
 <mailto:debbugs-submit-request <at>>
List-Archive: <>
List-Post: <mailto:debbugs-submit <at>>
List-Help: <mailto:debbugs-submit-request <at>>
List-Subscribe: <>, 
 <mailto:debbugs-submit-request <at>>
Errors-To: debbugs-submit-bounces <at>
Sender: "Debbugs-submit" <debbugs-submit-bounces <at>>
X-Spam-Score: -2.3 (--)

Content-Transfer-Encoding: 7bit
Content-Type: text/plain;

Assume there are only one space - Desktop
1. emacs -Q
2. M-x toggle-frame-fullscreen
   Now there are two spaces - Desktop and *scratch*
3. eval (make-frame `((parent-frame . ,(window-frame))))
   Now there are three spaces:
   - Desktop
   - Empty space named *scratch* with emacs menu
   - *scratch* with emacs frames but without menu

Although attached patch solves this problem for me these cases still not
handled right way:

1. Removing parent-frame property leaves the frame is same space:

(let ((new-frame (make-frame `((parent-frame . ,(window-frame))))))
  (modify-frame-parameters new-frame `((parent-frame . nil))))

Maybe child frame must go fullscreen if ex-parent frame is in

2. Setting parent frame after frame creation:

(let ((frame (window-frame))
      (new-frame (make-frame)))
  (modify-frame-parameters new-frame `((parent-frame . ,frame))))


In GNU Emacs 27.0.50 (build 1, x86_64-apple-darwin18.6.0, NS
appkit-1671.50 Version 10.14.5 (Build 18F132))
Windowing system distributor 'Apple', version 10.3.1671
System Description:  Mac OS X 10.14.5

Content-Disposition: attachment;
Content-Type: application/octet-stream;
Content-Transfer-Encoding: 7bit

diff --git a/src/nsterm.h b/src/nsterm.h
index 9773eb3e66..d16588718e 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -1274,6 +1274,7 @@ extern char gnustep_base_version[];  /* version tracking */
 #if !defined (NS_IMPL_COCOA) || !defined (MAC_OS_X_VERSION_10_7)
 #define NSFullScreenWindowMask                      (1 << 14)
 #define NSWindowCollectionBehaviorFullScreenPrimary (1 << 7)
+#define NSWindowCollectionBehaviorFullScreenAuxiliary (1 << 8)
 #define NSApplicationPresentationFullScreen         (1 << 10)
 #define NSApplicationPresentationAutoHideToolbar    (1 << 11)
 #define NSAppKitVersionNumber10_7                   1138
diff --git a/src/nsterm.m b/src/nsterm.m
index 02331826d9..cc5921090c 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -7365,7 +7375,10 @@ - (instancetype) initFrameFromEmacs: (struct frame *)f
   if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_7)
-    [win setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
+    if (FRAME_PARENT_FRAME (f))
+      [win setCollectionBehavior:NSWindowCollectionBehaviorFullScreenAuxiliary];
+    else
+      [win setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];

   wr = [win frame];


Acknowledgement sent to Andrii Kolomoiets <andreyk.mad@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#36672; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 15 Jul 2019 17:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.