aboutsummaryrefslogtreecommitdiffstats
path: root/src/xselect.c
diff options
context:
space:
mode:
authorPo Lu2022-06-20 20:56:49 +0800
committerPo Lu2022-06-20 20:59:38 +0800
commit4cc2f820b500ed2f8fad9baa2cf4a057f271a006 (patch)
treec32aa9a1882205d2ab62367ebadb976e9d06df5a /src/xselect.c
parenta7aeef934be65ed86993181f3ad3b4b074a6afaa (diff)
downloademacs-4cc2f820b500ed2f8fad9baa2cf4a057f271a006.tar.gz
emacs-4cc2f820b500ed2f8fad9baa2cf4a057f271a006.zip
Fix x-selection-timeout if some keyboard input arrives while waiting
* src/process.c (wait_reading_process_output): Don't allow skipping calls to select if detect_input_pending when just waiting for a cell. (bug#46935) * src/xselect.c (x_get_foreign_selection): Add more debugging code.
Diffstat (limited to 'src/xselect.c')
-rw-r--r--src/xselect.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/xselect.c b/src/xselect.c
index dd82a906af1..fcf0ee944e2 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1261,7 +1261,13 @@ x_get_foreign_selection (Lisp_Object selection_symbol, Lisp_Object target_type,
1261 intmax_t timeout = max (0, x_selection_timeout); 1261 intmax_t timeout = max (0, x_selection_timeout);
1262 intmax_t secs = timeout / 1000; 1262 intmax_t secs = timeout / 1000;
1263 int nsecs = (timeout % 1000) * 1000000; 1263 int nsecs = (timeout % 1000) * 1000000;
1264 TRACE1 (" Start waiting %"PRIdMAX" secs for SelectionNotify", secs); 1264 TRACE1 (" Start waiting %"PRIdMAX" secs for SelectionNotify.", secs);
1265
1266 if (input_blocked_p ())
1267 TRACE0 (" Input is blocked.");
1268 else
1269 TRACE1 (" Waiting for %d nsecs in addition.", nsecs);
1270
1265 /* This function can be called with input blocked inside Xt or GTK 1271 /* This function can be called with input blocked inside Xt or GTK
1266 timeouts run inside popup menus, so use a function that works 1272 timeouts run inside popup menus, so use a function that works
1267 when input is blocked. Prefer wait_reading_process_output 1273 when input is blocked. Prefer wait_reading_process_output