diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/src/xterm.c b/src/xterm.c index ab31f0d93e6..f446d093ef4 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -11251,21 +11251,32 @@ XTflash (struct frame *f) | |||
| 11251 | static void | 11251 | static void |
| 11252 | XTring_bell (struct frame *f) | 11252 | XTring_bell (struct frame *f) |
| 11253 | { | 11253 | { |
| 11254 | if (FRAME_X_DISPLAY (f)) | 11254 | struct x_display_info *dpyinfo; |
| 11255 | |||
| 11256 | if (!FRAME_X_DISPLAY (f)) | ||
| 11257 | return; | ||
| 11258 | |||
| 11259 | dpyinfo = FRAME_DISPLAY_INFO (f); | ||
| 11260 | |||
| 11261 | if (visible_bell) | ||
| 11262 | XTflash (f); | ||
| 11263 | else | ||
| 11255 | { | 11264 | { |
| 11256 | if (visible_bell) | 11265 | /* When Emacs is untrusted, Bell requests sometimes generate |
| 11257 | XTflash (f); | 11266 | Access errors. This is not in the security extension |
| 11258 | else | 11267 | specification but seems to be a bug in the X consortium XKB |
| 11259 | { | 11268 | implementation. */ |
| 11260 | block_input (); | 11269 | |
| 11270 | block_input (); | ||
| 11271 | x_ignore_errors_for_next_request (dpyinfo); | ||
| 11261 | #ifdef HAVE_XKB | 11272 | #ifdef HAVE_XKB |
| 11262 | XkbBell (FRAME_X_DISPLAY (f), None, 0, None); | 11273 | XkbBell (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 0, None); |
| 11263 | #else | 11274 | #else |
| 11264 | XBell (FRAME_X_DISPLAY (f), 0); | 11275 | XBell (FRAME_X_DISPLAY (f), 0); |
| 11265 | #endif | 11276 | #endif |
| 11266 | XFlush (FRAME_X_DISPLAY (f)); | 11277 | XFlush (FRAME_X_DISPLAY (f)); |
| 11267 | unblock_input (); | 11278 | x_stop_ignoring_errors (dpyinfo); |
| 11268 | } | 11279 | unblock_input (); |
| 11269 | } | 11280 | } |
| 11270 | } | 11281 | } |
| 11271 | 11282 | ||