Use gtk_widget_is_toplevel if available instead of the macro

This commit is contained in:
Christian Dywan 2010-01-29 22:44:34 +01:00
parent cc6bb8fddb
commit 1a0573e2f3
2 changed files with 4 additions and 3 deletions

View file

@ -2901,7 +2901,7 @@ midori_view_web_inspector_construct_window (gpointer inspector,
g_free (title);
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (view));
if (GTK_WIDGET_TOPLEVEL (toplevel))
if (gtk_widget_is_toplevel (toplevel))
{
screen = gtk_window_get_screen (GTK_WINDOW (toplevel));
width = gdk_screen_get_width (screen) / 1.7;
@ -4391,7 +4391,7 @@ midori_view_print (MidoriView* view)
{
GtkWidget* window = gtk_widget_get_toplevel (GTK_WIDGET (view));
GtkWidget* dialog = gtk_message_dialog_new (
GTK_WIDGET_TOPLEVEL (window) ? GTK_WINDOW (window) : NULL,
gtk_widget_is_toplevel (window) ? GTK_WINDOW (window) : NULL,
GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE, "%s", error->message);
g_error_free (error);

View file

@ -30,7 +30,8 @@
#endif
#if !GTK_CHECK_VERSION (2, 18, 0)
#define gtk_widget_has_focus(widget) GTK_WIDGET_HAS_FOCUS (widget)
#define gtk_widget_is_toplevel(widget) GTK_WIDGET_TOPLEVEL (widget)
#define gtk_widget_has_focus(widget) GTK_WIDGET_HAS_FOCUS (widget)
#endif
#if !GTK_CHECK_VERSION(2, 12, 0)