aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-11-16 10:37:14 +0800
committerPo Lu2022-11-16 10:37:14 +0800
commit0600065ff276d5c55c3ff2f466dfbce74586164f (patch)
treec641c4d30714eb8bb6b3c96f070b48c73d5d07ca /src
parentd2ba4538cb561b5f93f53c1088d55530f12bf483 (diff)
downloademacs-0600065ff276d5c55c3ff2f466dfbce74586164f.tar.gz
emacs-0600065ff276d5c55c3ff2f466dfbce74586164f.zip
Fix error trapping in x_focus_frame
* src/xterm.c (x_focus_frame): Improve commentary. Dno not trap errors around x_get_server_time.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 7a1fd6086cf..d6ba532f16e 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -27632,8 +27632,6 @@ x_focus_frame (struct frame *f, bool noactivate)
27632 return; 27632 return;
27633 } 27633 }
27634 27634
27635 /* Ignore any BadMatch error this request might result in. */
27636 x_ignore_errors_for_next_request (dpyinfo);
27637 if (NILP (Vx_no_window_manager)) 27635 if (NILP (Vx_no_window_manager))
27638 { 27636 {
27639 /* Use the last user time. It is invalid to use CurrentTime 27637 /* Use the last user time. It is invalid to use CurrentTime
@@ -27651,15 +27649,24 @@ x_focus_frame (struct frame *f, bool noactivate)
27651 && !dpyinfo->x_focus_frame) 27649 && !dpyinfo->x_focus_frame)
27652 time = x_get_server_time (f); 27650 time = x_get_server_time (f);
27653 27651
27652 /* Ignore any BadMatch error this request might result in.
27653 A BadMatch error can occur if the window was obscured
27654 after the time of the last user interaction without
27655 changing the last-focus-change-time. */
27656 x_ignore_errors_for_next_request (dpyinfo);
27654 XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), 27657 XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
27655 RevertToParent, time); 27658 RevertToParent, time);
27659 x_stop_ignoring_errors (dpyinfo);
27656 } 27660 }
27657 else 27661 else
27658 XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), 27662 {
27659 /* But when no window manager is in use, we 27663 x_ignore_errors_for_next_request (dpyinfo);
27660 don't care. */ 27664 XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
27661 RevertToParent, CurrentTime); 27665 /* But when no window manager is in use, we
27662 x_stop_ignoring_errors (dpyinfo); 27666 don't care. */
27667 RevertToParent, CurrentTime);
27668 x_stop_ignoring_errors (dpyinfo);
27669 }
27663 } 27670 }
27664} 27671}
27665 27672