aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2023-10-17 08:33:25 +0800
committerPo Lu2023-10-17 08:33:25 +0800
commitd9e1605122b4ba70a55f7b168505b7d7f8d2bdd6 (patch)
treeb5aa8c1b37453c00f631d49c93d77a2f79060a64 /src
parent194e219825c378a25b7a2dbda0c77215ac5ab302 (diff)
downloademacs-d9e1605122b4ba70a55f7b168505b7d7f8d2bdd6.tar.gz
emacs-d9e1605122b4ba70a55f7b168505b7d7f8d2bdd6.zip
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)
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c14
1 files 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)
11487 x_stop_ignoring_errors (dpyinfo); 11487 x_stop_ignoring_errors (dpyinfo);
11488 unblock_input (); 11488 unblock_input ();
11489 gui_update_cursor (f, true); 11489 gui_update_cursor (f, true);
11490 x_set_frame_alpha (f); 11490
11491 if (!FRAME_X_OUTPUT (f)->alpha_identical_p)
11492 x_set_frame_alpha (f);
11491} 11493}
11492 11494
11493static void 11495static void
@@ -11511,7 +11513,15 @@ x_frame_unhighlight (struct frame *f)
11511 unblock_input (); 11513 unblock_input ();
11512 11514
11513 gui_update_cursor (f, true); 11515 gui_update_cursor (f, true);
11514 x_set_frame_alpha (f); 11516
11517 /* Eschew modifying the frame alpha when the alpha values for
11518 focused and background frames are identical; otherwise, this will
11519 upset the order in which changes to the alpha property
11520 immediately subsequent to a focus change are propagated into a
11521 frame's alpha property. (bug#66398) */
11522
11523 if (!FRAME_X_OUTPUT (f)->alpha_identical_p)
11524 x_set_frame_alpha (f);
11515} 11525}
11516 11526
11517/* The focus has changed. Update the frames as necessary to reflect 11527/* The focus has changed. Update the frames as necessary to reflect