X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/4545fa2085b65a310e46b6d599d3998e0a1fe370..3f489dc760ec721fc098e5916efde3e10677980f:/src/xterm.c diff --git a/src/xterm.c b/src/xterm.c index 7b952e1f45..ba51dbb8f5 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -6083,7 +6083,8 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) f = x_any_window_to_frame (dpyinfo, event.xkey.window); - if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)) + if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) + && !EQ (f->tool_bar_window, dpyinfo->mouse_face_window)) { clear_mouse_face (dpyinfo); dpyinfo->mouse_face_hidden = 1; @@ -7178,7 +7179,7 @@ x_draw_hollow_cursor (w, row) /* Set clipping, draw the rectangle, and reset clipping again. */ x_clip_to_row (w, row, TEXT_AREA, gc); - XDrawRectangle (dpy, FRAME_X_WINDOW (f), gc, x, y, wd, h); + XDrawRectangle (dpy, FRAME_X_WINDOW (f), gc, x, y, wd, h - 1); XSetClipMask (dpy, gc, None); } @@ -7533,18 +7534,17 @@ x_uncatch_errors () { struct x_error_message_stack *tmp; + BLOCK_INPUT; + /* The display may have been closed before this function is called. Check if it is still open before calling XSync. */ if (x_display_info_for_display (x_error_message->dpy) != 0) - { - BLOCK_INPUT; - XSync (x_error_message->dpy, False); - UNBLOCK_INPUT; - } + XSync (x_error_message->dpy, False); tmp = x_error_message; x_error_message = x_error_message->prev; xfree (tmp); + UNBLOCK_INPUT; } /* If any X protocol errors have arrived since the last call to @@ -7590,6 +7590,23 @@ x_clear_errors (dpy) x_error_message->string[0] = 0; } +/* Close off all unclosed x_catch_errors calls. */ + +void +x_fully_uncatch_errors () +{ + while (x_error_message) + x_uncatch_errors (); +} + +/* Nonzero if x_catch_errors has been done and not yet canceled. */ + +int +x_catching_errors () +{ + return x_error_message != 0; +} + #if 0 static unsigned int x_wire_count; x_trace_wire () @@ -10023,6 +10040,10 @@ static XrmOptionDescRec emacs_options[] = { static int x_initialized; +#ifdef HAVE_X_SM +static int x_session_initialized; +#endif + #ifdef MULTI_KBOARD /* Test whether two display-name strings agree up to the dot that separates the screen number from the server number. */ @@ -10100,6 +10121,21 @@ get_bits_and_offset (mask, bits, offset) *bits = nr; } +int +x_display_ok (display) + const char * display; +{ + int dpy_ok = 1; + Display *dpy; + + dpy = XOpenDisplay (display); + if (dpy) + XCloseDisplay (dpy); + else + dpy_ok = 0; + return dpy_ok; +} + struct x_display_info * x_term_init (display_name, xrm_option, resource_name) Lisp_Object display_name; @@ -10169,18 +10205,14 @@ x_term_init (display_name, xrm_option, resource_name) /* Load our own gtkrc if it exists. */ { - struct gcpro gcpro1, gcpro2; char *file = "~/.emacs.d/gtkrc"; Lisp_Object s, abs_file; - GCPRO2 (s, abs_file); s = make_string (file, strlen (file)); abs_file = Fexpand_file_name (s, Qnil); if (! NILP (abs_file) && !NILP (Ffile_readable_p (abs_file))) gtk_rc_parse (SDATA (abs_file)); - - UNGCPRO; } XSetErrorHandler (x_error_handler); @@ -10578,7 +10610,7 @@ x_term_init (display_name, xrm_option, resource_name) #ifdef HAVE_X_SM /* Only do this for the first display. */ - if (x_initialized == 1) + if (!x_session_initialized++) x_session_initialize (dpyinfo); #endif @@ -10763,6 +10795,9 @@ x_initialize () last_tool_bar_item = -1; any_help_event_p = 0; ignore_next_mouse_click_timeout = 0; +#ifdef HAVE_X_SM + x_session_initialized = 0; +#endif #ifdef USE_GTK current_count = -1;