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: Fri, 13 Dec 2024 11:28:49 -0500 Message-ID: References: <861pyfd8pe.fsf@gnu.org> <4d057282-8ec2-4ddb-ac0f-23e65af6e5a1@gmx.at> <7404039b-e71e-44e5-a446-70fa07889528@gmx.at> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000f07d150629295591" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8567"; 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 Fri Dec 13 17:31: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 1tM8ZV-00022I-Oi for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 Dec 2024 17:31:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tM8ZG-0003ai-7p; Fri, 13 Dec 2024 11:31:06 -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 1tM8ZC-0003aT-5E for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2024 11:31:02 -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 1tM8ZB-0003YQ-Sb for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2024 11:31:01 -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=vILEZX+4kfsKPxpfuYYxnNaF8rcF3SIVFZwUwfSp7So=; b=v6owxkpWzPN6qv7RySIi5Fl7nPgxJonwBgKWHXlp+vNlXjvfK7kBm5XUlg6MB/gPcsOp5lkdl1+WkdadoSXoOTD4kVzxc34AYGmcYa7ce410x43S5lM0s8q3lNfFQIyceRG64050wGfxNFabkNdQW8BpeudJE67FGOLhJm6HCdZLmE3/nc3wpGL0VCJ4aY9s3OruFrG+sqhamy7tegQxULMWwA3ZrwzKOmz9Wcm9LRJdZbIBKFTl3IgYFu9LIhXea75OwyMgY0Y+xXxD/sO41Ho/Exri3zLuyz+kS3nfoQKfcLwzb2T20MSBPTD0w1S+f9NiIbAo2mzRb9tVrLTbug==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tM8ZB-0007SL-N4 for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2024 11:31:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ship Mints Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Dec 2024 16:31:01 +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.173410744428634 (code B ref 74750); Fri, 13 Dec 2024 16:31:01 +0000 Original-Received: (at 74750) by debbugs.gnu.org; 13 Dec 2024 16:30:44 +0000 Original-Received: from localhost ([127.0.0.1]:43909 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tM8Yt-0007Rl-Kb for submit@debbugs.gnu.org; Fri, 13 Dec 2024 11:30:44 -0500 Original-Received: from mail-vk1-f173.google.com ([209.85.221.173]:53322) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tM8Yo-0007RO-2e for 74750@debbugs.gnu.org; Fri, 13 Dec 2024 11:30:42 -0500 Original-Received: by mail-vk1-f173.google.com with SMTP id 71dfb90a1353d-51640f7bbd3so485161e0c.2 for <74750@debbugs.gnu.org>; Fri, 13 Dec 2024 08:30:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734107372; x=1734712172; 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=vILEZX+4kfsKPxpfuYYxnNaF8rcF3SIVFZwUwfSp7So=; b=TPwTJXlbLu9rtQCOoFhfUCR8LBFEzxGge6fhbQtXuvOqGhgr4AuoiFLRUYFjrMlBV9 rrzRFzmrT8HEToOZaH0SRD5lV29EUWdFHnX5nB9M4iI+ZcVmLX797PNF64vrUZn6uxvK N3BC3E6eF0cyum7NXgathfi7g2WUAkK6J9uuWf+55g853sHZ5Yg/bktu35KceQEIwYC6 tcouqjOj0PS0oZ08MpBNiIvN8SsYvRDfgBJytIRmdukym4U8xUMb0yRK6mIMNBEb2rU7 0kFR5P/lZR7QwaMqtN203rbP32uoMiMfg+8nlZtLNhhstN1iwWgDMivKrGmF2fK+oLQB NRSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734107372; x=1734712172; 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=vILEZX+4kfsKPxpfuYYxnNaF8rcF3SIVFZwUwfSp7So=; b=flII5eNc6R+eNuaWVeTUe+XGhUAEAeDSqC2LxRKiiUMipceCXSmmMvjZ4G2jdKvhtX DN/H+5JBPfjniiHduuY3c7BN8QwHJAS32LOf8X/APoDYR4RulNGk1oMLDoOz8LQynimx 7f0AIuajKJDUwoG7n3slc2BM4rCIAJ/yXk9ostSM7hbTbEWGkm6B+4xthpIyF1OJ2mVU VvsbaP4JnfRQzzCwcDS/BVhB0K5TAA/w8E3tF5hw1aXVdRACuWJkWsCSPQx7+bABv73U fw9FFrugVOjddAqCz4tD6PpZ1KY/0zjV7MTIIy3WIVOKWrRB4wpRRRerRVfYPdnfn4vU Xj/A== X-Forwarded-Encrypted: i=1; AJvYcCXTGHKjYp65XoXxEWJe7BSegW7AOCOebYx1SVNSDs5Ux+tBiP9r4jZoijCCSNbn5hBO4caP3A==@debbugs.gnu.org X-Gm-Message-State: AOJu0YycBpBNUwsAiEal3Bhy43OkjHZYeCSOtI/ThRovOt4o+M9bZOLW bu5n9gdCYw341ikkjt2W1FfErxRI5oUG53waZPL1jDX32JXPDkU8WUCpI+NFCDXT1jZbMBIIyy7 Kpon1YtYGMUC6aC/pZFwsvCxvGg55T/K9 X-Gm-Gg: ASbGncunE7+DkHiojt/YopwgRNW/wqbyCmUMb8dovWr+g9m4CVB7lAB38Vp8o+30UKW 2QorQoLoW9YztVJ3mg0CVujJNhbYjyUe8t+ZrGA== X-Google-Smtp-Source: AGHT+IED8PwDVemEirRsdqptkgRVXN0mLNnNHXu1v7AG97HSB2lly7JYa8gnp+0Ro3GE0lvt96S27nZq+8Sfj7d/RBY= X-Received: by 2002:a05:6122:1e01:b0:516:18cd:c1fc with SMTP id 71dfb90a1353d-518ca30617amr3968448e0c.8.1734107372483; Fri, 13 Dec 2024 08:29:32 -0800 (PST) In-Reply-To: <7404039b-e71e-44e5-a446-70fa07889528@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:296980 Archived-At: --000000000000f07d150629295591 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thank you for the patch and continued focus on this. The following is the behavior I see on NS with the patch applied with target width 1700 and height 1000. These are results from clone-frame using text-pixels which I've included below without explicit pixelwise argument so it respects frame-resize-pixelwise. Note: frame-inhibit-implied-resize=3D(tab-bar-lines) is the default setting on NS: #if defined (USE_GTK) || defined (HAVE_NS) frame_inhibit_implied_resize =3D list1 (Qtab_bar_lines); frame-resize-pixelwise=3Dnil frame-inhibit-implied-resize=3Dnil text-width= =3D1692 (=CE=94-8) text-height=3D984 (=CE=94-16) native-width=3D1727 (=CE=94-8) nat= ive-height 988 (=CE=94-16) Result: respects lines/cols as expected. frame-resize-pixelwise=3Dt frame-inhibit-implied-resize=3D(tab-bar-lines) text-width=3D1700 (=CE=940) text-height=3D1000 (=CE=940) native-width=3D173= 5 (=CE=940) native-height 1004 (=CE=940) Result: Okay by accident, I think, only because tab-bar-lines parameter is nil during adjust_frame_height invocations? frame-resize-pixelwise=3Dt frame-inhibit-implied-resize=3Dnil text-width=3D= 1700 (=CE=940) text-height=3D1000 (=CE=940) native-width=3D1735 (=CE=940) native= -height 1004 (=CE=940) Result: Okay but with frame-inhibit-implied-resize nil, I'd have expected rows/cols vs. pixelwise. frame-resize-pixelwise=3Dt frame-inhibit-implied-resize=3Dt text-width=3D16= 85 (=CE=94-15) text-height=3D1000 (=CE=940) native-width=3D1720 (=CE=94-15) na= tive-height 1004 (=CE=940) Result: I think this case remains broken needing the adjustment from your first patch that you wanted to also account for fringes? My default GUI setup is frame-resize-pixelwise t frame-inhibit-implied-resize t as I expect many people have adopted these days. (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))) (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)) On Fri, Dec 13, 2024 at 5:30=E2=80=AFAM martin rudalics w= rote: > > > That patch works to address make-frame's respect for text-pixels, a= t > least > > > on NS (the only platform I tested). > > > > I don't like it much and I have to further test the behavior with > fringes. > > Maybe I find better solution. > > I attach a patch that does away with a frame's inhibit_horizontal_resize > and inhibit_vertical_resize slots. Please test it. If it works for > you, I'll install it on master. > > martin --000000000000f07d150629295591 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thank you for the patch and continued focus on this. The following is th= e behavior I see on NS with the patch applied with target width 1700 and he= ight 1000. These are results from clone-frame using text-pixels which I'= ;ve included below without explicit pixelwise argument so it respects frame= -resize-pixelwise.

Note: frame-inhibit-implied-resize=3D(tab-bar-lines) is the default s= etting on NS:

#if defined (USE_GTK) || defined (HAVE_NS)
=C2=A0 frame_inhibit_implied= _resize =3D list1 (Qtab_bar_lines);

frame-resize-pixelwise=3Dnil frame-inhibit-impli= ed-resize=3Dnil text-width=3D1692 (=CE=94-8) text-height=3D984 (=CE=94-16) = native-width=3D1727 (=CE=94-8) native-height 988 (=CE=94-16)

Result: respects lines/cols= as expected.

frame-resize-pixelwise=3Dt frame-inhibit-implied-resiz= e=3D(tab-bar-lines) text-width=3D1700 (=CE=940) text-height=3D1000 (=CE=940= ) native-width=3D1735 (=CE=940) native-height 1004 (=CE=940)

Result: Okay by accident, I= think, only because tab-bar-lines parameter is nil during adjust_frame_hei= ght invocations?

frame-resize-pixelwise=3Dt frame-inhibit-implied-re= size=3Dnil text-width=3D1700 (=CE=940) text-height=3D1000 (=CE=940) native-= width=3D1735 (=CE=940) native-height 1004 (=CE=940)

Result: Okay but with frame-inhibit-= implied-resize nil, I'd have expected rows/cols vs. pixelwise.

f= rame-resize-pixelwise=3Dt frame-inhibit-implied-resize=3Dt text-width=3D168= 5 (=CE=94-15) text-height=3D1000 (=CE=940) native-width=3D1720 (=CE=94-15) = native-height 1004 (=CE=940)

Result: I think this case remains broken needin= g=C2=A0the adjustment from your first patch that=C2=A0you wanted to also ac= count for fringes?

My default GUI setup is frame-resize-pixelwise t frame-inhibit-implie= d-resize t as I expect many people have adopted these days.

(defun my/clone-frame (&= optional frame no-windows pixelwise)
=C2=A0 "Make a new frame with = the same parameters and windows as FRAME.
With a prefix arg NO-WINDOWS, = don't clone the window configuration.=C2=A0 When
PIXELWISE is non-ni= l or if `frame-resize-pixelwise' is non-nil, and frame
is not text-o= nly, clone the 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 th= e new frame."
=C2=A0 (interactive (list (selected-frame) current-pr= efix-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 (fra= me-root-window frame))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(default-fram= e-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-param= eters 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 (push (cons 'width (cons 'text-pixels (frame-text-wi= dth frame)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 default-frame-ali= st)
=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 de= fault-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= -graphic-p frame)
=C2=A0 =C2=A0 =C2=A0 (select-frame new-frame))
=C2= =A0 =C2=A0 new-frame))

On Fri, Dec 13, 2024 = at 5:30=E2=80=AFAM martin rudalics <r= udalics@gmx.at> wrote:
=C2=A0>=C2=A0 > That patch works to address make-frame&= #39;s respect for text-pixels, at least
=C2=A0>=C2=A0 > on NS (the only platform I tested).
=C2=A0>
=C2=A0> I don't like it much and I have to further test the behavior= with fringes.
=C2=A0> Maybe I find=C2=A0 better solution.

I attach a patch that does away with a frame's inhibit_horizontal_resiz= e
and inhibit_vertical_resize slots.=C2=A0 Please test it.=C2=A0 If it works = for
you, I'll install it on master.

martin
--000000000000f07d150629295591--