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: Tue, 18 Jan 2022 08:29:08 +0100 Message-ID: <40e5420e-8de6-be61-28af-8ab9418a08ea@gmx.at> References: <87h7a4w57u.fsf@kallisti.us> <08309eaf-2abb-080e-9c55-573b330e7765@gmx.at> <20220116204410.e2vjlz3g4clrxg7q@stgulik> <20220117232351.35nwooltmbj3cvhv@stgulik> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------8F0A262BB96F38027CBECBC1" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14722"; 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 Tue Jan 18 08:59:59 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 1n9jPL-0003gE-8p for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Jan 2022 08:59:59 +0100 Original-Received: from localhost ([::1]:50808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n9jPJ-0000MD-Sl for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Jan 2022 02:59:57 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9iwN-0000tj-1j for bug-gnu-emacs@gnu.org; Tue, 18 Jan 2022 02:30:10 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55920) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n9iwM-0004Q4-OH for bug-gnu-emacs@gnu.org; Tue, 18 Jan 2022 02:30:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n9iwM-0003te-IM for bug-gnu-emacs@gnu.org; Tue, 18 Jan 2022 02:30: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, 18 Jan 2022 07:30:02 +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.164249096914913 (code B ref 53298); Tue, 18 Jan 2022 07:30:02 +0000 Original-Received: (at 53298) by debbugs.gnu.org; 18 Jan 2022 07:29:29 +0000 Original-Received: from localhost ([127.0.0.1]:48823 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9ivp-0003sT-Ce for submit@debbugs.gnu.org; Tue, 18 Jan 2022 02:29:29 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:36619) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9ivk-0003sC-Pa for 53298@debbugs.gnu.org; Tue, 18 Jan 2022 02:29:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1642490950; bh=L8a9A6dqwHKbWT9QxTYu91C2ohn9TBsiGKqVp7q4GG4=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=SEE/MjEWpnQcxoMRDfhFtVXUm7MKwH0ypvfG9PT5IgGgUI3e6XQGKUVBv6eb5Kd69 wHuHvV2F5b4ngeP0vGhWLygoYfaCYJxkx/g4zO0+2ThoaMmpKYGPRIUAZgNpT+yv1N dX4zvgCKr/t7IK6TBeIS9hWNeNAlQ9/0vDp2/HKw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.100] ([213.142.97.109]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MwQT9-1mIAT50yv7-00sPqj; Tue, 18 Jan 2022 08:29:10 +0100 In-Reply-To: <20220117232351.35nwooltmbj3cvhv@stgulik> Content-Language: en-US X-Provags-ID: V03:K1:MyhHAmtJYz0UxNhzcYBAspgGZCn+l3g67GSN0+WlOia6/OqNZiK HO7bYulSMFwzaDGO9ob+WG2ZWYTeLottBiOmXnDJU+1zBSGhyAkVfDZeRu+QoZLo3YrKB7J 2yajML7XN1Df2Eo/jTfBD/kKarQfeAjcSnO14Vx1vZEnpVt4qvzvT+ykLx4SHJP8eqJR4kp Uq94pTRl9HU88/uhWFm9w== X-UI-Out-Filterresults: notjunk:1;V03:K0:ybTnIAN9y5M=:rlqxF15GrqWrgi712OwyW0 ml5q//ynGOuyXrZ9F3AUt4oRJ6UmeKMyRsypRS3HgSGVGue+gekwWFjpRozxWlccOFVM3WJ8g 43Q6b2ZJDgiv7RVJB4h8PnrbDKi5L0lg5JGQdcS+5qMgV72RRRW9lIHtYQ/TE48iYArlP81LX R0tkLBfUOxrCNuRca9+fEBTLgevhh9NCMs+zd0vV7XMhSCjWMoHXM3duJTSfKCyPh12yP9wmZ AveFFniOd/x1zVY8nTFBB/LTHJ8CeELslUb4inqanegXH3gMeFwZFI5sK6XzP1z8uTEnj6Pxi DsS88fz1uihCTcBlYeCgqc8iK5rxmDG5TEsrpvBTO4VfAjvl2W3j5z2w1jZVtrM27md10tDgP BxMdZucB7vYHkN6fFdaXuWx1w7Brh9ti36PZNmE6qf9VFIYjr3gzQOAcyvjk7VT434Tc8MEmm /e7r6AEwQjM0fvfpYySX3L2JeZNCzHRUCsInCeUwENYr+BarUy/PNusIOAN6TIaNigNw0mMKZ CeQ084O4aT1b68hRA30TK5Us2GhIhDygsZKqGi4LmnYyHHeK/NxuhqT17X1hXzqhFocuohlGp BrxCm3gHBhWiN0zLni5bRMzxhefWY9mDJHGNSivZ0dw9aWVnSdViaQFwTyFZbPv48Vb06ovzB OBXT/KA6DIHRa3c4SZ16/o/VruPTDp/9dFt5KTHUwspvzHsB2sRecAbaN+P8TQM16MIreJadT OTytoPC1n8J/JuE2i8nH69InQbTrvoSxa+HUx79ZjhaDZSgfO/bz15UiUrhivc/jdec1zmm6 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:224493 Archived-At: This is a multi-part message in MIME format. --------------8F0A262BB96F38027CBECBC1 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit >> 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. > > Yep, this works. Thanks! Eli, is this OK to install on the release branch? It doesn't affect default behavior but leaves us a fire escape for this and similar cases. martin --------------8F0A262BB96F38027CBECBC1 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; } --------------8F0A262BB96F38027CBECBC1--