aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Rudalics2022-01-20 10:30:08 +0100
committerMartin Rudalics2022-01-20 10:30:08 +0100
commitef0c1d4c2c8eefe599f50bc99b3dd088433a2842 (patch)
treeceff305fa401fbc6559616e165d7c968f7f82f3c
parentf393d0d441c3746f98007ae54341870a296bf809 (diff)
downloademacs-ef0c1d4c2c8eefe599f50bc99b3dd088433a2842.tar.gz
emacs-ef0c1d4c2c8eefe599f50bc99b3dd088433a2842.zip
Add workaround to handle a problem with Enlightenment WM (Bug#53298)
* src/xterm.c (handle_one_xevent): Handle setting of variable 'x_set_frame_visibility_more_laxly' when receiving an Expose or FocusIn event (Bug#53298). (Qexpose): Define symbol. (x_set_frame_visibility_more_laxly): New Lisp variable. * etc/PROBLEMS: Mention frame redraw problem with the Enlightenment WM and 'x-set-frame-visibility-more-laxly' workaround.
-rw-r--r--etc/PROBLEMS7
-rw-r--r--src/xterm.c69
2 files changed, 56 insertions, 20 deletions
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index eb685e5bfb5..e48ce5a8b0c 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -1269,6 +1269,13 @@ and then Alt-F7). A bug for it is here:
1269https://bugs.launchpad.net/ubuntu/+source/metacity/+bug/231034. 1269https://bugs.launchpad.net/ubuntu/+source/metacity/+bug/231034.
1270Note that a permanent fix seems to be to disable "assistive technologies". 1270Note that a permanent fix seems to be to disable "assistive technologies".
1271 1271
1272*** Enlightenment: Frames not redrawn after switching virtual desktops
1273
1274With Enlightenment version 0.25, Emacs frames may no be redrawn orderly
1275after switching back from another virtual desktop. Setting the variable
1276'x-set-frame-visibility-more-laxly' to one of 'focus-in', 'expose' or
1277't' should fix this.
1278
1272*** Gnome: Emacs receives input directly from the keyboard, bypassing XIM. 1279*** Gnome: Emacs receives input directly from the keyboard, bypassing XIM.
1273 1280
1274This seems to happen when gnome-settings-daemon version 2.12 or later 1281This seems to happen when gnome-settings-daemon version 2.12 or later
diff --git a/src/xterm.c b/src/xterm.c
index b55a54b9451..b80d45f8552 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -8231,12 +8231,17 @@ handle_one_xevent (struct x_display_info *dpyinfo,
8231 if (!FRAME_VISIBLE_P (f)) 8231 if (!FRAME_VISIBLE_P (f))
8232 { 8232 {
8233 block_input (); 8233 block_input ();
8234 /* The following two are commented out to avoid that a 8234 /* By default, do not set the frame's visibility here, see
8235 plain invisible frame gets reported as iconified. That 8235 https://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00133.html.
8236 problem occurred first for Emacs 26 and is described in 8236 The default behavior can be overridden by setting
8237 https://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00133.html. */ 8237 'x-set-frame-visibility-more-laxly' (Bug#49955,
8238/** SET_FRAME_VISIBLE (f, 1); **/ 8238 Bug#53298). */
8239/** SET_FRAME_ICONIFIED (f, false); **/ 8239 if (EQ (x_set_frame_visibility_more_laxly, Qexpose)
8240 || EQ (x_set_frame_visibility_more_laxly, Qt))
8241 {
8242 SET_FRAME_VISIBLE (f, 1);
8243 SET_FRAME_ICONIFIED (f, false);
8244 }
8240 8245
8241 if (FRAME_X_DOUBLE_BUFFERED_P (f)) 8246 if (FRAME_X_DOUBLE_BUFFERED_P (f))
8242 font_drop_xrender_surfaces (f); 8247 font_drop_xrender_surfaces (f);
@@ -8824,26 +8829,33 @@ handle_one_xevent (struct x_display_info *dpyinfo,
8824 goto OTHER; 8829 goto OTHER;
8825 8830
8826 case FocusIn: 8831 case FocusIn:
8827#ifndef USE_GTK 8832#ifdef USE_GTK
8828 /* Some WMs (e.g. Mutter in Gnome Shell), don't unmap 8833 /* Some WMs (e.g. Mutter in Gnome Shell), don't unmap
8829 minimized/iconified windows; thus, for those WMs we won't get 8834 minimized/iconified windows; thus, for those WMs we won't get
8830 a MapNotify when unminimizing/deconifying. Check here if we 8835 a MapNotify when unminimizing/deiconifying. Check here if we
8831 are deiconizing a window (Bug42655). 8836 are deiconizing a window (Bug42655).
8832 8837
8833 But don't do that on GTK since it may cause a plain invisible 8838 But don't do that by default on GTK since it may cause a plain
8834 frame get reported as iconified, compare 8839 invisible frame get reported as iconified, compare
8835 https://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00133.html. 8840 https://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00133.html.
8836 That is fixed above but bites us here again. */ 8841 That is fixed above but bites us here again.
8837 f = any; 8842
8838 if (f && FRAME_ICONIFIED_P (f)) 8843 The option x_set_frame_visibility_more_laxly allows to override
8839 { 8844 the default behavior (Bug#49955, Bug#53298). */
8840 SET_FRAME_VISIBLE (f, 1); 8845 if (EQ (x_set_frame_visibility_more_laxly, Qfocus_in)
8841 SET_FRAME_ICONIFIED (f, false); 8846 || EQ (x_set_frame_visibility_more_laxly, Qt))
8842 f->output_data.x->has_been_visible = true;
8843 inev.ie.kind = DEICONIFY_EVENT;
8844 XSETFRAME (inev.ie.frame_or_window, f);
8845 }
8846#endif /* USE_GTK */ 8847#endif /* USE_GTK */
8848 {
8849 f = any;
8850 if (f && FRAME_ICONIFIED_P (f))
8851 {
8852 SET_FRAME_VISIBLE (f, 1);
8853 SET_FRAME_ICONIFIED (f, false);
8854 f->output_data.x->has_been_visible = true;
8855 inev.ie.kind = DEICONIFY_EVENT;
8856 XSETFRAME (inev.ie.frame_or_window, f);
8857 }
8858 }
8847 8859
8848 x_detect_focus_change (dpyinfo, any, event, &inev.ie); 8860 x_detect_focus_change (dpyinfo, any, event, &inev.ie);
8849 goto OTHER; 8861 goto OTHER;
@@ -13779,4 +13791,21 @@ gtk_window_move to set or store frame positions and disables some time
13779consuming frame position adjustments. In newer versions of GTK, Emacs 13791consuming frame position adjustments. In newer versions of GTK, Emacs
13780always uses gtk_window_move and ignores the value of this variable. */); 13792always uses gtk_window_move and ignores the value of this variable. */);
13781 x_gtk_use_window_move = true; 13793 x_gtk_use_window_move = true;
13794
13795 DEFSYM (Qexpose, "expose");
13796
13797 DEFVAR_LISP ("x-set-frame-visibility-more-laxly",
13798 x_set_frame_visibility_more_laxly,
13799 doc: /* Non-nil means set frame visibility more laxly.
13800If this is nil, Emacs is more strict when marking a frame as visible.
13801Since this may cause problems on some window managers, this variable can
13802be also set as follows: The value `focus-in' means to mark a frame as
13803visible also when a FocusIn event is received for it on GTK builds. The
13804value `expose' means to mark a frame as visible also when an Expose
13805event is received for it on any X build. The value `t' means to mark a
13806frame as visible in either of these two cases.
13807
13808Note that any non-nil setting may cause invisible frames get erroneously
13809reported as iconified. */);
13810 x_set_frame_visibility_more_laxly = Qnil;
13782} 13811}