+2014-10-04 Jan Djärv <jan.h.d@swipnet.se>
+
+ * gtkutil.c (create_menus): Only add tearoffs to empty menus.
+ (xg_update_submenu): Remove has_tearoff_p, pass 1 to create_menus
+ for add_tearoff_p.
+
2014-10-04 Martin Rudalics <rudalics@gmx.at>
* buffer.c (scroll_bar_width, scroll_bar_height): Fix
#ifdef HAVE_GTK_TEAROFF_MENU_ITEM_NEW
if (! menu_bar_p && add_tearoff_p)
{
- GtkWidget *tearoff = gtk_tearoff_menu_item_new ();
- gtk_menu_shell_append (GTK_MENU_SHELL (wmenu), tearoff);
+ // Only add tearoff if menu is empty.
+ GList *list = gtk_container_get_children (GTK_CONTAINER (wmenu));
+ if (! list)
+ {
+ GtkWidget *tearoff = gtk_tearoff_menu_item_new ();
+ gtk_menu_shell_append (GTK_MENU_SHELL (wmenu), tearoff);
- g_signal_connect (G_OBJECT (tearoff), "activate",
- G_CALLBACK (tearoff_activate), 0);
+ g_signal_connect (G_OBJECT (tearoff), "activate",
+ G_CALLBACK (tearoff_activate), 0);
+ }
+ else
+ g_list_free (list);
}
#endif
GList *list = 0;
GList *iter;
widget_value *cur;
- bool has_tearoff_p = 0;
GList *first_radio = 0;
if (submenu)
/* Skip tearoff items, they have no counterpart in val. */
if (GTK_IS_TEAROFF_MENU_ITEM (w))
{
- has_tearoff_p = 1;
iter = g_list_next (iter);
if (iter) w = GTK_WIDGET (iter->data);
else break;
highlight_cb,
0,
0,
- ! has_tearoff_p,
+ 1,
submenu,
cl_data,
0);