diff options
| author | Paul Eggert | 2012-06-22 14:17:42 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-06-22 14:17:42 -0700 |
| commit | d35af63cd671563fd188c3b0a1ef30067027c7aa (patch) | |
| tree | c9e01847ccf788e23794684da9331c3e0defd0d3 /src/xselect.c | |
| parent | f143bfe38b43ad0a9d817f05c25e418982dca06f (diff) | |
| download | emacs-d35af63cd671563fd188c3b0a1ef30067027c7aa.tar.gz emacs-d35af63cd671563fd188c3b0a1ef30067027c7aa.zip | |
Support higher-resolution time stamps.
Fixes: debbugs:9000
Diffstat (limited to 'src/xselect.c')
| -rw-r--r-- | src/xselect.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/xselect.c b/src/xselect.c index 49a491d4163..f21c57b44bb 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -1139,7 +1139,6 @@ wait_for_property_change_unwind (Lisp_Object loc) | |||
| 1139 | static void | 1139 | static void |
| 1140 | wait_for_property_change (struct prop_location *location) | 1140 | wait_for_property_change (struct prop_location *location) |
| 1141 | { | 1141 | { |
| 1142 | int secs, usecs; | ||
| 1143 | ptrdiff_t count = SPECPDL_INDEX (); | 1142 | ptrdiff_t count = SPECPDL_INDEX (); |
| 1144 | 1143 | ||
| 1145 | if (property_change_reply_object) | 1144 | if (property_change_reply_object) |
| @@ -1156,10 +1155,11 @@ wait_for_property_change (struct prop_location *location) | |||
| 1156 | property_change_reply, because property_change_reply_object says so. */ | 1155 | property_change_reply, because property_change_reply_object says so. */ |
| 1157 | if (! location->arrived) | 1156 | if (! location->arrived) |
| 1158 | { | 1157 | { |
| 1159 | secs = x_selection_timeout / 1000; | 1158 | EMACS_INT timeout = max (0, x_selection_timeout); |
| 1160 | usecs = (x_selection_timeout % 1000) * 1000; | 1159 | EMACS_INT secs = timeout / 1000; |
| 1161 | TRACE2 (" Waiting %d secs, %d usecs", secs, usecs); | 1160 | int nsecs = (timeout % 1000) * 1000000; |
| 1162 | wait_reading_process_output (secs, usecs, 0, 0, | 1161 | TRACE2 (" Waiting %"pI"d secs, %d nsecs", secs, nsecs); |
| 1162 | wait_reading_process_output (secs, nsecs, 0, 0, | ||
| 1163 | property_change_reply, NULL, 0); | 1163 | property_change_reply, NULL, 0); |
| 1164 | 1164 | ||
| 1165 | if (NILP (XCAR (property_change_reply))) | 1165 | if (NILP (XCAR (property_change_reply))) |
| @@ -1228,7 +1228,8 @@ x_get_foreign_selection (Lisp_Object selection_symbol, Lisp_Object target_type, | |||
| 1228 | Atom type_atom = (CONSP (target_type) | 1228 | Atom type_atom = (CONSP (target_type) |
| 1229 | ? symbol_to_x_atom (dpyinfo, XCAR (target_type)) | 1229 | ? symbol_to_x_atom (dpyinfo, XCAR (target_type)) |
| 1230 | : symbol_to_x_atom (dpyinfo, target_type)); | 1230 | : symbol_to_x_atom (dpyinfo, target_type)); |
| 1231 | int secs, usecs; | 1231 | EMACS_INT timeout, secs; |
| 1232 | int nsecs; | ||
| 1232 | 1233 | ||
| 1233 | if (!FRAME_LIVE_P (f)) | 1234 | if (!FRAME_LIVE_P (f)) |
| 1234 | return Qnil; | 1235 | return Qnil; |
| @@ -1264,10 +1265,11 @@ x_get_foreign_selection (Lisp_Object selection_symbol, Lisp_Object target_type, | |||
| 1264 | UNBLOCK_INPUT; | 1265 | UNBLOCK_INPUT; |
| 1265 | 1266 | ||
| 1266 | /* This allows quits. Also, don't wait forever. */ | 1267 | /* This allows quits. Also, don't wait forever. */ |
| 1267 | secs = x_selection_timeout / 1000; | 1268 | timeout = max (0, x_selection_timeout); |
| 1268 | usecs = (x_selection_timeout % 1000) * 1000; | 1269 | secs = timeout / 1000; |
| 1269 | TRACE1 (" Start waiting %d secs for SelectionNotify", secs); | 1270 | nsecs = (timeout % 1000) * 1000000; |
| 1270 | wait_reading_process_output (secs, usecs, 0, 0, | 1271 | TRACE1 (" Start waiting %"pI"d secs for SelectionNotify", secs); |
| 1272 | wait_reading_process_output (secs, nsecs, 0, 0, | ||
| 1271 | reading_selection_reply, NULL, 0); | 1273 | reading_selection_reply, NULL, 0); |
| 1272 | TRACE1 (" Got event = %d", !NILP (XCAR (reading_selection_reply))); | 1274 | TRACE1 (" Got event = %d", !NILP (XCAR (reading_selection_reply))); |
| 1273 | 1275 | ||