Commits

Chong Yidong  committed fbe7fda

Handle X selection requests in input-pending-p.

* src/keyboard.c (process_special_events): New function.
(swallow_events, Finput_pending_p): Use it.

  • Participants
  • Parent commits 72f6291

Comments (0)

Files changed (2)

File src/ChangeLog

+2011-12-05  Chong Yidong  <cyd@gnu.org>
+
+	* keyboard.c (process_special_events): New function.
+	(swallow_events, Finput_pending_p): Use it (Bug#10195).
+
 2011-12-05  Paul Eggert  <eggert@cs.ucla.edu>
 
 	* coding.c (encode_designation_at_bol): Don't use uninitialized

File src/keyboard.c

 				       Lisp_Object);
 static void handle_interrupt (void);
 static void quit_throw_to_read_char (int) NO_RETURN;
+static void process_special_events (void);
 static void timer_start_idle (void);
 static void timer_stop_idle (void);
 static void timer_resume_idle (void);
   return (obj);
 }
 
-/* Process any events that are not user-visible,
-   then return, without reading any user-visible events.  */
-
-void
-swallow_events (int do_display)
-{
-  int old_timers_run;
-
+/* Process any non-user-visible events (currently X selection events),
+   without reading any user-visible events.  */
+
+static void
+process_special_events (void)
+{
   while (kbd_fetch_ptr != kbd_store_ptr)
     {
       struct input_event *event;
       else
 	break;
     }
+}
+
+/* Process any events that are not user-visible, run timer events that
+   are ripe, and return, without reading any user-visible events.  */
+
+void
+swallow_events (int do_display)
+{
+  int old_timers_run;
+
+  process_special_events ();
 
   old_timers_run = timers_run;
   get_input_pending (&input_pending, READABLE_EVENTS_DO_TIMERS_NOW);
       || !NILP (Vunread_input_method_events))
     return (Qt);
 
+  /* Process non-user-visible events (Bug#10195).  */
+  process_special_events ();
+
   get_input_pending (&input_pending,
 		     READABLE_EVENTS_DO_TIMERS_NOW
 		     | READABLE_EVENTS_FILTER_EVENTS);