+2005-01-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * keyboard.c (READABLE_EVENTS_DO_TIMERS_NOW)
+ (READABLE_EVENTS_FILTER_EVENTS)
+ (READABLE_EVENTS_IGNORE_SQUEEZABLES): New flags for readable_events.
+ get_filtered_input_pending, readable_filtered_events): Removed.
+ (tracking_off): Call readable_events and get_input_pending with
+ flag READABLE_EVENTS_DO_TIMERS_NOW.
+ (readable_events): Move code from old readable_filtered_events here,
+ but check new READABLE_EVENTS_* in argument flags instead of previous
+ two boolean arguments do_timers_now and filter_events.
+ If we are doing mouse tracking and the mouse moved, return only if
+ READABLE_EVENTS_IGNORE_SQUEEZABLES is not set in flags.
+ (swallow_events): Call get_input_pending with flag
+ READABLE_EVENTS_DO_TIMERS_NOW.
+ (get_input_pending): Move code from old get_filtered_input_pending
+ here. Replace boolean arguments do_timers_now, filter_events with
+ flags, and pass flags to readable_events. Document new
+ READABLE_EVENTS_* flags.
+ (detect_input_pending_ignore_squeezables): New function.
+ (detect_input_pending_run_timers): Call get_input_pending with flag
+ READABLE_EVENTS_DO_TIMERS_NOW.
+ (Finput_pending_p): Call get_input_pending with flags
+ READABLE_EVENTS_DO_TIMERS_NOW and READABLE_EVENTS_FILTER_EVENTS.
+
+ * dispnew.c (update_window, update_frame_1): Replace calls to
+ detect_input_pending with detect_input_pending_ignore_squeezables
+ so that redisplay is not paused if the event queue contains only
+ mouse movements.
+
+ * lisp.h: Declare detect_input_pending_ignore_squeezables.
+
2005-01-15 Steven Tamm <steventamm@mac.com>
* macterm.c (Vmac_use_core_graphics): defined for
\f
/* Global variable declarations. */
+/* Flags for readable_events. */
+#define READABLE_EVENTS_DO_TIMERS_NOW (1 << 0)
+#define READABLE_EVENTS_FILTER_EVENTS (1 << 1)
+#define READABLE_EVENTS_IGNORE_SQUEEZABLES (1 << 2)
+
/* Function for init_keyboard to call with no args (if nonzero). */
void (*keyboard_init_hook) ();
static int read_avail_input P_ ((int));
static void get_input_pending P_ ((int *, int));
-static void get_filtered_input_pending P_ ((int *, int, int));
static int readable_events P_ ((int));
-static int readable_filtered_events P_ ((int, int));
static Lisp_Object read_char_x_menu_prompt P_ ((int, Lisp_Object *,
Lisp_Object, int *));
static Lisp_Object read_char_x_menu_prompt ();
input has been processed. If the only input available was
the sort that we have just disabled, then we need to call
redisplay. */
- if (!readable_events (1))
+ if (!readable_events (READABLE_EVENTS_DO_TIMERS_NOW))
{
redisplay_preserve_echo_area (6);
- get_input_pending (&input_pending, 1);
+ get_input_pending (&input_pending,
+ READABLE_EVENTS_DO_TIMERS_NOW);
}
}
return Qnil;
/* Return true iff there are any events in the queue that read-char
would return. If this returns false, a read-char would block. */
static int
-readable_filtered_events (do_timers_now, filter_events)
- int do_timers_now;
- int filter_events;
+readable_events (flags)
+ int flags;
{
- if (do_timers_now)
- timer_check (do_timers_now);
+ if (flags & READABLE_EVENTS_DO_TIMERS_NOW)
+ timer_check (1);
- /* If the buffer contains only FOCUS_IN_EVENT events,
- and FILTER_EVENTS is nonzero, report it as empty. */
+ /* If the buffer contains only FOCUS_IN_EVENT events, and
+ READABLE_EVENTS_FILTER_EVENTS is set, report it as empty. */
if (kbd_fetch_ptr != kbd_store_ptr)
{
int have_live_event = 1;
- if (filter_events)
+ if (flags & READABLE_EVENTS_FILTER_EVENTS)
{
struct input_event *event;
}
#ifdef HAVE_MOUSE
- if (!NILP (do_mouse_tracking) && some_mouse_moved ())
+ if (!(flags & READABLE_EVENTS_IGNORE_SQUEEZABLES)
+ && !NILP (do_mouse_tracking) && some_mouse_moved ())
return 1;
#endif
if (single_kboard)
return 0;
}
-/* Return true iff there are any events in the queue that read-char
- would return. If this returns false, a read-char would block. */
-static int
-readable_events (do_timers_now)
- int do_timers_now;
-{
- return readable_filtered_events (do_timers_now, 0);
-}
-
/* Set this for debugging, to have a way to get out */
int stop_character;
}
old_timers_run = timers_run;
- get_input_pending (&input_pending, 1);
+ get_input_pending (&input_pending, READABLE_EVENTS_DO_TIMERS_NOW);
if (timers_run != old_timers_run && do_display)
redisplay_preserve_echo_area (7);
but works even if FIONREAD does not exist.
(In fact, this may actually read some input.)
- If DO_TIMERS_NOW is nonzero, actually run timer events that are ripe.
- If FILTER_EVENTS is nonzero, ignore internal events (FOCUS_IN_EVENT). */
+ If READABLE_EVENTS_DO_TIMERS_NOW is set in FLAGS, actually run
+ timer events that are ripe.
+ If READABLE_EVENTS_FILTER_EVENTS is set in FLAGS, ignore internal
+ events (FOCUS_IN_EVENT).
+ If READABLE_EVENTS_IGNORE_SQUEEZABLES is set in FLAGS, ignore mouse
+ movements. */
static void
-get_filtered_input_pending (addr, do_timers_now, filter_events)
+get_input_pending (addr, flags)
int *addr;
- int do_timers_now;
- int filter_events;
+ int flags;
{
/* First of all, have we already counted some input? */
- *addr = (!NILP (Vquit_flag)
- || readable_filtered_events (do_timers_now, filter_events));
+ *addr = (!NILP (Vquit_flag) || readable_events (flags));
/* If input is being read as it arrives, and we have none, there is none. */
if (*addr > 0 || (interrupt_input && ! interrupts_deferred))
/* Try to read some input and see how much we get. */
gobble_input (0);
- *addr = (!NILP (Vquit_flag)
- || readable_filtered_events (do_timers_now, filter_events));
-}
-
-/* Store into *addr a value nonzero if terminal input chars are available.
- Serves the purpose of ioctl (0, FIONREAD, addr)
- but works even if FIONREAD does not exist.
- (In fact, this may actually read some input.)
-
- If DO_TIMERS_NOW is nonzero, actually run timer events that are ripe. */
-
-static void
-get_input_pending (addr, do_timers_now)
- int *addr;
- int do_timers_now;
-{
- get_filtered_input_pending (addr, do_timers_now, 0);
+ *addr = (!NILP (Vquit_flag) || readable_events (flags));
}
/* Interface to read_avail_input, blocking SIGIO or SIGALRM if necessary. */
return input_pending;
}
+/* Return nonzero if input events other than mouse movements are
+ pending. */
+
+int
+detect_input_pending_ignore_squeezables ()
+{
+ if (!input_pending)
+ get_input_pending (&input_pending, READABLE_EVENTS_IGNORE_SQUEEZABLES);
+
+ return input_pending;
+}
+
/* Return nonzero if input events are pending, and run any pending timers. */
int
int old_timers_run = timers_run;
if (!input_pending)
- get_input_pending (&input_pending, 1);
+ get_input_pending (&input_pending, READABLE_EVENTS_DO_TIMERS_NOW);
if (old_timers_run != timers_run && do_display)
{
if (!NILP (Vunread_command_events) || unread_command_char != -1)
return (Qt);
- get_filtered_input_pending (&input_pending, 1, 1);
+ get_input_pending (&input_pending,
+ READABLE_EVENTS_DO_TIMERS_NOW
+ | READABLE_EVENTS_FILTER_EVENTS);
return input_pending > 0 ? Qt : Qnil;
}