From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ship Mints Newsgroups: gmane.emacs.bugs Subject: bug#74750: clone-frame and make-frame pixelwise issues Date: Mon, 9 Dec 2024 10:51:23 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000052ad200628d8589e" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4578"; mail-complaints-to="usenet@ciao.gmane.io" To: 74750@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 09 16:53:16 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tKg4S-00014x-4v for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 09 Dec 2024 16:53:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKg4G-00017y-Mv; Mon, 09 Dec 2024 10:53:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tKg4F-00017n-5c for bug-gnu-emacs@gnu.org; Mon, 09 Dec 2024 10:53:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tKg4E-0007xl-Sr for bug-gnu-emacs@gnu.org; Mon, 09 Dec 2024 10:53:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:MIME-Version:To:Subject; bh=THDpeG+nLnQpJHWGjgULTZV5yhW6ybrWv9bIEkFG7PE=; b=YgFy5VKw06TA4y619bFZ1NAMd/JNpJQdw2QH8gFXoLn30EKFzzLgT1qijbPM0efmpZWavz3MlZSY7oHF/F2g36wPNw9LOE83jKEo2YkLWQtZJTtu/Hwo1Fy/tCjXZMeRnx96chGnPuukKfxvATAy325xKdnshwgmADy5vUVUn3UrGU1PUqeNQ64ezY703aVEXWdtZkZ7A1ePIBwJlsQZ5GxHe/h7Mtq0/EB3DT2TajzW9eMGB+2DoQJ7k+w2dzjWnt1f3kZqDEdIdfMp54BMlGnl5zGg6cc6vmsThviXEkXsBgXb/d60/m1+qjy0v2pJFJC5EmK5+2WH8P/IrdonYw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tKg4E-0004QQ-Gg for bug-gnu-emacs@gnu.org; Mon, 09 Dec 2024 10:53:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ship Mints Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Dec 2024 15:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74750 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.173375953216903 (code B ref -1); Mon, 09 Dec 2024 15:53:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Dec 2024 15:52:12 +0000 Original-Received: from localhost ([127.0.0.1]:55247 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKg3P-0004OW-DZ for submit@debbugs.gnu.org; Mon, 09 Dec 2024 10:52:12 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:36302) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKg3N-0004OM-Dh for submit@debbugs.gnu.org; Mon, 09 Dec 2024 10:52:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tKg3H-00010b-UP for bug-gnu-emacs@gnu.org; Mon, 09 Dec 2024 10:52:05 -0500 Original-Received: from mail-vk1-xa29.google.com ([2607:f8b0:4864:20::a29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tKg3F-0007ue-JE for bug-gnu-emacs@gnu.org; Mon, 09 Dec 2024 10:52:03 -0500 Original-Received: by mail-vk1-xa29.google.com with SMTP id 71dfb90a1353d-5162571e761so444169e0c.2 for ; Mon, 09 Dec 2024 07:52:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733759520; x=1734364320; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=THDpeG+nLnQpJHWGjgULTZV5yhW6ybrWv9bIEkFG7PE=; b=jHPsyjsKGAyIkg2Z5pyj0sD4ctyixWKEwIe4VtuykMabeuP1IP9gVYQbkrvYu+UzDl RDwLrqU5K+hRF2P/Rv0ZCVoT3brNAcgeVhQ0wHp4ssi4xsvLk8efMEbh6M1CXoJOt0us aHQZlh8giA2UayERZ4UfOa5fV1MNDn6VIKVWWPw8MyU76nd5s8A97q31fbDjy4hCWbAN dFbHgKuDwSR+LOTDAWdW1YNmAGYaVVPDvZ37s900vmVR1gbH9NNe5wqSKuLBgCT37DVr e6Soplc0BF3lXi149wgvgpy/CrHqag8mVyeSWmB7SgtNAPXwsvTXrzpKFkSN6OESzDQl +8VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733759520; x=1734364320; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=THDpeG+nLnQpJHWGjgULTZV5yhW6ybrWv9bIEkFG7PE=; b=GcXWrRaod+77UWefahVini8nOwW6PDTvfwJlSZr9nMmaKIN1eh15asaIaCiM3l8ecO 52FlPfPzVxMKSsH5GZF/saJHJgrqoUKV5nixxdiku8SHh+0sQLmdJmEfPd89WfIvDpCz ns5iklctAiMYiezC7WvA4F/HtopPqfoiuXKEORtoqYkuXNMHBRCS5cmsxGtdFdDIVOAT zFeGqGlzHLcdbZI4S2VmnY9VHJWjxGH/wVTTBZtj1tWLAud/gvOuxDGAIbxBVaz47W5o owYoj3g7eTMatZbhq6v3e9c5+4ax/Uf3laQ+hz15W921b3U6Q1UM/XoO9n8O2qiWs3Ok 2rOQ== X-Gm-Message-State: AOJu0YxZfV0n/qgQQyo7P5dX5ddI/PGJ/ZQjmnN2S++QBoChTspjKU4a o80XTlaKFTvnqwaL7QO9hPieq8dbSeGirUBWHhoGSTKOhxFJPo9H3boUU0E1Swap968PeKM/B29 /2NvI7FRu8/9x4ugn2MlJcr60Mm1x4RAU X-Gm-Gg: ASbGncvxpfYfkFOwkpDPtOEkMMKUxh0HL/ifU49IY91eauYYdjj8AUe0kEzKgmiyMJ+ q5I7e0sCq3mwaIbL7PaL+nxLZGHWbsos= X-Google-Smtp-Source: AGHT+IFneO8pXwpWMuRHnPCpg/h9CotNXzfJLxUPGyGElLFEXv1M1+HcaAR0c697JODzhcwd0L4Y8QsYu2ahlR40kiw= X-Received: by 2002:a05:6122:895:b0:516:2833:1b8d with SMTP id 71dfb90a1353d-5188858f8ccmr1606234e0c.11.1733759520122; Mon, 09 Dec 2024 07:52:00 -0800 (PST) Received-SPF: pass client-ip=2607:f8b0:4864:20::a29; envelope-from=shipmints@gmail.com; helo=mail-vk1-xa29.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:296703 Archived-At: --00000000000052ad200628d8589e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable While trying to reconcile pixelwise frame sizing behaviors, I narrowed down two related issues. clone-frame does not correctly clone frames on a pixelwise basis. make-frame's text-pixels geometry support does not produce specified pixelwise geometry. This also impacts frameset-restore's ability to precisely reproduce pixelwise frame sizes. I consider these to be related as clone-frame's use of make-frame could be using text-pixels but if that doesn't work then pixelwise cloning won't work. I did read through the code base as best as I could but could not find the source of the text-pixels issue. The following reproducer, under -Q, shows the same results on 29.4 and 30.0.92. My main platform is NS and I also did some testing on GTK. GTK's issues seem a bit "messier" and I didn't spend any time trying to understand them in depth as I was more interested to know if GTK worked correctly or not, which it doesn't. (switch-to-buffer "*Messages*") (let ((target-text-width 1700) (target-text-height 1000) (native-width) (native-height) (msg (lambda (s frame) (message "%s text-width=3D%d (=CE=94%d) text-height=3D%d (=CE= =94%d) native-width=3D%d (=CE=94%d) native-height %d (=CE=94%d)\n" s (frame-text-width frame) (- (frame-text-width frame) target-text-width) (frame-text-height frame) (- (frame-text-height frame) target-text-height) (frame-native-width frame) (- (frame-native-width frame) native-width) (frame-native-height frame) (- (frame-native-height frame) native-height))))) (set-frame-position nil 0 0) (set-frame-size nil target-text-width target-text-height 'pixelwise) (setq native-width (frame-native-width) native-height (frame-native-height)) (message "Targets: text-width=3D%d text-height=3D%d\n" target-text-width target-text-height) (funcall msg "orig" (selected-frame)) (message "clone-frame under frame-resize-pixelwise nil; expectation: use lines/columns geometry; outcome: met") (let ((frame-resize-pixelwise nil)) (let ((new-frame (clone-frame))) (funcall msg "new" new-frame) (delete-frame new-frame))) (message "clone-frame under frame-resize-pixelwise t; expectation: pixelwise geometry; outcome: unmet") (let ((frame-resize-pixelwise t)) (let ((new-frame (clone-frame))) (funcall msg "new" new-frame) (delete-frame new-frame))) (message "clone-frame followed by manual resize; expectation: pixelwise geometry; outcome: met (but two steps)") (let ((new-frame (clone-frame))) (set-frame-size new-frame target-text-width target-text-height 'pixelwise) (funcall msg "new" new-frame) (delete-frame new-frame)) (message "manual clone under frame-resize-pixelwise using text-pixels; expectation: pixelwise geometry; outcome: unmet") ;; code lifted from clone-frame ;; incorrect width offset seems to be equal to frame-scroll-bar-width (let* ((frame-resize-pixelwise t) (frame (selected-frame)) (no-windows nil) (windows (unless no-windows (window-state-get (frame-root-window frame)))) (default-frame-alist (seq-remove (lambda (elem) (memq (car elem) frame-internal-parameters)) (frame-parameters frame))) (new-frame)) (when (and (display-graphic-p frame) frame-resize-pixelwise) (push (cons 'width (cons 'text-pixels (frame-text-width frame))) default-frame-alist) (push (cons 'height (cons 'text-pixels (frame-text-height frame))) default-frame-alist)) (setq new-frame (make-frame)) (when windows (window-state-put windows (frame-root-window new-frame) 'safe)) (unless (display-graphic-p frame) (select-frame new-frame)) (funcall msg "new" new-frame) (delete-frame new-frame))) This is an implementation of clone-frame that uses text-pixels under make-frame. This depends on make-frame text-pixels being corrected. Happy to supply this as a patch should the discussion of these issues progress in that direction. (defun clone-frame (&optional frame no-windows pixelwise) "Make a new frame with the same parameters and windows as FRAME. With a prefix arg NO-WINDOWS, don't clone the window configuration. When PIXELWISE is non-nil or if `frame-resize-pixelwise' is non-nil, and frame is not text-only, clone the originating frame's pixel size. FRAME defaults to the selected frame. The frame is created on the same terminal as FRAME. If the terminal is a text-only terminal then also select the new frame." (interactive (list (selected-frame) current-prefix-arg)) (let* ((frame (or frame (selected-frame))) (windows (unless no-windows (window-state-get (frame-root-window frame)))) (default-frame-alist (seq-remove (lambda (elem) (memq (car elem) frame-internal-parameters)) (frame-parameters frame))) (new-frame)) (when (and (display-graphic-p frame) (or pixelwise frame-resize-pixelwise)) (push (cons 'width (cons 'text-pixels (frame-text-width frame))) default-frame-alist) (push (cons 'height (cons 'text-pixels (frame-text-height frame))) default-frame-alist)) (setq new-frame (make-frame)) (when windows (window-state-put windows (frame-root-window new-frame) 'safe)) (unless (display-graphic-p frame) (select-frame new-frame)) new-frame)) -Stephane --00000000000052ad200628d8589e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
While trying to reconcile pixelwise frame sizing behaviors, I narrowed d= own two related issues.

clone-frame does not correctly clone frames = on a pixelwise basis.

make-frame's text-pixels geometry support = does not produce specified pixelwise geometry. This also impacts frameset-r= estore's ability to precisely reproduce pixelwise frame sizes.

I= consider these to be related as clone-frame's use of make-frame could = be using text-pixels but if that doesn't work then pixelwise cloning wo= n't work. I did read through the code base as best as I could but could= not find the source of the text-pixels issue.

The following reprodu= cer, under -Q, shows the same results on 29.4 and 30.0.92. My main platform= is NS and I also did some testing on GTK. GTK's issues seem a bit &quo= t;messier" and I didn't spend any time trying to understand them i= n depth as I was more interested to know if GTK worked correctly or not, wh= ich it doesn't.

(switch-to-buffer "*Messages*")
(le= t ((target-text-width 1700)
=C2=A0 =C2=A0 =C2=A0 (target-text-height 100= 0)
=C2=A0 =C2=A0 =C2=A0 (native-width)
=C2=A0 =C2=A0 =C2=A0 (native-h= eight)
=C2=A0 =C2=A0 =C2=A0 (msg (lambda (s frame)
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(message "%s text-width=3D%d (=CE=94%d)= text-height=3D%d (=CE=94%d) native-width=3D%d (=CE=94%d) native-height %d = (=CE=94%d)\n"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 s
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (frame-text-width frame) (- (frame-text-wid= th frame) target-text-width)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (frame-text-height frame) (- (frame-text= -height frame) target-text-height)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (frame-native-width frame) (- (fr= ame-native-width frame) native-width)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (frame-native-height frame) (- (= frame-native-height frame) native-height)))))
=C2=A0 (set-frame-position= nil 0 0)
=C2=A0 (set-frame-size nil target-text-width target-text-heigh= t 'pixelwise)
=C2=A0 (setq native-width (frame-native-width)
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 native-height (frame-native-height))
=C2=A0 (me= ssage "Targets: text-width=3D%d text-height=3D%d\n" target-text-w= idth target-text-height)
=C2=A0 (funcall msg "orig" (selected-= frame))

=C2=A0 (message "clone-frame under frame-resize-pixelwi= se nil; expectation: use lines/columns geometry; outcome: met")
=C2= =A0 (let ((frame-resize-pixelwise nil))
=C2=A0 =C2=A0 (let ((new-frame (= clone-frame)))
=C2=A0 =C2=A0 =C2=A0 (funcall msg "new" new-fra= me)
=C2=A0 =C2=A0 =C2=A0 (delete-frame new-frame)))

=C2=A0 (messa= ge "clone-frame under frame-resize-pixelwise t; expectation: pixelwise= geometry; outcome: unmet")
=C2=A0 (let ((frame-resize-pixelwise t)= )
=C2=A0 =C2=A0 (let ((new-frame (clone-frame)))
=C2=A0 =C2=A0 =C2=A0= (funcall msg "new" new-frame)
=C2=A0 =C2=A0 =C2=A0 (delete-fr= ame new-frame)))

=C2=A0 (message "clone-frame followed by manua= l resize; expectation: pixelwise geometry; outcome: met (but two steps)&quo= t;)
=C2=A0 (let ((new-frame (clone-frame)))
=C2=A0 =C2=A0 (set-frame-= size new-frame target-text-width target-text-height 'pixelwise)
=C2= =A0 =C2=A0 (funcall msg "new" new-frame)
=C2=A0 =C2=A0 (delete= -frame new-frame))

=C2=A0 (message "manual clone under frame-re= size-pixelwise using text-pixels; expectation: pixelwise geometry; outcome:= unmet")
=C2=A0 ;; code lifted from clone-frame
=C2=A0 ;; incorr= ect width offset seems to be equal to frame-scroll-bar-width
=C2=A0 (let= * ((frame-resize-pixelwise t)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(frame (= selected-frame))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(no-windows nil)
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(windows (unless no-windows
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (window-state-g= et (frame-root-window frame))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(defau= lt-frame-alist
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (seq-remove (lambda (e= lem)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 (memq (car elem) frame-internal-parameters))
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (fram= e-parameters frame)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(new-frame))
= =C2=A0 =C2=A0 (when (and (display-graphic-p frame) frame-resize-pixelwise)<= br>=C2=A0 =C2=A0 =C2=A0 (push (cons 'width (cons 'text-pixels (fram= e-text-width frame))) default-frame-alist)
=C2=A0 =C2=A0 =C2=A0 (push (c= ons 'height (cons 'text-pixels (frame-text-height frame))) default-= frame-alist))
=C2=A0 =C2=A0 (setq new-frame (make-frame))
=C2=A0 =C2= =A0 (when windows
=C2=A0 =C2=A0 =C2=A0 (window-state-put windows (frame-= root-window new-frame) 'safe))
=C2=A0 =C2=A0 (unless (display-graphi= c-p frame)
=C2=A0 =C2=A0 =C2=A0 (select-frame new-frame))
=C2=A0 =C2= =A0 (funcall msg "new" new-frame)
=C2=A0 =C2=A0 (delete-frame = new-frame)))

This is an implementation of clone-frame that uses text= -pixels under make-frame. This depends on make-frame text-pixels being corr= ected. Happy to supply this as a patch should the discussion of these issue= s progress in that direction.

(defun clone-frame (&optional fram= e no-windows pixelwise)
=C2=A0 "Make a new frame with the same para= meters and windows as FRAME.
With a prefix arg NO-WINDOWS, don't clo= ne the window configuration.=C2=A0 When
PIXELWISE is non-nil or if `fram= e-resize-pixelwise' is non-nil, and frame
is not text-only, clone th= e originating frame's pixel size.

FRAME defaults to the selected= frame.=C2=A0 The frame is created on the
same terminal as FRAME.=C2=A0 = If the terminal is a text-only terminal then
also select the new frame.&= quot;
=C2=A0 (interactive (list (selected-frame) current-prefix-arg))=C2=A0 (let* ((frame (or frame (selected-frame)))
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0(windows (unless no-windows
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (window-state-get (frame-root-window= frame))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(default-frame-alist
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (seq-remove (lambda (elem)
=C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (mem= q (car elem) frame-internal-parameters))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (frame-parameters frame)))=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(new-frame))
=C2=A0 =C2=A0 (when (and= (display-graphic-p frame)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(or pixelwise frame-resize-pixelwise))
=C2=A0 =C2=A0 =C2=A0 (p= ush (cons 'width (cons 'text-pixels (frame-text-width frame)))
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 default-frame-alist)
=C2=A0 = =C2=A0 =C2=A0 (push (cons 'height (cons 'text-pixels (frame-text-he= ight frame)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 default-frame-al= ist))
=C2=A0 =C2=A0 (setq new-frame (make-frame))
=C2=A0 =C2=A0 (when= windows
=C2=A0 =C2=A0 =C2=A0 (window-state-put windows (frame-root-wind= ow new-frame) 'safe))
=C2=A0 =C2=A0 (unless (display-graphic-p frame= )
=C2=A0 =C2=A0 =C2=A0 (select-frame new-frame))
=C2=A0 =C2=A0 new-fr= ame))

-Stephane
--00000000000052ad200628d8589e--