From: Christian Dywan Date: Fri, 2 Apr 2010 16:54:29 +0000 (+0200) Subject: Update uses of deprecated GTK+ macros and API X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2f0f16dd2cfcfe08fc07715dbb7a314b98f9f1e;p=midori Update uses of deprecated GTK+ macros and API --- diff --git a/midori/midori-browser.c b/midori/midori-browser.c index a72916c3..19eefe9e 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -5658,7 +5658,7 @@ midori_browser_size_allocate_cb (MidoriBrowser* browser, { GtkWidget* widget = GTK_WIDGET (browser); - if (GTK_WIDGET_REALIZED (widget) && !browser->alloc_timeout) + if (gtk_widget_get_realized (widget) && !browser->alloc_timeout) { gpointer last_page; @@ -6681,7 +6681,8 @@ midori_browser_toolbar_item_button_press_event_cb (GtkWidget* toolitem, if (event->button == 2) { GtkWidget* parent = gtk_widget_get_parent (toolitem); - GtkAction* action = gtk_widget_get_action (parent); + GtkAction* action = gtk_activatable_get_related_action ( + GTK_ACTIVATABLE (parent)); return midori_browser_menu_middle_click_on_navigation_action (browser, action); } diff --git a/midori/midori-view.c b/midori/midori-view.c index 7a90c4dc..6c8fd0d3 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -2340,7 +2340,7 @@ midori_view_populate_popup (MidoriView* view, menuitem = sokoke_action_create_popup_menu_item ( gtk_action_group_get_action (actions, "Encoding")); gtk_menu_shell_append (menu_shell, menuitem); - if (GTK_WIDGET_IS_SENSITIVE (menuitem)) + if (gtk_widget_get_sensitive (menuitem)) { GtkWidget* sub_menu; static const GtkActionEntry encodings[] = { diff --git a/midori/sokoke.c b/midori/sokoke.c index 8bcafe6b..2eeb6684 100644 --- a/midori/sokoke.c +++ b/midori/sokoke.c @@ -859,7 +859,8 @@ sokoke_get_desktop (void) GdkDisplay* display = gdk_display_get_default (); Display* xdisplay = GDK_DISPLAY_XDISPLAY (display); Window root_window = RootWindow (xdisplay, 0); - Atom save_mode_atom = gdk_x11_get_xatom_by_name ("_DT_SAVE_MODE"); + Atom save_mode_atom = gdk_x11_get_xatom_by_name_for_display ( + display, "_DT_SAVE_MODE"); Atom actual_type; int actual_format; unsigned long n_items, bytes; @@ -1016,7 +1017,7 @@ sokoke_entry_set_default_text (GtkEntry* entry, PANGO_STYLE_ITALIC); gtk_entry_set_text (entry, default_text); } - else if (!GTK_WIDGET_HAS_FOCUS (GTK_WIDGET (entry))) + else if (!gtk_widget_has_focus (GTK_WIDGET (entry))) { gint has_default = GPOINTER_TO_INT ( g_object_get_data (G_OBJECT (entry), "sokoke_has_default")); diff --git a/midori/sokoke.h b/midori/sokoke.h index fbd9e38c..8ad6a8d0 100644 --- a/midori/sokoke.h +++ b/midori/sokoke.h @@ -39,6 +39,11 @@ #define gtk_widget_is_toplevel(widget) GTK_WIDGET_TOPLEVEL (widget) #define gtk_widget_has_focus(widget) GTK_WIDGET_HAS_FOCUS (widget) #define gtk_widget_get_visible(widget) GTK_WIDGET_VISIBLE (widget) + #define gtk_widget_get_sensitive(widget) GTK_WIDGET_IS_SENSITIVE (widget) +#endif + +#if !GTK_CHECK_VERSION (2, 20, 0) + #define gtk_widget_get_realized(widget) GTK_WIDGET_REALIZED (widget) #endif #if !GTK_CHECK_VERSION(2, 12, 0)