aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-03-18 01:27:43 +0000
committerRichard M. Stallman1994-03-18 01:27:43 +0000
commit5ca2ef64f0ee2c0b57f929bd474bccc051289d06 (patch)
tree4d43cd5efcbc60546ac66b835e139245f722673c
parent5e9e88fde0a06dcf099b261eb9f08cdcd31beee6 (diff)
downloademacs-5ca2ef64f0ee2c0b57f929bd474bccc051289d06.tar.gz
emacs-5ca2ef64f0ee2c0b57f929bd474bccc051289d06.zip
(Fx_popup_dialog, Fx_popup_menu): Handle case where
mouse_position_hook doesn't store anything.
-rw-r--r--src/xmenu.c25
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.")
672 if (EQ (position, Qt)) 672 if (EQ (position, Qt))
673 { 673 {
674 /* Use the mouse's current position. */ 674 /* Use the mouse's current position. */
675 FRAME_PTR new_f; 675 FRAME_PTR new_f = 0;
676 Lisp_Object bar_window; 676 Lisp_Object bar_window;
677 int part; 677 int part;
678 unsigned long time; 678 unsigned long time;
679 679
680 (*mouse_position_hook) (&new_f, &bar_window, &part, &x, &y, &time); 680 if (new_f != 0)
681 XSET (window, Lisp_Frame, new_f); 681 XSET (window, Lisp_Frame, new_f);
682 else
683 {
684 window = selected_window;
685 XFASTINT (x) = 0;
686 XFASTINT (y) = 0;
687 }
682 } 688 }
683 else 689 else
684 { 690 {
@@ -884,13 +890,21 @@ cached information about equivalent key sequences.")
884 if (EQ (position, Qt)) 890 if (EQ (position, Qt))
885 { 891 {
886 /* Use the mouse's current position. */ 892 /* Use the mouse's current position. */
887 FRAME_PTR new_f; 893 FRAME_PTR new_f = 0;
888 Lisp_Object bar_window; 894 Lisp_Object bar_window;
889 int part; 895 int part;
890 unsigned long time; 896 unsigned long time;
891 897
892 (*mouse_position_hook) (&new_f, &bar_window, &part, &x, &y, &time); 898 (*mouse_position_hook) (&new_f, &bar_window, &part, &x, &y, &time);
893 XSET (window, Lisp_Frame, new_f); 899
900 if (new_f != 0)
901 XSET (window, Lisp_Frame, new_f);
902 else
903 {
904 window = selected_window;
905 XFASTINT (x) = 0;
906 XFASTINT (y) = 0;
907 }
894 } 908 }
895 909
896 CHECK_NUMBER (x, 0); 910 CHECK_NUMBER (x, 0);
@@ -1808,7 +1822,6 @@ xdialog_show (f, x, y, menubarp, keymaps, title, error)
1808 /* No selection has been chosen yet. */ 1822 /* No selection has been chosen yet. */
1809 menu_item_selection = 0; 1823 menu_item_selection = 0;
1810 1824
1811
1812 /* Display the menu. */ 1825 /* Display the menu. */
1813 lw_pop_up_all_widgets (dialog_id); 1826 lw_pop_up_all_widgets (dialog_id);
1814 1827