From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74750: clone-frame and make-frame pixelwise issues Date: Tue, 10 Dec 2024 16:56:22 +0100 Message-ID: References: <861pyfd8pe.fsf@gnu.org> Reply-To: martin rudalics Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12928"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 74750@debbugs.gnu.org To: Eli Zaretskii , Ship Mints Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 10 16:57:17 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 1tL2bt-0003CJ-CV for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 10 Dec 2024 16:57:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tL2bh-000741-NP; Tue, 10 Dec 2024 10:57:05 -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 1tL2be-00073c-Na for bug-gnu-emacs@gnu.org; Tue, 10 Dec 2024 10:57: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 1tL2be-0003RO-DL for bug-gnu-emacs@gnu.org; Tue, 10 Dec 2024 10:57:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:From:References:MIME-Version:Date:To:Subject; bh=xRTyR34L2HnrNXlF/s41l/FQR1+4+qWIEoSJIQ1//hY=; b=nxZMDEYG5ELh2dyDtUleyu4hBEfNTJKjTg6D/5BUw6DqPcwHTGHRL8+tZPS4UTjnEy62+Dvd1vNFYUD1vjslmtOFKE6Lk8ceZx4cntonCu3XBr624U+1rLf5eE+mE8Hw/zwPMA5yPSJkIZ/8oB/KE9pTqNe4HZCzJJ+Bjdn6ubeZ0CnNaUafU8UbQ7VyFelxX3SgyPhQ1RWb19WGKfH9kysEsfg3f6u3OO0uuoqgDaZ0TYNP2PXRE+pRkCJod3Iz6oZ3476MOy0N3pSvx4HvM0OsFWptlK4xgKl68laj6HKFfx9ajG05gj1ivQuovh5z343PaLYS3V66k4CkLb4zPQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tL2be-0000Tr-88 for bug-gnu-emacs@gnu.org; Tue, 10 Dec 2024 10:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 10 Dec 2024 15:57: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.17338461951792 (code B ref 74750); Tue, 10 Dec 2024 15:57:02 +0000 Original-Received: (at 74750) by debbugs.gnu.org; 10 Dec 2024 15:56:35 +0000 Original-Received: from localhost ([127.0.0.1]:59183 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tL2bC-0000Sp-TE for submit@debbugs.gnu.org; Tue, 10 Dec 2024 10:56:35 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]:54805) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tL2bA-0000SX-OJ for 74750@debbugs.gnu.org; Tue, 10 Dec 2024 10:56:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at; s=s31663417; t=1733846186; x=1734450986; i=rudalics@gmx.at; bh=xRTyR34L2HnrNXlF/s41l/FQR1+4+qWIEoSJIQ1//hY=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To:Cc: References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=nP2SATGwP6mNbNtHkTDEpGOniftEMU/co7u26aBV+xSOftpqFTfgNPfsuE3vzmuh Xm9RPTwqkWclvAPGAZviwylU088feuRPtW9PN6GLPTFcC7tB6aNl6eEFWGuYEtehN Y1Gl+Zz+eDlFdMfzuQCKNyqD/y4/WSX9cW70xPioHroyhTsMQkJ1wXfQdX0cceU6j Ra+9VhxzUro10WpvDnRtdb2FXLf6jCB77R+S6h7SfQyxDbeDESNgFC1HY/sjCR0lJ SqAwvMaQ2xagE05qbCEZpNoqn1RmAcn6mS/vimD/POaJD/kq4fMvzrn0CoWMlJ7Lr hLJlL1zwN07qxq2PUg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from [192.168.31.113] ([212.95.5.34]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M9nxt-1tI1vj1rU5-004R3P; Tue, 10 Dec 2024 16:56:26 +0100 Content-Language: en-US In-Reply-To: <861pyfd8pe.fsf@gnu.org> X-Provags-ID: V03:K1:u5JbuHagNpQbrNLTWh0aP0XKEcPVf4FwxZI2RWPflx/SswojEZ9 TDQ2AbdLdI/r5C2jVaukPUkz5Jz6a2KNDi64rG7tyixrRfTR0TMuhgKYYFIkYDnUEYp8ofz OXoa08UU0HurljU48naUtaR/H0yUf2bNR4r564qrAiBX3w4MAjwrGbisOkZIeSSQUuViZ7k gMnm9tmf21/oYfvVQ0dFQ== UI-OutboundReport: notjunk:1;M01:P0:wmtaMinphKM=;wph1KCnrKSPCjNe6MDfFB3LRXoV P7emTqBmRUfNZymFrXFjjGRO7qr12k4PFpKslhP9vJINB4pL30X5ro8kmZipbC0TXFg9mEDW0 n8lXdGwwtm4XhJz62iMDSnSiRKoKbFh2S8syzb51ki9p6wWkrNcdsEaioRZAWnumfbxtbipFp cIzijCb2/vhzDJrIIhdYX7ewBwMvZbp1+9xj6NBO9fWgcQpucRKylCnvQB5rfHuPc1jaPM7Yc k5jWW9/v2PFfYtbbD0pxMSpBfOZCZZ1XuaRGY5qEFtH3Lzk5zyC882Br70dc4N14SWURFxopx 0HmGyRa19jO3s2J/5/EQNyB9ZRszbIV6V9T+tK76t5auJIW0RzB6SNvDBFKTFB9jA0gZAKK6j KwhkCJc5bO8MciHnZozNVxWzpvYejo9vlbEqhzLrhRvbXNX4poc+TwBYxH65OYaAA/biaOv1G XbxJRv/YI7pORo+RDfDe/VwCmKM2T0YxFX04hsaCxVGIF6FXJOaklhikNkoPBh51nMKUc6FOC S0LPb2wkRsquBWecpU0xh1KCMaz3beeRAuL/cAIQsEiXh/B1j3uCmgfGxT9VJOxgJObUXQfC2 JwVmNJrsyag0zJCrHonueCUXCT/mDVhr9T6dXgYIPSDgfRdrv7EZrcGfNdCjQq5Xx3zJx2RDc yjzWV2uNo5+YC96qOfd2S27aNcmGAPDoIUoEMjuQw8CP9kQf/PrA4onARYbCiwWD764WVotkD os9H3tDJD0KLkdbrfgk9h5DF0LCp3LGVfTSRKumwDN/GT8XTnULDU9R+7Yc9Qh1f4loX8EiG 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:296764 Archived-At: >> 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. This would be a bug in frameset.el. One problem I see is that 'frame-resize-pixelwise' must be set "very early" when restoring a session - at least _before_ the first time we send size hints to the window manager. >> 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. Your code binds 'frame-resize-pixelwise' temporarily. This cannot work reliably. That variable should never change in an Emacs session because its value affects the way we send size hint increments to the window manager. This is, admittedly, a design error that would have to be fixed as follows: - Implement a new frame parameter 'resize-pixelwise'. - Send size hints according to the value of this parameter. When the parameter is set, new size hints must be sent. Alternatively, we could send new size hints for all live frames whenever 'frame-resize-pixelwise' is changed. This would have to be done with a variable watcher. Still, let-binding this variable would confuse the hell out of our interactions with the window manager. When the scope of the let-binding is left, we would have to send size hints again. >> 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) What would the WM do in a situation where PIXELWISE is non-nil and 'frame-resize-pixelwise' is nil? martin