From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#65217: 29.1; set-frame-size gets confused and drops calls Date: Thu, 17 Aug 2023 18:44:32 +0200 Message-ID: <47724cb8-8448-e210-621f-9c3883bdc0ca@gmx.at> References: <3444890c-9111-5785-e683-8a2119e624b6@catgirl.ai> <83sf8i578j.fsf@gnu.org> 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="23158"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65217@debbugs.gnu.org To: Eli Zaretskii , Ash Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 17 18:45:19 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 1qWg7b-0005ni-0k for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Aug 2023 18:45:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWg7M-0003mW-Tf; Thu, 17 Aug 2023 12:45: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 1qWg7K-0003m9-Iq for bug-gnu-emacs@gnu.org; Thu, 17 Aug 2023 12:45:02 -0400 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 1qWg7K-0005zr-97 for bug-gnu-emacs@gnu.org; Thu, 17 Aug 2023 12:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qWg7J-00063s-Q8 for bug-gnu-emacs@gnu.org; Thu, 17 Aug 2023 12:45:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Aug 2023 16:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65217 X-GNU-PR-Package: emacs Original-Received: via spool by 65217-submit@debbugs.gnu.org id=B65217.169229068723264 (code B ref 65217); Thu, 17 Aug 2023 16:45:01 +0000 Original-Received: (at 65217) by debbugs.gnu.org; 17 Aug 2023 16:44:47 +0000 Original-Received: from localhost ([127.0.0.1]:45427 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qWg75-00063A-0k for submit@debbugs.gnu.org; Thu, 17 Aug 2023 12:44:47 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:47857) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qWg70-00062s-GJ for 65217@debbugs.gnu.org; Thu, 17 Aug 2023 12:44:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.at; s=s31663417; t=1692290673; x=1692895473; i=rudalics@gmx.at; bh=NbpdRnx3SuWkJSOdqCb1WKMV1uVaemvb292dxn0/mwM=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=AzasfVikGSV35FAijWMN0KBIERjinp+ZtkO1/IHcrzRucCTEpS8U3ri65W0QSSYIn6jYcKE O3t79w3dxSeOdpLAjqrVGHzm1zmKNp1vhTJaE9o88lEjafe4pvd40pyqRilA2gLpzuIJ9xx4b 4duj1Qt/ocr96LNa+A28IVlj9yhGRX62rOU3qRY9d0ALE7POmggZ11VwAs66GvftfxIInSFs2 RnyltrdIlemDbK8gBmAs/KmmvE7wDeh53QgL8RMkCQB/UngZwLX9Xg0ldjR0HyXx4cYecObVz L5CIuKnGejK/oMyPzj42YAL/0zN5wNOnkyZxaKy46W2yMD9TvFZg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from [192.168.1.100] ([46.125.249.16]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MD9X9-1qfmue350b-009Acm; Thu, 17 Aug 2023 18:44:33 +0200 Content-Language: en-US In-Reply-To: <83sf8i578j.fsf@gnu.org> X-Provags-ID: V03:K1:K8CLV0gaixAabMB7Zs2cxkUThN6h7g9e8zKfRZU2CVxERxMc3uX Dzh+T/nXkUwPOLz3WUmut4gP9PE84gXjMRtIcYeBpP27CCGw8Rc12EMHqddMpFA5d5lHHv3 XjMSR1IxWFdZFHDlsI+FuVX9xEUprMwsAXffFNa8AM+dNzdx/DuzqprfnEtEGiM6ludxO6Q ovsljVPeG7xetoZpv5YTQ== UI-OutboundReport: notjunk:1;M01:P0:tr+sEtl0Kug=;RQkgwCtJKQA8v+dPM0dYUJVfcBk gJNZ08A+WJmb4SGjAzsZtDOoqkv8KudOWUMolLG1HteophQKFUBfYr/vcD8KLIpD8AQjHDLIW PpvXpjpRF7kQnfeT/Vl2szVwifaYjKUOe98xs7mKwbMkKRJpcflfP1jdn2uSQw3r4NS4Dtiyy 1U2PEP8mdDaw7jUpNSxDxBzBOIMCehhszz2OkZhuuwzQTaztn/J7GtmAkmHEvdUw3f/hqPJTv RD8ki0aU/lfaaXxmUxjPXxvWOTF4orLk3qW0su+0JQnyTfnFQnqVn7SWUtyiTsoGj3WTQG4Z0 LJiF2xbB5xQrT4VOFhpKrUQUi4bVjBUolKu8PAzn7cQgtZ0peR9TcO9GL6/ndDwONQUj6wq9/ mI8A6Fx2Hj9IonQhfhulRZYMghGvwxPhvG5rZ1GD7GfldZa7gxYHbUeyNT0WMGz4NsKNhYain CnEGNeL2H75dSf7Ei/qK0EU8UO0CSLG0TL2VPVdXe9niFe33EiWhclfIo2ZR3OtLGwxrvWSef TBnWJhqSHxLpgc6vRIuNb3pvojcyQxKfGlSBQrGGcB02H4PrtjBBoz3SseDoaZVtIGDhfMDA5 KxjT4l2FhU/K3B2iaQ8N5gORZfQKZvNlhE7QNHvzkrEZVr8uZ0wt7HBxfkUW9XrtcrbYPEevf 9OkfBpOEz+YR3yxpe7JLkCNDEvcFEuPtUysY8iyaBerfj2kJukhlUNP0wLE4cr3GbVdUNbihV w5+8GLdkuB1OG8+qr+NriCq6uoNceFtCJBqqz7N/mGH1wLjv0n4SGgflo53faDI7qq0OA5OT 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:267678 Archived-At: >> (setq my/frame >> >> (make-frame `((left . 500) >> (top . 5) >> (width . 20) >> (height . 20) >> (parent-frame . ,(selected-frame))))) >> >> (defun my/twiddle (width height) >> (set-frame-size my/frame 10 10) >> (set-frame-size my/frame width height) >> (message (format "%s %s" (frame-width my/frame) (frame-height >> my/frame)))) >> >> >> Then (my/twiddle 20 20). > > Martin, any comments or ideas? Many. Basically it's a bad idea to do the above. Setting up one size, changing it to another one and then back to the initial one ... But both 'set-frame-size' calls might be hidden in larger functions and so the above can be seen as some kind of abstraction of a larger idea. What happens is that the (set-frame-size my/frame 10 10) has not been yet processed by us at the time we run (set-frame-size my/frame 20 20): Obviously so, since we run Lisp and do not process any configure events in between. This means that the if (outer_width != gwidth || outer_height != gheight) check in gtkutil.c's xg_frame_set_char_size will tell that the window already has the desired size and we do not send a second gtk_window_resize request. In fact, when replacing the above line by if (true) // outer_width != gwidth || outer_height != gheight) the second request is processed and everything looks OK. Now that check is not utterly necessary but omitting it might, if child frames should be hidden during resizing, provoke flickering. Such flickering can be already seen here with a Lucid build when running my/twiddle (otherwise Lucid handles everything as expected). In the case at hand it's normal, but if the frame should not change size, it should be ideally avoided. Unfortunately, the story does not end here. Suppose I do (setq my/frame (make-frame `((left . 500) (top . 5) (width . 20) (height . 20)))) (defun my/twiddle (width height) (set-frame-size my/frame 10 10) (set-frame-size my/frame width height) (sit-for 0) (message (format "%s %s" (frame-width my/frame) (frame-height my/frame)))) (my/twiddle 20 20) instead, that is my/frame is shown in a completely normal top-level window. In this case, the second resize request apparently gets ignored (likely in gtk_window_move_resize but the real cause might be nested somewhere else in the depths of GTK) and I get 10 as final width and height which are also reported as such. Again, Lucid has no problem processing this scenario as expected. As a final note, putting a (sit-for 0) in between the two 'set-frame-size' calls so that the configure event gets processed in between, fixes both scenarios on GTK builds here. Hence, many comments but few good ideas. It would be interesting, however, whether others can observe different behaviors with these set-ups. Thanks for your attention, martin