diff --git a/ChangeLog b/ChangeLog index f00169ecfc..47d8a15252 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2002-02-09 Matthias Clasen + + * gtk/gtknotebook.c (gtk_notebook_set_focus_child): Avoid segfault + for selectable tab labels (even without a segfault, they make the + notebook almost unusable, though). (#69985) + +2002-02-08 Matthias Clasen + + * gtk/gtkmenuitem.c (gtk_menu_item_set_accel_path): Silently do + nothing if the parent is not a menu. (#66492) + +2002-02-06 Matthias Clasen + + * gtk/gtkitemfactory.c (gtk_item_factory_from_widget, + gtk_item_factory_path_from_widget): Try fetching the return value + from menu_item->submenu as a fallback. (#69020) + Sat Feb 9 22:57:43 2002 Kristian Rietveld * gtk/gtktreemodelsort.c (gtk_tree_model_sort_build_level): convert diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index f00169ecfc..47d8a15252 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,20 @@ +2002-02-09 Matthias Clasen + + * gtk/gtknotebook.c (gtk_notebook_set_focus_child): Avoid segfault + for selectable tab labels (even without a segfault, they make the + notebook almost unusable, though). (#69985) + +2002-02-08 Matthias Clasen + + * gtk/gtkmenuitem.c (gtk_menu_item_set_accel_path): Silently do + nothing if the parent is not a menu. (#66492) + +2002-02-06 Matthias Clasen + + * gtk/gtkitemfactory.c (gtk_item_factory_from_widget, + gtk_item_factory_path_from_widget): Try fetching the return value + from menu_item->submenu as a fallback. (#69020) + Sat Feb 9 22:57:43 2002 Kristian Rietveld * gtk/gtktreemodelsort.c (gtk_tree_model_sort_build_level): convert diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index f00169ecfc..47d8a15252 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,20 @@ +2002-02-09 Matthias Clasen + + * gtk/gtknotebook.c (gtk_notebook_set_focus_child): Avoid segfault + for selectable tab labels (even without a segfault, they make the + notebook almost unusable, though). (#69985) + +2002-02-08 Matthias Clasen + + * gtk/gtkmenuitem.c (gtk_menu_item_set_accel_path): Silently do + nothing if the parent is not a menu. (#66492) + +2002-02-06 Matthias Clasen + + * gtk/gtkitemfactory.c (gtk_item_factory_from_widget, + gtk_item_factory_path_from_widget): Try fetching the return value + from menu_item->submenu as a fallback. (#69020) + Sat Feb 9 22:57:43 2002 Kristian Rietveld * gtk/gtktreemodelsort.c (gtk_tree_model_sort_build_level): convert diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index f00169ecfc..47d8a15252 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,20 @@ +2002-02-09 Matthias Clasen + + * gtk/gtknotebook.c (gtk_notebook_set_focus_child): Avoid segfault + for selectable tab labels (even without a segfault, they make the + notebook almost unusable, though). (#69985) + +2002-02-08 Matthias Clasen + + * gtk/gtkmenuitem.c (gtk_menu_item_set_accel_path): Silently do + nothing if the parent is not a menu. (#66492) + +2002-02-06 Matthias Clasen + + * gtk/gtkitemfactory.c (gtk_item_factory_from_widget, + gtk_item_factory_path_from_widget): Try fetching the return value + from menu_item->submenu as a fallback. (#69020) + Sat Feb 9 22:57:43 2002 Kristian Rietveld * gtk/gtktreemodelsort.c (gtk_tree_model_sort_build_level): convert diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index f00169ecfc..47d8a15252 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,20 @@ +2002-02-09 Matthias Clasen + + * gtk/gtknotebook.c (gtk_notebook_set_focus_child): Avoid segfault + for selectable tab labels (even without a segfault, they make the + notebook almost unusable, though). (#69985) + +2002-02-08 Matthias Clasen + + * gtk/gtkmenuitem.c (gtk_menu_item_set_accel_path): Silently do + nothing if the parent is not a menu. (#66492) + +2002-02-06 Matthias Clasen + + * gtk/gtkitemfactory.c (gtk_item_factory_from_widget, + gtk_item_factory_path_from_widget): Try fetching the return value + from menu_item->submenu as a fallback. (#69020) + Sat Feb 9 22:57:43 2002 Kristian Rietveld * gtk/gtktreemodelsort.c (gtk_tree_model_sort_build_level): convert diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index f00169ecfc..47d8a15252 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,20 @@ +2002-02-09 Matthias Clasen + + * gtk/gtknotebook.c (gtk_notebook_set_focus_child): Avoid segfault + for selectable tab labels (even without a segfault, they make the + notebook almost unusable, though). (#69985) + +2002-02-08 Matthias Clasen + + * gtk/gtkmenuitem.c (gtk_menu_item_set_accel_path): Silently do + nothing if the parent is not a menu. (#66492) + +2002-02-06 Matthias Clasen + + * gtk/gtkitemfactory.c (gtk_item_factory_from_widget, + gtk_item_factory_path_from_widget): Try fetching the return value + from menu_item->submenu as a fallback. (#69020) + Sat Feb 9 22:57:43 2002 Kristian Rietveld * gtk/gtktreemodelsort.c (gtk_tree_model_sort_build_level): convert diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index f00169ecfc..47d8a15252 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,20 @@ +2002-02-09 Matthias Clasen + + * gtk/gtknotebook.c (gtk_notebook_set_focus_child): Avoid segfault + for selectable tab labels (even without a segfault, they make the + notebook almost unusable, though). (#69985) + +2002-02-08 Matthias Clasen + + * gtk/gtkmenuitem.c (gtk_menu_item_set_accel_path): Silently do + nothing if the parent is not a menu. (#66492) + +2002-02-06 Matthias Clasen + + * gtk/gtkitemfactory.c (gtk_item_factory_from_widget, + gtk_item_factory_path_from_widget): Try fetching the return value + from menu_item->submenu as a fallback. (#69020) + Sat Feb 9 22:57:43 2002 Kristian Rietveld * gtk/gtktreemodelsort.c (gtk_tree_model_sort_build_level): convert diff --git a/gtk/gtkitemfactory.c b/gtk/gtkitemfactory.c index 732c514561..6e61ab5644 100644 --- a/gtk/gtkitemfactory.c +++ b/gtk/gtkitemfactory.c @@ -577,9 +577,19 @@ gtk_item_factory_finalize (GObject *object) GtkItemFactory* gtk_item_factory_from_widget (GtkWidget *widget) { + GtkItemFactory *ifactory; + g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); - return gtk_object_get_data_by_id (GTK_OBJECT (widget), quark_item_factory); + ifactory = gtk_object_get_data_by_id (GTK_OBJECT (widget), quark_item_factory); + if (ifactory == NULL && GTK_IS_MENU_ITEM (widget) && + GTK_MENU_ITEM (widget)->submenu != NULL) + { + GtkWidget *menu = GTK_MENU_ITEM (widget)->submenu; + ifactory = gtk_object_get_data_by_id (GTK_OBJECT (menu), quark_item_factory); + } + + return ifactory; } /** @@ -597,9 +607,20 @@ gtk_item_factory_from_widget (GtkWidget *widget) G_CONST_RETURN gchar* gtk_item_factory_path_from_widget (GtkWidget *widget) { + gchar* path; + g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); - return gtk_object_get_data_by_id (GTK_OBJECT (widget), quark_item_path); + path = gtk_object_get_data_by_id (GTK_OBJECT (widget), quark_item_path); + + if (path == NULL && GTK_IS_MENU_ITEM (widget) && + GTK_MENU_ITEM (widget)->submenu != NULL) + { + GtkWidget *menu = GTK_MENU_ITEM (widget)->submenu; + path = gtk_object_get_data_by_id (GTK_OBJECT (menu), quark_item_path); + } + + return path; } /** diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c index 06a47ed0ff..6b22ca714b 100644 --- a/gtk/gtkmenuitem.c +++ b/gtk/gtkmenuitem.c @@ -1124,7 +1124,7 @@ gtk_menu_item_set_accel_path (GtkMenuItem *menu_item, gtk_widget_set_accel_path (widget, NULL, NULL); /* install accelerators associated with new path */ - if (widget->parent) + if (widget->parent && GTK_IS_MENU (widget->parent)) { GtkMenu *menu = GTK_MENU (widget->parent); diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index e0872bb849..269d796c09 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -2068,7 +2068,7 @@ gtk_notebook_focus (GtkWidget *widget, g_assert_not_reached (); return FALSE; } - + static void gtk_notebook_set_focus_child (GtkContainer *container, GtkWidget *child) @@ -2091,15 +2091,18 @@ gtk_notebook_set_focus_child (GtkContainer *container, if (page_child->parent == GTK_WIDGET (container)) { GList *list = gtk_notebook_find_child (notebook, page_child, NULL); - GtkNotebookPage *page = list->data; - - if (page->last_focus_child) - g_object_remove_weak_pointer (G_OBJECT (page->last_focus_child), (gpointer *)&page->last_focus_child); - - page->last_focus_child = GTK_WINDOW (toplevel)->focus_widget; - g_object_add_weak_pointer (G_OBJECT (page->last_focus_child), (gpointer *)&page->last_focus_child); + if (list != NULL) + { + GtkNotebookPage *page = list->data; - break; + if (page->last_focus_child) + g_object_remove_weak_pointer (G_OBJECT (page->last_focus_child), (gpointer *)&page->last_focus_child); + + page->last_focus_child = GTK_WINDOW (toplevel)->focus_widget; + g_object_add_weak_pointer (G_OBJECT (page->last_focus_child), (gpointer *)&page->last_focus_child); + + break; + } } page_child = page_child->parent;