x_decline_selection_request (struct selection_input_event *event)
{
XEvent reply_base;
- XSelectionEvent *reply = &(reply_base.xselection);
+ XSelectionEvent *reply;
+ Display *dpy;
+ struct x_display_info *dpyinfo;
+
+ reply = &(reply_base.xselection);
+ dpy = SELECTION_EVENT_DISPLAY (event);
+ dpyinfo = x_display_info_for_display (dpy);
+
+ if (!dpyinfo)
+ return;
reply->type = SelectionNotify;
- reply->display = SELECTION_EVENT_DISPLAY (event);
+ reply->display = dpy;
reply->requestor = SELECTION_EVENT_REQUESTOR (event);
reply->selection = SELECTION_EVENT_SELECTION (event);
reply->time = SELECTION_EVENT_TIME (event);
/* The reason for the error may be that the receiver has
died in the meantime. Handle that case. */
block_input ();
- x_catch_errors (reply->display);
- XSendEvent (reply->display, reply->requestor, False, 0, &reply_base);
- XFlush (reply->display);
- x_uncatch_errors ();
+ x_ignore_errors_for_next_request (dpyinfo);
+ XSendEvent (dpyinfo->display, reply->requestor,
+ False, 0, &reply_base);
+ x_stop_ignoring_errors (dpyinfo);
+
+ XFlush (dpyinfo->display);
unblock_input ();
}
#ifdef HAVE_X_I18N
static int x_filter_event (struct x_display_info *, XEvent *);
#endif
-static void x_ignore_errors_for_next_request (struct x_display_info *);
-static void x_stop_ignoring_errors (struct x_display_info *);
static void x_clean_failable_requests (struct x_display_info *);
static struct frame *x_tooltip_window_to_frame (struct x_display_info *,
+ (last - first));
}
-static void
+void
x_ignore_errors_for_next_request (struct x_display_info *dpyinfo)
{
struct x_failable_request *request, *max;
dpyinfo->next_failable_request++;
}
-static void
+void
x_stop_ignoring_errors (struct x_display_info *dpyinfo)
{
struct x_failable_request *range;
extern void x_unwind_errors_to (int);
extern void x_uncatch_errors (void);
extern void x_uncatch_errors_after_check (void);
+extern void x_ignore_errors_for_next_request (struct x_display_info *);
+extern void x_stop_ignoring_errors (struct x_display_info *);
extern void x_clear_errors (Display *);
extern void x_set_window_size (struct frame *, bool, int, int);
extern void x_set_last_user_time_from_lisp (struct x_display_info *, Time);