# HG changeset patch # User Richard M. Stallman # Date 782898564 0 # Node ID 38a4e4386aed953adb2f90ed30adc2c0c7770396 # Parent 49eee3cb0ffa6b1d41872be911767bd6a0bc7a29 (kbd_buffer_get_event): Cope if mouse_position_hook does not store anything. diff -r 49eee3cb0ffa -r 38a4e4386aed src/keyboard.c --- a/src/keyboard.c Sun Oct 23 07:45:25 1994 +0000 +++ b/src/keyboard.c Sun Oct 23 07:49:24 1994 +0000 @@ -2210,6 +2210,10 @@ Lisp_Object x, y; unsigned long time; + /* Note that this uses F to determine which display to look at. + If there is no valid info, it does not store anything + so x remains nil. */ + x = Qnil; (*mouse_position_hook) (&f, &bar_window, &part, &x, &y, &time); obj = Qnil; @@ -2218,7 +2222,7 @@ /* Decide if we should generate a switch-frame event. Don't generate switch-frame events for motion outside of all Emacs frames. */ - if (f) + if (!NILP (x) && f) { Lisp_Object frame; @@ -2236,7 +2240,7 @@ #if defined (MULTI_FRAME) || defined (HAVE_MOUSE) /* If we didn't decide to make a switch-frame event, go ahead and return a mouse-motion event. */ - if (NILP (obj)) + if (!NILP (x) && NILP (obj)) obj = make_lispy_movement (f, bar_window, part, x, y, time); #endif }