static void wait_for_property_change (struct prop_location *);
static Lisp_Object x_get_window_property_as_lisp_data (struct x_display_info *,
Window, Atom,
- Lisp_Object, Atom);
+ Lisp_Object, Atom, bool);
static Lisp_Object selection_data_to_lisp_data (struct x_display_info *,
const unsigned char *,
ptrdiff_t, Atom, int);
if (property == None) goto DONE;
multprop
= x_get_window_property_as_lisp_data (dpyinfo, requestor, property,
- QMULTIPLE, selection);
+ QMULTIPLE, selection, true);
if (!VECTORP (multprop) || ASIZE (multprop) % 2)
goto DONE;
return
x_get_window_property_as_lisp_data (dpyinfo, requestor_window,
target_property, target_type,
- selection_atom);
+ selection_atom, false);
}
\f
/* Subroutines of x_get_window_property_as_lisp_data */
x_get_window_property_as_lisp_data (struct x_display_info *dpyinfo,
Window window, Atom property,
Lisp_Object target_type,
- Atom selection_atom)
+ Atom selection_atom,
+ bool for_multiple)
{
Atom actual_type;
int actual_format;
&actual_type, &actual_format, &actual_size);
if (! data)
{
+ if (for_multiple)
+ return Qnil;
block_input ();
bool there_is_a_selection_owner
= XGetSelectionOwner (display, selection_atom) != 0;
}
}
- if (actual_type == dpyinfo->Xatom_INCR)
+ if (!for_multiple && actual_type == dpyinfo->Xatom_INCR)
{
/* That wasn't really the data, just the beginning. */
&actual_size);
}
- block_input ();
- TRACE1 (" Delete property %s", XGetAtomName (display, property));
- XDeleteProperty (display, window, property);
- XFlush (display);
- unblock_input ();
+ if (!for_multiple)
+ {
+ block_input ();
+ TRACE1 (" Delete property %s", XGetAtomName (display, property));
+ XDeleteProperty (display, window, property);
+ XFlush (display);
+ unblock_input ();
+ }
/* It's been read. Now convert it to a lisp object in some semi-rational
manner. */