From 02e184ac346e161dc407c8824a85df47c8dbe8a0 Mon Sep 17 00:00:00 2001 From: John Ellis Date: Sat, 28 Oct 2006 00:03:15 +0000 Subject: [PATCH] Fri Oct 27 19:45:32 2006 John Ellis * layout.c, ui_menu.c, ui_misc.c: Use g_object_ref_sink when gtk_object_sink is not available as it is deprecated. --- ChangeLog | 5 +++++ TODO | 2 ++ src/layout.c | 8 +++++++- src/ui_menu.c | 9 +++++++++ src/ui_misc.c | 11 ++++++++++- 5 files changed, 33 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ac3fb59b..418658b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Oct 27 19:45:32 2006 John Ellis + + * layout.c, ui_menu.c, ui_misc.c: Use g_object_ref_sink when + gtk_object_sink is not available as it is deprecated. + Wed Oct 25 15:17:38 2006 John Ellis * pixbuf-renderer.c (pixbuf_renderer_scroll): Fix long standing bug diff --git a/TODO b/TODO index b7a38fd6..ad74d863 100644 --- a/TODO +++ b/TODO @@ -99,6 +99,8 @@ Major: Minor (non blockers): ---------------------------------------------- + > update icon used for window to the (not so) new icon + d> allow multiple command line dirs to work as expected (ie contents of each are treated as given on command line) diff --git a/src/layout.c b/src/layout.c index a38ab2bd..baef16f2 100644 --- a/src/layout.c +++ b/src/layout.c @@ -257,9 +257,15 @@ static void layout_sort_button_press_cb(GtkWidget *widget, gpointer data) menu = submenu_add_sort(NULL, G_CALLBACK(layout_sort_menu_cb), lw, FALSE, FALSE, TRUE, lw->sort_method); - /* apparently the menu is never sunk, even on a popup */ + /* take ownership of menu */ +#ifdef GTK_OBJECT_FLOATING + /* GTK+ < 2.10 */ g_object_ref(G_OBJECT(menu)); gtk_object_sink(GTK_OBJECT(menu)); +#else + /* GTK+ >= 2.10 */ + g_object_ref_sink(G_OBJECT(menu)); +#endif /* ascending option */ menu_item_add_divider(menu); diff --git a/src/ui_menu.c b/src/ui_menu.c index 5e83560f..198a9b78 100644 --- a/src/ui_menu.c +++ b/src/ui_menu.c @@ -130,8 +130,17 @@ GtkWidget *popup_menu_short_lived(void) GtkWidget *menu; menu = gtk_menu_new(); + + /* take ownership of menu */ +#ifdef GTK_OBJECT_FLOATING + /* GTK+ < 2.10 */ g_object_ref(G_OBJECT(menu)); gtk_object_sink(GTK_OBJECT(menu)); +#else + /* GTK+ >= 2.10 */ + g_object_ref_sink(G_OBJECT(menu)); +#endif + g_signal_connect(G_OBJECT(menu), "selection_done", G_CALLBACK(popup_menu_short_lived_cb), menu); return menu; diff --git a/src/ui_misc.c b/src/ui_misc.c index 38873c8a..ce510e26 100644 --- a/src/ui_misc.c +++ b/src/ui_misc.c @@ -738,8 +738,17 @@ GtkWidget *pref_toolbar_new(GtkWidget *parent_box, GtkToolbarStyle style) } tips = gtk_tooltips_new(); + + /* take ownership of tooltips */ +#ifdef GTK_OBJECT_FLOATING + /* GTK+ < 2.10 */ g_object_ref(G_OBJECT(tips)); - gtk_object_sink(GTK_OBJECT(tips)); + gtk_object_sink(GTK_OBJECT(tips)); +#else + /* GTK+ >= 2.10 */ + g_object_ref_sink(G_OBJECT(tips)); +#endif + g_object_set_data(G_OBJECT(tbar), "tooltips", tips); g_signal_connect(G_OBJECT(tbar), "destroy", G_CALLBACK(pref_toolbar_destroy_cb), tips); -- 2.20.1