aboutsummaryrefslogtreecommitdiffstats
path: root/src/xselect.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xselect.c')
-rw-r--r--src/xselect.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/xselect.c b/src/xselect.c
index 23310b0f867..ed359849be4 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -2299,7 +2299,24 @@ x_fill_property_data (Display *dpy, Lisp_Object data, void *ret, int format)
2299 Lisp_Object o = XCAR (iter); 2299 Lisp_Object o = XCAR (iter);
2300 2300
2301 if (INTEGERP (o) || FLOATP (o) || CONSP (o)) 2301 if (INTEGERP (o) || FLOATP (o) || CONSP (o))
2302 val = cons_to_signed (o, LONG_MIN, LONG_MAX); 2302 {
2303 if (CONSP (o) && INTEGERP (XCAR (o)) && INTEGERP (XCDR (o)))
2304 {
2305 intmax_t v1 = XINT (XCAR (o));
2306 intmax_t v2 = XINT (XCDR (o));
2307 /* cons_to_signed does not handle negative values for v2.
2308 For XDnd, v2 might be y of a window, and can be negative.
2309 The XDnd spec. is not explicit about negative values,
2310 but lets do what it says.
2311 */
2312 if (v1 < 0 || v2 < 0)
2313 val = (v1 << 16) | v2;
2314 else
2315 val = cons_to_signed (o, LONG_MIN, LONG_MAX);
2316 }
2317 else
2318 val = cons_to_signed (o, LONG_MIN, LONG_MAX);
2319 }
2303 else if (STRINGP (o)) 2320 else if (STRINGP (o))
2304 { 2321 {
2305 block_input (); 2322 block_input ();