]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.1289 v7.3.1289
authorBram Moolenaar <Bram@vim.org>
Wed, 3 Jul 2013 11:04:27 +0000 (13:04 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 3 Jul 2013 11:04:27 +0000 (13:04 +0200)
Problem:    Get GLIB warning when removing a menu item.
Solution:   Reference menu-id and also call gtk_container_remove().  (Ivan
            Krasilnikov)

src/gui_gtk.c
src/version.c

index ba2d23d1e9fcb8729ca613c29e99b81b6cc95ebd..48537f4490074b7eabcf3e93ce6fd9855d568b40 100644 (file)
@@ -613,6 +613,17 @@ gui_mch_menu_set_tip(vimmenu_T *menu)
     void
 gui_mch_destroy_menu(vimmenu_T *menu)
 {
+    /* Don't let gtk_container_remove automatically destroy menu->id. */
+    if (menu->id != NULL)
+       g_object_ref(menu->id);
+
+    /* Workaround for a spurious gtk warning in Ubuntu: "Trying to remove
+     * a child that doesn't believe we're it's parent."
+     * Remove widget from gui.menubar before destroying it. */
+    if (menu->id != NULL && gui.menubar != NULL
+                           && gtk_widget_get_parent(menu->id) == gui.menubar)
+       gtk_container_remove(GTK_CONTAINER(gui.menubar), menu->id);
+
 # ifdef FEAT_TOOLBAR
     if (menu->parent != NULL && menu_is_toolbar(menu->parent->name))
     {
@@ -632,6 +643,8 @@ gui_mch_destroy_menu(vimmenu_T *menu)
            gtk_widget_destroy(menu->id);
     }
 
+    if (menu->id != NULL)
+       g_object_unref(menu->id);
     menu->submenu_id = NULL;
     menu->id = NULL;
 }
index 4d14c4f73a267a8211f3832c46a204510d236a3e..33762fcb20c6099564460d708532e5d229df925f 100644 (file)
@@ -728,6 +728,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1289,
 /**/
     1288,
 /**/