diff options
| author | Richard M. Stallman | 1993-06-05 08:37:45 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-06-05 08:37:45 +0000 |
| commit | 80da01904ca6c21d7eda350e0c75a412029ef6f2 (patch) | |
| tree | aa468c020d6f9b0c1e5803d5141a363bda34738b /src/xselect.c | |
| parent | 57a1f2a2edde0f0592ccb6f8ef9084df18f700ac (diff) | |
| download | emacs-80da01904ca6c21d7eda350e0c75a412029ef6f2.tar.gz emacs-80da01904ca6c21d7eda350e0c75a412029ef6f2.zip | |
(x_get_foreign_selection): Handle x_selection_timeout
as milliseconds, not as seconds.
(syms_of_xselect): Doc fix to match.
Diffstat (limited to 'src/xselect.c')
| -rw-r--r-- | src/xselect.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/xselect.c b/src/xselect.c index 28438af226a..73394f18a7d 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -18,9 +18,8 @@ along with GNU Emacs; see the file COPYING. If not, write to | |||
| 18 | the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | 18 | the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ |
| 19 | 19 | ||
| 20 | /* x_handle_selection_notify | 20 | /* x_handle_selection_notify |
| 21 | x_reply_selection_request | 21 | x_reply_selection_request */ |
| 22 | XFree | 22 | |
| 23 | x_selection_timeout initial value */ | ||
| 24 | 23 | ||
| 25 | /* Rewritten by jwz */ | 24 | /* Rewritten by jwz */ |
| 26 | 25 | ||
| @@ -96,7 +95,7 @@ Lisp_Object Vselection_alist; | |||
| 96 | Lisp_Object Vselection_converter_alist; | 95 | Lisp_Object Vselection_converter_alist; |
| 97 | 96 | ||
| 98 | /* If the selection owner takes too long to reply to a selection request, | 97 | /* If the selection owner takes too long to reply to a selection request, |
| 99 | we give up on it. This is in seconds (0 = no timeout.) | 98 | we give up on it. This is in milliseconds (0 = no timeout.) |
| 100 | */ | 99 | */ |
| 101 | int x_selection_timeout; | 100 | int x_selection_timeout; |
| 102 | 101 | ||
| @@ -958,6 +957,7 @@ x_get_foreign_selection (selection_symbol, target_type) | |||
| 958 | Atom target_property = Xatom_EMACS_TMP; | 957 | Atom target_property = Xatom_EMACS_TMP; |
| 959 | Atom selection_atom = symbol_to_x_atom (display, selection_symbol); | 958 | Atom selection_atom = symbol_to_x_atom (display, selection_symbol); |
| 960 | Atom type_atom; | 959 | Atom type_atom; |
| 960 | int secs, usecs; | ||
| 961 | 961 | ||
| 962 | if (CONSP (target_type)) | 962 | if (CONSP (target_type)) |
| 963 | type_atom = symbol_to_x_atom (display, XCONS (target_type)->car); | 963 | type_atom = symbol_to_x_atom (display, XCONS (target_type)->car); |
| @@ -975,9 +975,10 @@ x_get_foreign_selection (selection_symbol, target_type) | |||
| 975 | XCONS (reading_selection_reply)->car = Qnil; | 975 | XCONS (reading_selection_reply)->car = Qnil; |
| 976 | UNBLOCK_INPUT; | 976 | UNBLOCK_INPUT; |
| 977 | 977 | ||
| 978 | /* This allows quits. */ | 978 | /* This allows quits. Also, don't wait forever. */ |
| 979 | wait_reading_process_input (x_selection_timeout, 0, | 979 | secs = x_selection_timeout / 1000; |
| 980 | reading_selection_reply, 0); | 980 | usecs = (x_selection_timeout % 1000) * 1000; |
| 981 | wait_reading_process_input (secs, usecs, reading_selection_reply, 0); | ||
| 981 | 982 | ||
| 982 | if (NILP (XCONS (reading_selection_reply)->car)) | 983 | if (NILP (XCONS (reading_selection_reply)->car)) |
| 983 | error ("timed out waiting for reply from selection owner"); | 984 | error ("timed out waiting for reply from selection owner"); |
| @@ -1935,10 +1936,10 @@ it merely informs you that they have happened."); | |||
| 1935 | Vx_sent_selection_hooks = Qnil; | 1936 | Vx_sent_selection_hooks = Qnil; |
| 1936 | 1937 | ||
| 1937 | DEFVAR_INT ("x-selection-timeout", &x_selection_timeout, | 1938 | DEFVAR_INT ("x-selection-timeout", &x_selection_timeout, |
| 1938 | "Number of seconds to wait for a selection reply from another X client.\n\ | 1939 | "Number of milliseconds to wait for a selection reply.\n\ |
| 1939 | If the selection owner doens't reply in this many seconds, we give up.\n\ | 1940 | If the selection owner doens't reply in this time, we give up.\n\ |
| 1940 | A value of 0 means wait as long as necessary. This is initialized from the\n\ | 1941 | A value of 0 means wait as long as necessary. This is initialized from the\n\ |
| 1941 | \"*selectionTimeout\" resource (which is expressed in milliseconds)."); | 1942 | \"*selectionTimeout\" resource."); |
| 1942 | x_selection_timeout = 0; | 1943 | x_selection_timeout = 0; |
| 1943 | 1944 | ||
| 1944 | QPRIMARY = intern ("PRIMARY"); staticpro (&QPRIMARY); | 1945 | QPRIMARY = intern ("PRIMARY"); staticpro (&QPRIMARY); |