aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1995-04-29 04:21:23 +0000
committerKarl Heuer1995-04-29 04:21:23 +0000
commit9572375bcc1d25aea708624bdfa0a9f66008770e (patch)
tree8f8a9f71968790f5db3be445e1890afee81f8b51 /src
parent5a8d99e0e7321dd1a5340b840f5adca9c529a664 (diff)
downloademacs-9572375bcc1d25aea708624bdfa0a9f66008770e.tar.gz
emacs-9572375bcc1d25aea708624bdfa0a9f66008770e.zip
(popup_get_selection): Use x_non_menubar_window_to_frame.
Either queue or dispatch the event, but not both. (dialog_selection_callback): Clear popup_activated_flag. (Fx_popup_menu): If POSITION is just (menu-bar), use the current mouse position. (menubar_selection_callback): Use (menu-bar) instead of 'menu-bar.
Diffstat (limited to 'src')
-rw-r--r--src/xmenu.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/xmenu.c b/src/xmenu.c
index 91c57f986c8..5ac3ca80951 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -763,7 +763,8 @@ cached information about equivalent key sequences.")
763 check_x (); 763 check_x ();
764 764
765 /* Decode the first argument: find the window and the coordinates. */ 765 /* Decode the first argument: find the window and the coordinates. */
766 if (EQ (position, Qt)) 766 if (EQ (position, Qt)
767 || (CONSP (position) && EQ (XCONS (position)->car, Qmenu_bar)))
767 { 768 {
768 /* Use the mouse's current position. */ 769 /* Use the mouse's current position. */
769 FRAME_PTR new_f = selected_frame; 770 FRAME_PTR new_f = selected_frame;
@@ -1078,12 +1079,14 @@ popup_get_selection (initial_event, dpyinfo)
1078 dpyinfo->grabbed &= ~(1 << event.xbutton.button); 1079 dpyinfo->grabbed &= ~(1 << event.xbutton.button);
1079 1080
1080 /* Queue all events not for this popup, 1081 /* Queue all events not for this popup,
1081 except for Expose, which we've already handled. */ 1082 except for Expose, which we've already handled.
1083 Note that the X window is associated with the frame if this
1084 is a menu bar popup, but not if it's a dialog box. So we use
1085 x_non_menubar_window_to_frame, not x_any_window_to_frame. */
1082 if (event.type != Expose 1086 if (event.type != Expose
1083 && (event.xany.display != dpyinfo->display 1087 && (event.xany.display != dpyinfo->display
1084 || ! x_any_window_to_frame (dpyinfo, event.xany.window))) 1088 || x_non_menubar_window_to_frame (dpyinfo, event.xany.window)))
1085 { 1089 {
1086
1087 queue_tmp = (struct event_queue *) malloc (sizeof (struct event_queue)); 1090 queue_tmp = (struct event_queue *) malloc (sizeof (struct event_queue));
1088 1091
1089 if (queue_tmp != NULL) 1092 if (queue_tmp != NULL)
@@ -1093,8 +1096,8 @@ popup_get_selection (initial_event, dpyinfo)
1093 queue = queue_tmp; 1096 queue = queue_tmp;
1094 } 1097 }
1095 } 1098 }
1096 1099 else
1097 XtDispatchEvent (&event); 1100 XtDispatchEvent (&event);
1098 1101
1099 if (!popup_activated ()) 1102 if (!popup_activated ())
1100 break; 1103 break;
@@ -1191,7 +1194,7 @@ menubar_selection_callback (widget, id, client_data)
1191 1194
1192 XSETFRAME (frame, f); 1195 XSETFRAME (frame, f);
1193 buf.kind = menu_bar_event; 1196 buf.kind = menu_bar_event;
1194 buf.frame_or_window = Fcons (frame, Qmenu_bar); 1197 buf.frame_or_window = Fcons (frame, Fcons (Qmenu_bar, Qnil));
1195 kbd_buffer_store_event (&buf); 1198 kbd_buffer_store_event (&buf);
1196 1199
1197 for (j = 0; j < submenu_depth; j++) 1200 for (j = 0; j < submenu_depth; j++)
@@ -1902,6 +1905,7 @@ dialog_selection_callback (widget, id, client_data)
1902 BLOCK_INPUT; 1905 BLOCK_INPUT;
1903 lw_destroy_all_widgets (id); 1906 lw_destroy_all_widgets (id);
1904 UNBLOCK_INPUT; 1907 UNBLOCK_INPUT;
1908 popup_activated_flag = 0;
1905} 1909}
1906 1910
1907static char * button_names [] = { 1911static char * button_names [] = {