comparison 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
comparison
equal deleted inserted replaced
52980:46bcce3b9533 52981:54482f5ea7be
1864 deep_p = 1; 1864 deep_p = 1;
1865 f->output_data.x->saved_menu_event = (XEvent*)xmalloc (sizeof (XEvent)); 1865 f->output_data.x->saved_menu_event = (XEvent*)xmalloc (sizeof (XEvent));
1866 f->output_data.x->saved_menu_event->type = 0; 1866 f->output_data.x->saved_menu_event->type = 0;
1867 } 1867 }
1868 1868
1869 #ifdef USE_GTK
1870 /* If we have detached menus, we must update deep so detached menus
1871 also gets updated. */
1872 deep_p = deep_p || xg_have_tear_offs ();
1873 #endif
1874
1869 if (deep_p) 1875 if (deep_p)
1870 { 1876 {
1871 /* Make a widget-value tree representing the entire menu trees. */ 1877 /* Make a widget-value tree representing the entire menu trees. */
1872 1878
1873 struct buffer *prev = current_buffer; 1879 struct buffer *prev = current_buffer;
2064 2070
2065 #ifdef USE_GTK 2071 #ifdef USE_GTK
2066 xg_crazy_callback_abort = 1; 2072 xg_crazy_callback_abort = 1;
2067 if (menubar_widget) 2073 if (menubar_widget)
2068 { 2074 {
2069 /* The third arg is DEEP_P, which says to consider the entire 2075 /* The fourth arg is DEEP_P, which says to consider the entire
2070 menu trees we supply, rather than just the menu bar item names. */ 2076 menu trees we supply, rather than just the menu bar item names. */
2071 xg_modify_menubar_widgets (menubar_widget, 2077 xg_modify_menubar_widgets (menubar_widget,
2072 f, 2078 f,
2073 first_wv, 2079 first_wv,
2074 deep_p, 2080 deep_p,
2341 2347
2342 /* Display the menu. */ 2348 /* Display the menu. */
2343 gtk_widget_show_all (menu); 2349 gtk_widget_show_all (menu);
2344 gtk_menu_popup (GTK_MENU (menu), 0, 0, pos_func, &popup_x_y, i, 0); 2350 gtk_menu_popup (GTK_MENU (menu), 0, 0, pos_func, &popup_x_y, i, 0);
2345 2351
2346 xg_did_tearoff = 0;
2347 /* Set this to one. popup_widget_loop increases it by one, so it becomes 2352 /* Set this to one. popup_widget_loop increases it by one, so it becomes
2348 two. show_help_echo uses this to detect popup menus. */ 2353 two. show_help_echo uses this to detect popup menus. */
2349 popup_activated_flag = 1; 2354 popup_activated_flag = 1;
2350 /* Process events that apply to the menu. */ 2355 /* Process events that apply to the menu. */
2351 popup_widget_loop (); 2356 popup_widget_loop ();
2352 2357
2353 if (xg_did_tearoff) 2358 gtk_widget_destroy (menu);
2354 xg_keep_popup (menu, xg_did_tearoff);
2355 else
2356 gtk_widget_destroy (menu);
2357 2359
2358 /* Must reset this manually because the button release event is not passed 2360 /* Must reset this manually because the button release event is not passed
2359 to Emacs event loop. */ 2361 to Emacs event loop. */
2360 FRAME_X_DISPLAY_INFO (f)->grabbed = 0; 2362 FRAME_X_DISPLAY_INFO (f)->grabbed = 0;
2361 } 2363 }