emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 d9e1605122b: Correctly register focus events concomitant with a


From: Po Lu
Subject: emacs-29 d9e1605122b: Correctly register focus events concomitant with alpha changes
Date: Mon, 16 Oct 2023 20:33:56 -0400 (EDT)

branch: emacs-29
commit d9e1605122b4ba70a55f7b168505b7d7f8d2bdd6
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Correctly register focus events concomitant with alpha changes
    
    * src/xterm.c (x_frame_highlight, x_frame_unhighlight): Skip
    changing the frame alpha when the frame is not eligible for
    focus state-specific alpha values; otherwise, the alpha might be
    reset by the time a alpha change wrought by a focus change
    arrives, impeding handle_one_xevent from subsequently restoring
    the initial value.  (bug#66398)
---
 src/xterm.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index 709705fc19e..6f335ea11da 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -11487,7 +11487,9 @@ x_frame_highlight (struct frame *f)
   x_stop_ignoring_errors (dpyinfo);
   unblock_input ();
   gui_update_cursor (f, true);
-  x_set_frame_alpha (f);
+
+  if (!FRAME_X_OUTPUT (f)->alpha_identical_p)
+    x_set_frame_alpha (f);
 }
 
 static void
@@ -11511,7 +11513,15 @@ x_frame_unhighlight (struct frame *f)
   unblock_input ();
 
   gui_update_cursor (f, true);
-  x_set_frame_alpha (f);
+
+  /* Eschew modifying the frame alpha when the alpha values for
+     focused and background frames are identical; otherwise, this will
+     upset the order in which changes to the alpha property
+     immediately subsequent to a focus change are propagated into a
+     frame's alpha property.  (bug#66398) */
+
+  if (!FRAME_X_OUTPUT (f)->alpha_identical_p)
+    x_set_frame_alpha (f);
 }
 
 /* The focus has changed.  Update the frames as necessary to reflect



reply via email to

[Prev in Thread] Current Thread [Next in Thread]