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: Sun, 15 Dec 2024 15:34:57 -0500 Message-ID: References: <861pyfd8pe.fsf@gnu.org> <4d057282-8ec2-4ddb-ac0f-23e65af6e5a1@gmx.at> <7404039b-e71e-44e5-a446-70fa07889528@gmx.at> <1ed054fc-4b82-47cf-8d89-4768b56b88a7@gmx.at> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000000f81a30629550260" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22864"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 74750@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 15 21:37:22 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 1tMvMf-0005lZ-KZ for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 Dec 2024 21:37:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMvMO-0003X4-Mr; Sun, 15 Dec 2024 15:37: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 1tMvMN-0003Wr-Qg for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 15:37: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 1tMvMN-00031D-Ie for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 15:37:03 -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:In-Reply-To:References:MIME-Version:To:Subject; bh=Tga6FV8CczFWz4uqSTzeNRXUEIQMk8sHGOl68vS2th8=; b=HnFJQam+B1MDCKqywHptMUIonKSsB5FLu812lDY9Jpa9g6Jg4wrVxsNGiZ/3ILoAnAbJ1LGgES/OTCWqBkXIDi4GYDD4V611KXl3TY+omTO4nwn9EsrmgrXjaKsRU0rgzc8ysT4eIzfPMZxQV/vx1+66zRfGNC2Yh2iYKo8F0LCscjv9ZH1I7sfg+m9YllCczbMv2/Sq1PVol3cirZ06Qb3FRN9xkRMLB/K1V/UHZhOXJR3fNh+HPysMDK3YsPP3IkjimUxyfPIjqPNMLSxUx/zqnbi8Z0rYGFr1Jk3Qg7UNbpLCwIrIZvbUdN21+/aDxHBfXi8pJ0i6M3jFzG8xRw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMvMM-0001pe-8W for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 15:37: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: Sun, 15 Dec 2024 20:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74750 X-GNU-PR-Package: emacs Original-Received: via spool by 74750-submit@debbugs.gnu.org id=B74750.17342950157026 (code B ref 74750); Sun, 15 Dec 2024 20:37:02 +0000 Original-Received: (at 74750) by debbugs.gnu.org; 15 Dec 2024 20:36:55 +0000 Original-Received: from localhost ([127.0.0.1]:52321 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMvMA-0001pB-KL for submit@debbugs.gnu.org; Sun, 15 Dec 2024 15:36:54 -0500 Original-Received: from mail-vs1-f47.google.com ([209.85.217.47]:55799) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMvM4-0001oz-Fm for 74750@debbugs.gnu.org; Sun, 15 Dec 2024 15:36:48 -0500 Original-Received: by mail-vs1-f47.google.com with SMTP id ada2fe7eead31-4afe70b41a8so928436137.3 for <74750@debbugs.gnu.org>; Sun, 15 Dec 2024 12:36:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734294944; x=1734899744; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Tga6FV8CczFWz4uqSTzeNRXUEIQMk8sHGOl68vS2th8=; b=ljowC2koche9Ay9JWEz+KZCHHV4Gul5Xf497/EkuxtjkhPqUpqmEaAtPD3UYpwQt/1 Jrexj+sEskW6V8IhR+IGvPhZ5zzxEBM5bm/PAku8Ztl35PbsQJ2p8kc0vNXeSKObxURB WNmANcOOIagVPt77U+6XVGOLo5zW+Jqmcerk02itYh8mFqX80gpXIQbr5IH+9MkS7qbF GdzMVJ2pexyRYwbFYL+V6HKGG2OHzftU1fUhGIZL9LW/C3HyKMNrZ0P0waWaU2Mx6Rfm ksuSGix9Hm2jWqhyWB6jtYUf5FMIFM2qk1qZWImano8kQScOHaVxCG54O5qns8hCiS/f 3oAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734294944; x=1734899744; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Tga6FV8CczFWz4uqSTzeNRXUEIQMk8sHGOl68vS2th8=; b=HSv71IBXBGfv8tcil0VNg9SoDManvaKwjeZVZlVH56eMqp8cNGtsgfKgd0RrbBP+OZ K6yEovXsSJ4Wmf41uugIj7vY1Nt4CtNU5w0yGKoocOaNSuThpCC+wy8lqObf0MGFofSD eMzXEwKGPrUaO5L6iYbUpNfOylaoMJ2wbYjyA0wRbHlgm++rMWoR/JNrUPXGjMskywiy UQ2cxrD9U3jozzFBdpZdQl961ws0BFRNijVG6hPvOrp/eTG+ob3EUlxtQf+MCHlh5gN1 mADf8hSsJqqNX9Zqq7KK6adUO7SSbGkdqj2uA2PB3qBV7L//PdSmf9cabNMETyXBYtJo uohA== X-Forwarded-Encrypted: i=1; AJvYcCXX9Fzj5hNzC9/PQY9PIC9bfd+grwMoB0aoU2mGRJlSuJtWBIluWkp1U1qRRtvgHJNULVSf7g==@debbugs.gnu.org X-Gm-Message-State: AOJu0YygKyzuVb9EMqbmHkVOq4Wi48WdlanjGD3LsaSXDG8SwQ5Lhtiu quVbJEAuqLC8/l/BAROrKoINRYIAp4XjVayEn1gnBgVKouP5r1OBIrCxeEjDv3extf1mkcM4oVF /S/gGxGOeJXL4QjIdmEa5s/qxibPxcPDm X-Gm-Gg: ASbGncty5iSWP0apFk7Oqrw5lG51PCPa2+IdvAR8SJqnaQZ90Ebp801AQY2DHxj+4li CMyOjL2c/9P9AbpNGiNSpKeEdAabhiAm6iBINTw== X-Google-Smtp-Source: AGHT+IHjRwycdjHvq4IQuYjRtAqhlWmJkCOG+8JTVb5wogBh0RJsDaHubxBL/7SmWYS58eY+VrAFcv3qx89i8FxHges= X-Received: by 2002:a05:6102:38d4:b0:4af:ef82:ce8b with SMTP id ada2fe7eead31-4b25db47589mr10649752137.26.1734294943791; Sun, 15 Dec 2024 12:35:43 -0800 (PST) In-Reply-To: <1ed054fc-4b82-47cf-8d89-4768b56b88a7@gmx.at> 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:297131 Archived-At: --0000000000000f81a30629550260 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable That patch seems to work. Thank you, Martin. I tested on NS with and without vertical scroll bars and with and without fringes. A basic test of frameset-save and frameset-restore now seem to correctly respect its embedded text-pixel geometry. Now, about clone-frame. Are there any objections to the below implementation that uses text-pixels? (defun my/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))) (frame-resize-pixelwise frame-resize-pixelwise) (new-frame)) (when (and (display-graphic-p frame) (or pixelwise frame-resize-pixelwise)) (setq frame-resize-pixelwise t) (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)) I may be able to test on GTK early this week, but I think you have GNU Linux/GTK on your end? -Stephane On Sat, Dec 14, 2024 at 3:27=E2=80=AFAM martin rudalics w= rote: > > Indeed 15 is the vertical scroll bar width. This was what I reported i= n > the > > original bug submission. You suggested a patch that would accommodate > > fringes, et.al. If you'd like me to make adjustments; e.g., resizing > > fringes or whatever, happy to do it and rerun. > > I've been throwing out the child with the bathwater. Please try the > attached patch which retains an important conjunct. > > > These are all ostensively calls to clone-frame. I'd expect, as I guess > most > > people would, that cloning produces the precise geometry of the > originating > > frame, scroll bar or not. > > The major purpose of 'frame-inhibit-implied-resize' is to avoid resizes > when a frame has been tailored to fit into some arrangement of windows > on the display as, for example, with a tiling window manager. Here I > hardly ever use it. By design, it should have no effect when making a > new frame which is what the corrected patch should support. Still, it > might not work for elements like the external tool bar. > > >> We can try to make it behave reasonably when > >> these values change but I am not sure whether we will succeed. > >> > > > > Let's try. > > Let's. > > martin --0000000000000f81a30629550260 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
That patch seems to work. Thank=C2=A0you,=C2=A0Martin. I tested on NS wi= th and without vertical scroll bars and with and without fringes. A basic t= est of frameset-save and frameset-restore now seem to correctly respect its= embedded text-pixel geometry.

Now, about clone-frame. Are there any objections=C2=A0to = the below implementation that=C2=A0uses=C2=A0text-pixels?

(defun my/clone-frame (&= amp;optional frame no-windows pixelwise)
=C2=A0 "Make a new frame w= ith the same parameters and windows as FRAME.
With a prefix arg NO-WINDO= WS, don't clone the window configuration.=C2=A0 When
PIXELWISE is no= n-nil or if `frame-resize-pixelwise' is non-nil, and frame
is not te= xt-only, clone the originating frame's pixel size.

FRAME default= s 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 selec= t the new frame."
=C2=A0 (interactive (list (selected-frame) curren= t-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 (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 (frame-para= meters frame)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(frame-resize-pixelwis= e frame-resize-pixelwise)
=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 (setq frame-resize-pixelwise t)
=C2=A0 =C2=A0 = =C2=A0 (push (cons 'width (cons 'text-pixels (frame-text-width fram= e)))
=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-height frame)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 default-f= rame-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 new-frame))

I may be able to test on GTK early this week= , but I think you have GNU Linux/GTK on your end?

-Stephane

On Sat, Dec 14, 2024 at 3:27=E2=80=AFAM martin rudalics &l= t;rudalics@gmx.at> wrote:
=C2=A0> Indeed 15 is= the vertical scroll bar width. This was what I reported in the
=C2=A0> original bug submission. You suggested a patch that would accomm= odate
=C2=A0> fringes, et.al. If you'd like me to make adjustments; e.g., resizing<= br> =C2=A0> fringes or whatever, happy to do it and rerun.

I've been throwing out the child with the bathwater.=C2=A0 Please try t= he
attached patch which retains an important conjunct.

=C2=A0> These are all ostensively calls to clone-frame. I'd expect, = as I guess most
=C2=A0> people would, that cloning produces the precise geometry of the = originating
=C2=A0> frame, scroll bar or not.

The major purpose of 'frame-inhibit-implied-resize' is to avoid res= izes
when a frame has been tailored to fit into some arrangement of windows
on the display as, for example, with a tiling window manager.=C2=A0 Here I<= br> hardly ever use it.=C2=A0 By design, it should have no effect when making a=
new frame which is what the corrected patch should support.=C2=A0 Still, it=
might not work for elements like the external tool bar.

=C2=A0>> We can try to make it behave reasonably when
=C2=A0>> these values change but I am not sure whether we will succee= d.
=C2=A0>>
=C2=A0>
=C2=A0> Let's try.

Let's.

martin
--0000000000000f81a30629550260--