aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChong Yidong2011-12-05 23:21:48 +0800
committerChong Yidong2011-12-05 23:21:48 +0800
commit3a6ad4f050f93ee8b609da50cb9e7ab8c934a9d6 (patch)
tree280d7f0087dcd64f035649719f908ca296cb17c0 /src
parentebf10822d1ce7579624ddf78a14f9bf114268888 (diff)
downloademacs-3a6ad4f050f93ee8b609da50cb9e7ab8c934a9d6.tar.gz
emacs-3a6ad4f050f93ee8b609da50cb9e7ab8c934a9d6.zip
Handle X selection requests in input-pending-p.
* src/keyboard.c (process_special_events): New function. (swallow_events, Finput_pending_p): Use it. Fixes: debbugs:10195
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/keyboard.c25
2 files changed, 24 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 0f0365b5bac..e22d6cb8cfb 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12011-12-05 Chong Yidong <cyd@gnu.org>
2
3 * keyboard.c (process_special_events): New function.
4 (swallow_events, Finput_pending_p): Use it (Bug#10195).
5
12011-12-05 Paul Eggert <eggert@cs.ucla.edu> 62011-12-05 Paul Eggert <eggert@cs.ucla.edu>
2 7
3 * coding.c (encode_designation_at_bol): Don't use uninitialized 8 * coding.c (encode_designation_at_bol): Don't use uninitialized
diff --git a/src/keyboard.c b/src/keyboard.c
index a114e495cf7..2df1ba742ba 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -465,6 +465,7 @@ static Lisp_Object (Fcommand_execute) (Lisp_Object, Lisp_Object, Lisp_Object,
465 Lisp_Object); 465 Lisp_Object);
466static void handle_interrupt (void); 466static void handle_interrupt (void);
467static void quit_throw_to_read_char (int) NO_RETURN; 467static void quit_throw_to_read_char (int) NO_RETURN;
468static void process_special_events (void);
468static void timer_start_idle (void); 469static void timer_start_idle (void);
469static void timer_stop_idle (void); 470static void timer_stop_idle (void);
470static void timer_resume_idle (void); 471static void timer_resume_idle (void);
@@ -4145,14 +4146,12 @@ kbd_buffer_get_event (KBOARD **kbp,
4145 return (obj); 4146 return (obj);
4146} 4147}
4147 4148
4148/* Process any events that are not user-visible, 4149/* Process any non-user-visible events (currently X selection events),
4149 then return, without reading any user-visible events. */ 4150 without reading any user-visible events. */
4150 4151
4151void 4152static void
4152swallow_events (int do_display) 4153process_special_events (void)
4153{ 4154{
4154 int old_timers_run;
4155
4156 while (kbd_fetch_ptr != kbd_store_ptr) 4155 while (kbd_fetch_ptr != kbd_store_ptr)
4157 { 4156 {
4158 struct input_event *event; 4157 struct input_event *event;
@@ -4187,6 +4186,17 @@ swallow_events (int do_display)
4187 else 4186 else
4188 break; 4187 break;
4189 } 4188 }
4189}
4190
4191/* Process any events that are not user-visible, run timer events that
4192 are ripe, and return, without reading any user-visible events. */
4193
4194void
4195swallow_events (int do_display)
4196{
4197 int old_timers_run;
4198
4199 process_special_events ();
4190 4200
4191 old_timers_run = timers_run; 4201 old_timers_run = timers_run;
4192 get_input_pending (&input_pending, READABLE_EVENTS_DO_TIMERS_NOW); 4202 get_input_pending (&input_pending, READABLE_EVENTS_DO_TIMERS_NOW);
@@ -10522,6 +10532,9 @@ if there is a doubt, the value is t. */)
10522 || !NILP (Vunread_input_method_events)) 10532 || !NILP (Vunread_input_method_events))
10523 return (Qt); 10533 return (Qt);
10524 10534
10535 /* Process non-user-visible events (Bug#10195). */
10536 process_special_events ();
10537
10525 get_input_pending (&input_pending, 10538 get_input_pending (&input_pending,
10526 READABLE_EVENTS_DO_TIMERS_NOW 10539 READABLE_EVENTS_DO_TIMERS_NOW
10527 | READABLE_EVENTS_FILTER_EVENTS); 10540 | READABLE_EVENTS_FILTER_EVENTS);