diff options
Diffstat (limited to 'src/xselect.c')
| -rw-r--r-- | src/xselect.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/xselect.c b/src/xselect.c index adea1f3c2d6..5a899cfa389 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -1925,7 +1925,12 @@ lisp_data_to_selection_data (display, obj, | |||
| 1925 | } | 1925 | } |
| 1926 | else if (STRINGP (obj)) | 1926 | else if (STRINGP (obj)) |
| 1927 | { | 1927 | { |
| 1928 | xassert (! STRING_MULTIBYTE (obj)); | 1928 | if (SCHARS (obj) < SBYTES (obj)) |
| 1929 | /* OBJ is a multibyte string containing a non-ASCII char. */ | ||
| 1930 | Fsignal (Qerror, /* Qselection_error */ | ||
| 1931 | Fcons (build_string | ||
| 1932 | ("Non-ASCII string must be encoded in advance"), | ||
| 1933 | Fcons (obj, Qnil))); | ||
| 1929 | if (NILP (type)) | 1934 | if (NILP (type)) |
| 1930 | type = QSTRING; | 1935 | type = QSTRING; |
| 1931 | *format_ret = 8; | 1936 | *format_ret = 8; |
| @@ -2201,7 +2206,10 @@ Disowning it means there is no such selection. */) | |||
| 2201 | { | 2206 | { |
| 2202 | Time timestamp; | 2207 | Time timestamp; |
| 2203 | Atom selection_atom; | 2208 | Atom selection_atom; |
| 2204 | struct selection_input_event event; | 2209 | union { |
| 2210 | struct selection_input_event sie; | ||
| 2211 | struct input_event ie; | ||
| 2212 | } event; | ||
| 2205 | Display *display; | 2213 | Display *display; |
| 2206 | struct x_display_info *dpyinfo; | 2214 | struct x_display_info *dpyinfo; |
| 2207 | struct frame *sf = SELECTED_FRAME (); | 2215 | struct frame *sf = SELECTED_FRAME (); |
| @@ -2232,10 +2240,10 @@ Disowning it means there is no such selection. */) | |||
| 2232 | the selection owner to None. The NCD server does, the MIT Sun4 server | 2240 | the selection owner to None. The NCD server does, the MIT Sun4 server |
| 2233 | doesn't. So we synthesize one; this means we might get two, but | 2241 | doesn't. So we synthesize one; this means we might get two, but |
| 2234 | that's ok, because the second one won't have any effect. */ | 2242 | that's ok, because the second one won't have any effect. */ |
| 2235 | SELECTION_EVENT_DISPLAY (&event) = display; | 2243 | SELECTION_EVENT_DISPLAY (&event.sie) = display; |
| 2236 | SELECTION_EVENT_SELECTION (&event) = selection_atom; | 2244 | SELECTION_EVENT_SELECTION (&event.sie) = selection_atom; |
| 2237 | SELECTION_EVENT_TIME (&event) = timestamp; | 2245 | SELECTION_EVENT_TIME (&event.sie) = timestamp; |
| 2238 | x_handle_selection_clear ((struct input_event *) &event); | 2246 | x_handle_selection_clear (&event.ie); |
| 2239 | 2247 | ||
| 2240 | return Qt; | 2248 | return Qt; |
| 2241 | } | 2249 | } |