[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 0600065ff2 1/2: Fix error trapping in x_focus_frame
From: |
Po Lu |
Subject: |
master 0600065ff2 1/2: Fix error trapping in x_focus_frame |
Date: |
Tue, 15 Nov 2022 22:19:37 -0500 (EST) |
branch: master
commit 0600065ff276d5c55c3ff2f466dfbce74586164f
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Fix error trapping in x_focus_frame
* src/xterm.c (x_focus_frame): Improve commentary. Dno not trap
errors around x_get_server_time.
---
src/xterm.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/src/xterm.c b/src/xterm.c
index 7a1fd6086c..d6ba532f16 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -27632,8 +27632,6 @@ x_focus_frame (struct frame *f, bool noactivate)
return;
}
- /* Ignore any BadMatch error this request might result in. */
- x_ignore_errors_for_next_request (dpyinfo);
if (NILP (Vx_no_window_manager))
{
/* Use the last user time. It is invalid to use CurrentTime
@@ -27651,15 +27649,24 @@ x_focus_frame (struct frame *f, bool noactivate)
&& !dpyinfo->x_focus_frame)
time = x_get_server_time (f);
+ /* Ignore any BadMatch error this request might result in.
+ A BadMatch error can occur if the window was obscured
+ after the time of the last user interaction without
+ changing the last-focus-change-time. */
+ x_ignore_errors_for_next_request (dpyinfo);
XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
RevertToParent, time);
+ x_stop_ignoring_errors (dpyinfo);
}
else
- XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
- /* But when no window manager is in use, we
- don't care. */
- RevertToParent, CurrentTime);
- x_stop_ignoring_errors (dpyinfo);
+ {
+ x_ignore_errors_for_next_request (dpyinfo);
+ XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
+ /* But when no window manager is in use, we
+ don't care. */
+ RevertToParent, CurrentTime);
+ x_stop_ignoring_errors (dpyinfo);
+ }
}
}