aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xselect.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/xselect.c b/src/xselect.c
index 4c7c7a7f862..08e4fd9b868 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -430,6 +430,10 @@ x_decline_selection_request (event)
430 It is set to zero when the request is fully processed. */ 430 It is set to zero when the request is fully processed. */
431static struct input_event *x_selection_current_request; 431static struct input_event *x_selection_current_request;
432 432
433/* Display info in x_selection_request. */
434
435static struct x_display_info *selection_request_dpyinfo;
436
433/* Used as an unwind-protect clause so that, if a selection-converter signals 437/* Used as an unwind-protect clause so that, if a selection-converter signals
434 an error, we tell the requester that we were unable to do what they wanted 438 an error, we tell the requester that we were unable to do what they wanted
435 before we throw to top-level or go into the debugger or whatever. */ 439 before we throw to top-level or go into the debugger or whatever. */
@@ -438,7 +442,8 @@ static Lisp_Object
438x_selection_request_lisp_error (ignore) 442x_selection_request_lisp_error (ignore)
439 Lisp_Object ignore; 443 Lisp_Object ignore;
440{ 444{
441 if (x_selection_current_request != 0) 445 if (x_selection_current_request != 0
446 && selection_request_dpyinfo->display)
442 x_decline_selection_request (x_selection_current_request); 447 x_decline_selection_request (x_selection_current_request);
443 return Qnil; 448 return Qnil;
444} 449}
@@ -707,8 +712,9 @@ x_handle_selection_request (event)
707 goto DONE; 712 goto DONE;
708 } 713 }
709 714
710 count = specpdl_ptr - specpdl;
711 x_selection_current_request = event; 715 x_selection_current_request = event;
716 count = BINDING_STACK_SIZE ();
717 selection_request_dpyinfo = dpyinfo;
712 record_unwind_protect (x_selection_request_lisp_error, Qnil); 718 record_unwind_protect (x_selection_request_lisp_error, Qnil);
713 719
714 target_symbol = x_atom_to_symbol (dpyinfo, SELECTION_EVENT_DISPLAY (event), 720 target_symbol = x_atom_to_symbol (dpyinfo, SELECTION_EVENT_DISPLAY (event),