summaryrefslogtreecommitdiff
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2000-08-18 03:13:27 +0000
committerGerd Moellmann <gerd@gnu.org>2000-08-18 03:13:27 +0000
commitfa4f8a498bb9fda2e89474f0b420c8e412b73d79 (patch)
tree973792fa8cbb0ad544d7ec28d4593ca6ab0c65be /src/keyboard.c
parent6a7e5093e7685f9a3fbd3241d6137244b99aeb7a (diff)
downloademacs-fa4f8a498bb9fda2e89474f0b420c8e412b73d79.tar.gz
(kbd_buffer_get_event): Handle the case that the
second half of a HELP_EVENT is found at the start of kbd_buffer.
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 4d48c22f30e..97687aad09f 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -3474,22 +3474,26 @@ kbd_buffer_get_event (kbp, used_mouse_menu)
kbd_fetch_ptr = event + 1;
else if (event->kind == HELP_EVENT)
{
- /* There are always two consecutive HELP_EVENTs in the
- input queue. */
+ /* There are always two HELP_EVENTs in the input queue. */
Lisp_Object object, position, help, frame, window;
-
+
xassert (event->code == 0);
frame = event->frame_or_window;
object = event->arg;
position = event->x;
- xassert ((event + 1)->code == 1);
- help = (event + 1)->arg;
- window = (event + 1)->frame_or_window;
+
+ kbd_fetch_ptr = event + 1;
+ event = ((kbd_fetch_ptr < kbd_buffer + KBD_BUFFER_SIZE)
+ ? kbd_fetch_ptr
+ : kbd_buffer);
+ xassert (event->code == 1);
+ help = event->arg;
+ window = event->frame_or_window;
if (!WINDOWP (window))
window = Qnil;
obj = Fcons (Qhelp_echo,
list5 (frame, help, window, object, position));
- kbd_fetch_ptr = event + 2;
+ kbd_fetch_ptr = event + 1;
}
else if (event->kind == FOCUS_IN_EVENT)
{