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#53298: 29.0.50; GTK3 frame stops updating Date: Mon, 17 Jan 2022 10:39:53 +0100 Message-ID: References: <87h7a4w57u.fsf@kallisti.us> <08309eaf-2abb-080e-9c55-573b330e7765@gmx.at> <20220116204410.e2vjlz3g4clrxg7q@stgulik> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------F41C44287D39A5A4DA8BA9EB" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28953"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 53298@debbugs.gnu.org To: Ross Vandegrift Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 17 10:41:23 2022 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 1n9OVv-0007Kw-8B for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 17 Jan 2022 10:41:23 +0100 Original-Received: from localhost ([::1]:50922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n9OVu-00087z-86 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 17 Jan 2022 04:41:22 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47988) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9OVg-00087L-60 for bug-gnu-emacs@gnu.org; Mon, 17 Jan 2022 04:41:09 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51866) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n9OVZ-0006wg-Vm for bug-gnu-emacs@gnu.org; Mon, 17 Jan 2022 04:41:07 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n9OVZ-0004yR-SK for bug-gnu-emacs@gnu.org; Mon, 17 Jan 2022 04:41:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 17 Jan 2022 09:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53298 X-GNU-PR-Package: emacs Original-Received: via spool by 53298-submit@debbugs.gnu.org id=B53298.164241241319052 (code B ref 53298); Mon, 17 Jan 2022 09:41:01 +0000 Original-Received: (at 53298) by debbugs.gnu.org; 17 Jan 2022 09:40:13 +0000 Original-Received: from localhost ([127.0.0.1]:44769 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9OUm-0004xC-IO for submit@debbugs.gnu.org; Mon, 17 Jan 2022 04:40:13 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:49709) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9OUk-0004ws-9n for 53298@debbugs.gnu.org; Mon, 17 Jan 2022 04:40:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1642412395; bh=dik/mXo98M3imZqrJde4fUjcmyS3+c1Jqh22Sv06nfo=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=FFj+GkZu56P3/PKrcELGimOA8I+IEmb0etU0h7kvM3LgED8gdz8g/DK7qRIpqN3FB Y+gARavsfTbMTIrO+h4ZHyiNCVYMYpAwVCLEhavbn7SV30hR/2dLK5xjbKJrl1tXVH dLSqrwg3TpBzUnsHgiIVcsJ5Hr1v/tD3obrr/QtY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.101] ([46.125.249.106]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MvbFs-1mIGCr2iH8-00sh4e; Mon, 17 Jan 2022 10:39:55 +0100 In-Reply-To: <20220116204410.e2vjlz3g4clrxg7q@stgulik> Content-Language: en-US X-Provags-ID: V03:K1:bKIUMW6jn+PedYNDdaRcRL1N+edv1b4nJYCnqgp3oexUn5QUjFV jw3ekwkWdLPncCHc6n+F4pJ7xCnzHsmPT1sIF8TO7meoGZz8ayy1ZROW3W0pEfusQYy2YOZ lAY8sIwjV6j58b3UDdC69xTuEfEE8gyfjnXs8i4z6C12kMGVl68dIRSo8V7xYmGJnwsNBP7 L0w8sg0iB2i9CWQrvzCBQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:ctz/hgib1fg=:6MJNXl1wKZT6LHwDNVQSlp Hp1xnTLNc8+wzIqKUnnIgT609v0XgOtPMmoBVQhxtnsQqZNmHc3t7pN5tnXU2pKF5rqK0rzOB RLAENDwPWmD6KFCzhUq3nHfIuyAeDQw4K3yuFaZNbX1N/18zy76SNY20eVEMmx2aM717EzYrf 2kbtV4Q6btuk45Wx2+bl5SglfWx4jSJB6aJ8Po7eYw10vpVXDLQ9JCn0f5ALiv5KgOQIB9hK+ wwtUDHiTYgYCA9YONklHWHz41ZckAEoCOi9wld+ggiLTWNygiP1Ff3yvNFz3OhFqSH/jeVBXD wg5/tFWuaIMKHzLFvsLIf4m0/jb6Klc40Zmg1vwxYUHfQm3YJqbkxnnNT7B4PZ6IjRWqRDULV xLfp6u4g4BwW3SO4RtPOqdIiEP6GAu6qYVkvcH7JO4bW8ougMGuESS2mKwUXMiRmybp3wT8/e AklOGg8V7qW6lovAM9oh3h4Ou8mMwaNqiOIjdjjkOqZM1+QZacdvT+SEbJHUFxznYz+BTkQaH PFUKvhICIqmu4LtgliT8QIz/oAJ/WvuvteUujA0MlNi5tfwni9c/XV+SPnsU9O3MjBVKFADmL lr5o25MkrppIcWYo7A4k7DPs278rvar6I2SxkSMxiEeWztDrjjpgRrapLOrk8TX5cEjW7RLgt EcP0ivK7W21RSseQv/bsGXu1MWQe8iFgXgHZyctXtiRwcHoQtpesZ+5NV2WaHR4vm4YpflNhg 4NvSpMBts7zD5sBaYPpjeZ/yXbFj8rsdspYi7tHEY3nWugUNPR6C0MFSl10+H3H9pS9kWBBC 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" Xref: news.gmane.io gmane.emacs.bugs:224430 Archived-At: This is a multi-part message in MIME format. --------------F41C44287D39A5A4DA8BA9EB Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit > No, that didn't help. Reverting 483c5e953c as suggested in #49955 does though. > I mucked with the revert a bit, the issue is skipping the the FocusIn handling > on GTK. > > The minimal working revert is below. Not sure if this is safe for the other > issue through. Thanks. I attach a diff against Emacs 28 for this. Can you try it? You would have to set the variable 'x-set-frame-visibility-more-laxly' to either 'focus-in' or 't' to see the effect. Thanks, martin --------------F41C44287D39A5A4DA8BA9EB Content-Type: text/x-patch; name="x-set-frame-visibility-more-laxly.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x-set-frame-visibility-more-laxly.diff" diff --git a/etc/PROBLEMS b/etc/PROBLEMS index eb685e5bfb..5271f3b4e9 100644 =2D-- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -1269,6 +1269,13 @@ and then Alt-F7). A bug for it is here: https://bugs.launchpad.net/ubuntu/+source/metacity/+bug/231034. Note that a permanent fix seems to be to disable "assistive technologies"= . +*** Enlightenment: Frames not redrawn after switching virtual desktops + +With Enlightenment version 0.25, Emacs frames may no be redrawn orderly +after switching back from another virtual desktop, see Bug#49955 and +Bug#53298. Setting the variable 'x-set-frame-visibility-more-laxly' to +one of 'focus-in', 'expose' or 't' should fix this. + *** Gnome: Emacs receives input directly from the keyboard, bypassing XIM= . This seems to happen when gnome-settings-daemon version 2.12 or later diff --git a/src/xterm.c b/src/xterm.c index b55a54b945..b80d45f855 100644 =2D-- a/src/xterm.c +++ b/src/xterm.c @@ -8231,12 +8231,17 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (!FRAME_VISIBLE_P (f)) { block_input (); - /* The following two are commented out to avoid that a - plain invisible frame gets reported as iconified. That - problem occurred first for Emacs 26 and is described in - https://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00133.html. = */ -/** SET_FRAME_VISIBLE (f, 1); **/ -/** SET_FRAME_ICONIFIED (f, false); **/ + /* By default, do not set the frame's visibility here, see + https://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00133.html. + The default behavior can be overridden by setting + 'x-set-frame-visibility-more-laxly' (Bug#49955, + Bug#53298). */ + if (EQ (x_set_frame_visibility_more_laxly, Qexpose) + || EQ (x_set_frame_visibility_more_laxly, Qt)) + { + SET_FRAME_VISIBLE (f, 1); + SET_FRAME_ICONIFIED (f, false); + } if (FRAME_X_DOUBLE_BUFFERED_P (f)) font_drop_xrender_surfaces (f); @@ -8824,26 +8829,33 @@ handle_one_xevent (struct x_display_info *dpyinfo, goto OTHER; case FocusIn: -#ifndef USE_GTK +#ifdef USE_GTK /* Some WMs (e.g. Mutter in Gnome Shell), don't unmap minimized/iconified windows; thus, for those WMs we won't get - a MapNotify when unminimizing/deconifying. Check here if we + a MapNotify when unminimizing/deiconifying. Check here if we are deiconizing a window (Bug42655). - But don't do that on GTK since it may cause a plain invisible - frame get reported as iconified, compare + But don't do that by default on GTK since it may cause a plain + invisible frame get reported as iconified, compare https://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00133.html. - That is fixed above but bites us here again. */ - f =3D any; - if (f && FRAME_ICONIFIED_P (f)) - { - SET_FRAME_VISIBLE (f, 1); - SET_FRAME_ICONIFIED (f, false); - f->output_data.x->has_been_visible =3D true; - inev.ie.kind =3D DEICONIFY_EVENT; - XSETFRAME (inev.ie.frame_or_window, f); - } + That is fixed above but bites us here again. + + The option x_set_frame_visibility_more_laxly allows to override + the default behavior (Bug#49955, Bug#53298). */ + if (EQ (x_set_frame_visibility_more_laxly, Qfocus_in) + || EQ (x_set_frame_visibility_more_laxly, Qt)) #endif /* USE_GTK */ + { + f =3D any; + if (f && FRAME_ICONIFIED_P (f)) + { + SET_FRAME_VISIBLE (f, 1); + SET_FRAME_ICONIFIED (f, false); + f->output_data.x->has_been_visible =3D true; + inev.ie.kind =3D DEICONIFY_EVENT; + XSETFRAME (inev.ie.frame_or_window, f); + } + } x_detect_focus_change (dpyinfo, any, event, &inev.ie); goto OTHER; @@ -13779,4 +13791,21 @@ syms_of_xterm (void) consuming frame position adjustments. In newer versions of GTK, Emacs always uses gtk_window_move and ignores the value of this variable. */); x_gtk_use_window_move =3D true; + + DEFSYM (Qexpose, "expose"); + + DEFVAR_LISP ("x-set-frame-visibility-more-laxly", + x_set_frame_visibility_more_laxly, + doc: /* Non-nil means set frame visibility more laxly. +If this is nil, Emacs is more strict when marking a frame as visible. +Since this may cause problems on some window managers, this variable can +be also set as follows: The value `focus-in' means to mark a frame as +visible also when a FocusIn event is received for it on GTK builds. The +value `expose' means to mark a frame as visible also when an Expose +event is received for it on any X build. The value `t' means to mark a +frame as visible in either of these two cases. + +Note that any non-nil setting may cause invisible frames get erroneously +reported as iconified. */); + x_set_frame_visibility_more_laxly =3D Qnil; } --------------F41C44287D39A5A4DA8BA9EB--