diff options
author | Richard M. Stallman <rms@gnu.org> | 1994-03-18 01:27:43 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1994-03-18 01:27:43 +0000 |
commit | 5ca2ef64f0ee2c0b57f929bd474bccc051289d06 (patch) | |
tree | 4d43cd5efcbc60546ac66b835e139245f722673c /src/xmenu.c | |
parent | 5e9e88fde0a06dcf099b261eb9f08cdcd31beee6 (diff) | |
download | emacs-5ca2ef64f0ee2c0b57f929bd474bccc051289d06.tar.gz |
(Fx_popup_dialog, Fx_popup_menu): Handle case where
mouse_position_hook doesn't store anything.
Diffstat (limited to 'src/xmenu.c')
-rw-r--r-- | src/xmenu.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/xmenu.c b/src/xmenu.c index 1d3bf19857c..4a38b7f3bc5 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -672,13 +672,19 @@ cached information about equivalent key sequences.") if (EQ (position, Qt)) { /* Use the mouse's current position. */ - FRAME_PTR new_f; + FRAME_PTR new_f = 0; Lisp_Object bar_window; int part; unsigned long time; - (*mouse_position_hook) (&new_f, &bar_window, &part, &x, &y, &time); - XSET (window, Lisp_Frame, new_f); + if (new_f != 0) + XSET (window, Lisp_Frame, new_f); + else + { + window = selected_window; + XFASTINT (x) = 0; + XFASTINT (y) = 0; + } } else { @@ -884,13 +890,21 @@ cached information about equivalent key sequences.") if (EQ (position, Qt)) { /* Use the mouse's current position. */ - FRAME_PTR new_f; + FRAME_PTR new_f = 0; Lisp_Object bar_window; int part; unsigned long time; (*mouse_position_hook) (&new_f, &bar_window, &part, &x, &y, &time); - XSET (window, Lisp_Frame, new_f); + + if (new_f != 0) + XSET (window, Lisp_Frame, new_f); + else + { + window = selected_window; + XFASTINT (x) = 0; + XFASTINT (y) = 0; + } } CHECK_NUMBER (x, 0); @@ -1808,7 +1822,6 @@ xdialog_show (f, x, y, menubarp, keymaps, title, error) /* No selection has been chosen yet. */ menu_item_selection = 0; - /* Display the menu. */ lw_pop_up_all_widgets (dialog_id); |