diff options
| author | Vladimir Panteleev | 2022-02-04 02:46:50 +0000 |
|---|---|---|
| committer | Po Lu | 2022-02-05 09:07:14 +0800 |
| commit | 5098f2b844b05e4ebbbbf44c5adbc3d7975e43e6 (patch) | |
| tree | 6dd61f39ae0229fd4380124f6919b2a8f528dabd /src | |
| parent | de687e8983f57c975e902af6eb484d9115ca0733 (diff) | |
| download | emacs-5098f2b844b05e4ebbbbf44c5adbc3d7975e43e6.tar.gz emacs-5098f2b844b05e4ebbbbf44c5adbc3d7975e43e6.zip | |
Update the MULTIPLE property with conversion outcomes
Per the ICCCM spec:
> If the owner fails to convert the target named by an atom in the
> MULTIPLE property, it should replace that atom in the property with
> None.
* src/xselect.c (x_handle_selection_request): Do it.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xselect.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/xselect.c b/src/xselect.c index 537be2ddd54..f2a64dd9534 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -795,6 +795,7 @@ x_handle_selection_request (struct selection_input_event *event) | |||
| 795 | Window requestor = SELECTION_EVENT_REQUESTOR (event); | 795 | Window requestor = SELECTION_EVENT_REQUESTOR (event); |
| 796 | Lisp_Object multprop; | 796 | Lisp_Object multprop; |
| 797 | ptrdiff_t j, nselections; | 797 | ptrdiff_t j, nselections; |
| 798 | struct selection_data cs; | ||
| 798 | 799 | ||
| 799 | if (property == None) goto DONE; | 800 | if (property == None) goto DONE; |
| 800 | multprop | 801 | multprop |
| @@ -811,11 +812,19 @@ x_handle_selection_request (struct selection_input_event *event) | |||
| 811 | Lisp_Object subtarget = AREF (multprop, 2*j); | 812 | Lisp_Object subtarget = AREF (multprop, 2*j); |
| 812 | Atom subproperty = symbol_to_x_atom (dpyinfo, | 813 | Atom subproperty = symbol_to_x_atom (dpyinfo, |
| 813 | AREF (multprop, 2*j+1)); | 814 | AREF (multprop, 2*j+1)); |
| 815 | bool subsuccess = false; | ||
| 814 | 816 | ||
| 815 | if (subproperty != None) | 817 | if (subproperty != None) |
| 816 | x_convert_selection (selection_symbol, subtarget, | 818 | subsuccess = x_convert_selection (selection_symbol, subtarget, |
| 817 | subproperty, true, dpyinfo); | 819 | subproperty, true, dpyinfo); |
| 820 | if (!subsuccess) | ||
| 821 | ASET (multprop, 2*j+1, Qnil); | ||
| 818 | } | 822 | } |
| 823 | /* Save conversion results */ | ||
| 824 | lisp_data_to_selection_data (dpyinfo, multprop, &cs); | ||
| 825 | XChangeProperty (dpyinfo->display, requestor, property, | ||
| 826 | cs.type, cs.format, PropModeReplace, | ||
| 827 | cs.data, cs.size); | ||
| 819 | success = true; | 828 | success = true; |
| 820 | } | 829 | } |
| 821 | else | 830 | else |