x_handle_selection_request (struct selection_input_event *event)
{
Time local_selection_time;
-
struct x_display_info *dpyinfo = SELECTION_EVENT_DPYINFO (event);
Atom selection = SELECTION_EVENT_SELECTION (event);
Lisp_Object selection_symbol = x_atom_to_symbol (dpyinfo, selection);
Lisp_Object local_selection_data;
bool success = false;
specpdl_ref count = SPECPDL_INDEX ();
+ bool pushed;
+
+ pushed = false;
- if (!dpyinfo) goto DONE;
+ if (!dpyinfo)
+ goto DONE;
/* This is how the XDND protocol recommends dropping text onto a
target that doesn't support XDND. */
goto DONE;
block_input ();
+ pushed = true;
x_push_current_selection_request (event, dpyinfo);
record_unwind_protect_void (x_pop_current_selection_request);
record_unwind_protect_void (x_selection_request_lisp_error);
DONE:
- selection_request_stack->converted = true;
+ if (pushed)
+ selection_request_stack->converted = true;
if (success)
x_reply_selection_request (event, dpyinfo);