diff src/xmenu.c @ 52981:54482f5ea7be

Remove tear off capability for GTK popup menus. Since the context in Lisp is not present anymore, we don't know how to invoke the action for a menu item.
author Jan Djärv <jan.h.d@swipnet.se>
date Sun, 02 Nov 2003 16:47:32 +0000
parents 695cf19ef79e
children 1218a42792ea
line wrap: on
line diff
--- a/src/xmenu.c	Sun Nov 02 07:02:32 2003 +0000
+++ b/src/xmenu.c	Sun Nov 02 16:47:32 2003 +0000
@@ -1866,6 +1866,12 @@
       f->output_data.x->saved_menu_event->type = 0;
     }
 
+#ifdef USE_GTK
+  /* If we have detached menus, we must update deep so detached menus
+     also gets updated.  */
+  deep_p = deep_p || xg_have_tear_offs ();
+#endif
+
   if (deep_p)
     {
       /* Make a widget-value tree representing the entire menu trees.  */
@@ -2066,7 +2072,7 @@
   xg_crazy_callback_abort = 1;
   if (menubar_widget)
     {
-      /* The third arg is DEEP_P, which says to consider the entire
+      /* The fourth arg is DEEP_P, which says to consider the entire
 	 menu trees we supply, rather than just the menu bar item names.  */
       xg_modify_menubar_widgets (menubar_widget,
                                  f,
@@ -2343,17 +2349,13 @@
   gtk_widget_show_all (menu);
   gtk_menu_popup (GTK_MENU (menu), 0, 0, pos_func, &popup_x_y, i, 0);
 
-  xg_did_tearoff = 0;
   /* Set this to one.  popup_widget_loop increases it by one, so it becomes
      two.  show_help_echo uses this to detect popup menus.  */
   popup_activated_flag = 1;
   /* Process events that apply to the menu.  */
   popup_widget_loop ();
 
-  if (xg_did_tearoff)
-    xg_keep_popup (menu, xg_did_tearoff);
-  else
-    gtk_widget_destroy (menu);
+  gtk_widget_destroy (menu);
 
   /* Must reset this manually because the button release event is not passed
      to Emacs event loop. */