summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-07-03 17:51:55 +0800
committerPo Lu <luangruo@yahoo.com>2022-07-03 17:52:14 +0800
commit2c4922d76b7231dd704d34870c6e75099343a48d (patch)
treef3bc4b0b6288fb4b2de60fbe3a384da9d4a00d99
parente7da53a1169ff1796d71fb80b3a51c82821c4bbe (diff)
downloademacs-2c4922d76b7231dd704d34870c6e75099343a48d.tar.gz
emacs-2c4922d76b7231dd704d34870c6e75099343a48d.tar.bz2
emacs-2c4922d76b7231dd704d34870c6e75099343a48d.zip
Improve efficiency of `x_frame_highlight' and `x_frame_unhighlight'
* src/xterm.c (x_frame_highlight, x_frame_unhighlight): Don't sync catching errors.
-rw-r--r--src/xterm.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 0aca949dbc7..819f7fd7e49 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10633,6 +10633,10 @@ x_scroll_run (struct window *w, struct run *run)
static void
x_frame_highlight (struct frame *f)
{
+ struct x_display_info *dpyinfo;
+
+ dpyinfo = FRAME_DISPLAY_INFO (f);
+
/* We used to only do this if Vx_no_window_manager was non-nil, but
the ICCCM (section 4.1.6) says that the window's border pixmap
and border pixel are window attributes which are "private to the
@@ -10642,10 +10646,10 @@ x_frame_highlight (struct frame *f)
the window-manager in use, tho something more is at play since I've been
using that same window-manager binary for ever. Let's not crash just
because of this (bug#9310). */
- x_catch_errors (FRAME_X_DISPLAY (f));
+ x_ignore_errors_for_next_request (dpyinfo);
XSetWindowBorder (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
f->output_data.x->border_pixel);
- x_uncatch_errors ();
+ x_stop_ignoring_errors (dpyinfo);
unblock_input ();
gui_update_cursor (f, true);
x_set_frame_alpha (f);
@@ -10654,17 +10658,23 @@ x_frame_highlight (struct frame *f)
static void
x_frame_unhighlight (struct frame *f)
{
+ struct x_display_info *dpyinfo;
+
+ dpyinfo = FRAME_DISPLAY_INFO (f);
+
/* We used to only do this if Vx_no_window_manager was non-nil, but
the ICCCM (section 4.1.6) says that the window's border pixmap
and border pixel are window attributes which are "private to the
client", so we can always change it to whatever we want. */
+
block_input ();
/* Same as above for XSetWindowBorder (bug#9310). */
- x_catch_errors (FRAME_X_DISPLAY (f));
+ x_ignore_errors_for_next_request (dpyinfo);
XSetWindowBorderPixmap (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
f->output_data.x->border_tile);
- x_uncatch_errors ();
+ x_stop_ignoring_errors (dpyinfo);
unblock_input ();
+
gui_update_cursor (f, true);
x_set_frame_alpha (f);
}