From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tobias Bading Newsgroups: gmane.emacs.bugs Subject: bug#63312: 29.0.90; set-frame-parameter sometimes called with dead frame when quitting ediff Date: Sat, 6 May 2023 12:10:33 +0200 Message-ID: <04798b34-f836-f889-88e7-2308229b5ff3@web.de> References: <838re1hk45.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6504"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Cc: 63312@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 06 12:11:14 2023 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 1pvEsk-0001Yv-OX for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 May 2023 12:11:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvEsa-0007H1-Aw; Sat, 06 May 2023 06:11:04 -0400 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 1pvEsZ-0007Gd-0y for bug-gnu-emacs@gnu.org; Sat, 06 May 2023 06:11:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pvEsY-0004Fz-P2 for bug-gnu-emacs@gnu.org; Sat, 06 May 2023 06:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pvEsY-00007W-GG for bug-gnu-emacs@gnu.org; Sat, 06 May 2023 06:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tobias Bading Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 May 2023 10:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63312 X-GNU-PR-Package: emacs Original-Received: via spool by 63312-submit@debbugs.gnu.org id=B63312.1683367844430 (code B ref 63312); Sat, 06 May 2023 10:11:02 +0000 Original-Received: (at 63312) by debbugs.gnu.org; 6 May 2023 10:10:44 +0000 Original-Received: from localhost ([127.0.0.1]:59481 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvEsG-00006q-49 for submit@debbugs.gnu.org; Sat, 06 May 2023 06:10:44 -0400 Original-Received: from mout.web.de ([217.72.192.78]:54825) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvEsB-00006V-Ul for 63312@debbugs.gnu.org; Sat, 06 May 2023 06:10:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1683367833; i=tbading@web.de; bh=rOi+3yc1b+Lh5VWt4Tbz9hUnX1GX7nQvqH/ykniqTdg=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=lukiIEJuEdaanB61qy44IB25dpUbEY5og5Bam5Ki1H7c5AK9oGuNKDciwGg9tsMoR a5bExRtIrQgS+iIgzGZQya2X97Rk5qBm4jS7Lhv/LOz4qilyQr+CVr6Ef0Jy6Am1d2 qFYNhySbHYlcpvV0YBhl3Twi7QQTAYusTCA+k0wSvJf3oshRyrCnTflBHKf6+0JuvX JSrqBXW/eVRODEzzw1KVrUlkSYKNk+2EffaMkXzUsk/f20qHrLa9dPLtUYxcsUJUR2 GpxbOsXRp3C3g4coE7FDomkTboe4lLpJ3h/26E2mPFwn3XtYqHXAESwmBeXpKblcHK 5eVf4tu0IT/Hg== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Original-Received: from [192.168.2.103] ([84.143.156.171]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1N1d7i-1qO18T35Wi-011yf3; Sat, 06 May 2023 12:10:33 +0200 Content-Language: en-US In-Reply-To: <838re1hk45.fsf@gnu.org> X-Provags-ID: V03:K1:1Q6p/3sQ5ZWXVH8vro6ESU6SEo04ZApSLDXdvbjpzZOmTS7N3du k23sUQZcsXY5i1uD89sGPIFOcv4mxaqBTJt1ntYpyHvsG/KXLyYCgjA+aDecwR5qZU9DER6 pmCe2rxJUO7niYt9rt8zWPFYouorMAyVnAdQpAt4kilZtgijuUtinR27k5lQ96i7p/V3sbr nF6WaMpeK3hqQnQymixoA== UI-OutboundReport: notjunk:1;M01:P0:PwqooIpcVPA=;ZE3rjAY7qrvVhrhMgQ2lvBX5aPn b0e+it8dHpOhK7sIDViYhiwaRlUeZzIlyAJdQ2ratBIpY8VlFzfk6SZyQ8i4qVqV8Evq/UBS4 f8oA5BMpJWnR4uy3IDWcqP2g7SGC2A53H1e2xLOtlPf5ZDYT4nUVYMDLLwLhiSDodSfvt2IBN 0Mfs6rXli6WfnJ8ePj0GYMuZsV7ah2gFBXTuTCKGXGfXTJ78lEOcdj/DVx1YdhhQ7UOiOhtnP O6gq0oXshhLgUqHCPbiKjD+/VjiLgIg+gTr2c6ThDGuMTOBGPEkH0eD7CqhYJ+VCyv9qm5u5T AAV96z3Gy7ocCrLOSkoLXWgjMApC6HnXRYhsAqHDOFcz69JLDOf/J1F58xb8vIqI0enaFgTYT g1OrHU4d3IfYQOJ3zIYaEgDOx6mPN8H4+Rwz17sV+fL7dKoMeb/WGoLGCJcxEL2sH+UtxA0Er 158tBPgKI2jZzk0FsSBgq36KMMze3YdT6VbAi6pTHlqmavQiYCy8pbzXjygLk1hRtKNvzvbrR 1IyWUW60RTVvy8aF/I5v+I0uYDL5kcAE/Pdap0KWPFIs10xn5Ptc36vIrUo0cgegyAFOZW5FC ZVBmA3g3IBMOUAcadXRrf7yE2b7XKEjBCD2Ewl+5v4fhftFXSZnUS/dJKq+t6XZaPKAXcNB7k TrjU4t4HsIviP20rPpGLK4P4BhgOle9s8mOjHFqnFoVc1eCuBFGtVpPjxu06Xhav+rdPQzEOK PTMWRhrS+hR0dGKotAB4ZruFr2D0wACXgb/tW+UX2EzMARgIMYvslGaDVFNCxWZjlKlFpOlW 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:261175 Archived-At: > Does the patch below give good results? > > diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el > index 9286a18..acfbbed 100644 > --- a/lisp/x-dnd.el > +++ b/lisp/x-dnd.el > @@ -609,8 +609,9 @@ x-dnd-init-xdnd-for-frame >=C2=A0 (defun x-dnd-after-move-frame (frame) >=C2=A0=C2=A0=C2=A0 "Handle FRAME moving to a different position. >=C2=A0 Clear any cached root window position." > -=C2=A0 (set-frame-parameter frame 'dnd-root-window-position > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 nil)) > +=C2=A0 (and (frame-live-p frame) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (set-frame-parameter frame 'dnd-ro= ot-window-position > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 nil))) > >=C2=A0 (add-hook 'move-frame-functions #'x-dnd-after-move-frame) It probably would, because for testing purposes I already patched handle-move-frame like this: diff --git a/lisp/frame.el b/lisp/frame.el index bf984da0d6..d6ca63ce53 100644 =2D-- a/lisp/frame.el +++ b/lisp/frame.el @@ -237,11 +237,16 @@ handle-focus-out =C2=A0(defun handle-move-frame (event) =C2=A0=C2=A0 "Handle a move-frame event. =C2=A0This function runs the abnormal hook `move-frame-functions'." =C2=A0=C2=A0 (interactive "e") =C2=A0=C2=A0 (let ((frame (posn-window (event-start event)))) -=C2=A0=C2=A0=C2=A0 (run-hook-with-args 'move-frame-functions frame))) +=C2=A0=C2=A0=C2=A0 ;; make sure the frame is still alive (TODO) +=C2=A0=C2=A0=C2=A0 (if (frame-live-p frame) +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (run-hook-with-args 'move-fram= e-functions frame) +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (let ((inhibit-message t)) +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (message "FRAME IS ALREADY DEA= D: %s" frame)) +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ))) Basically the same change, just one function higher and with a silent log message. This successfully suppresses the error and logs when the strange situation occurred. This looks like some race between Emacs and Compiz or something. Sometimes it occurs, sometimes it doesn=E2=80=99t. handle-move-frame should probably= not get triggered at all if the frame is already dead. So far I didn=E2=80=99t fin= d the C function doing this, but I didn=E2=80=99t look that hard because I have a = few other minor problems that might be related: I need (ediff-control-frame-upward-shift -20) to properly align the ediff control frame with the main frame. Also, starting Emacs with -geometry and fiddling with left/top/width/height in default-frame-alist and initial-frame-alist doesn=E2=80=99t give the same results as with Emacs 26= .3. Something fishy is going on and probably related to the fact that I=E2=80= =99m using a 4K monitor and thus HiDPI scaling is in play. Might be another case of a missing conversion between GTK application pixels and device pixels somewhere. Such a misinterpretation (or rounding error) of pixel positions and/or sizes may trigger the handle-move-frame, which in itself doesn=E2= =80=99t make much sense when a frame is being destroyed.