From 97473ee42d3f6b39a1ac7ba5cafd88a31159c7fb Mon Sep 17 00:00:00 2001 From: Martin Kutlak Date: Thu, 8 Jun 2017 12:09:34 +0200 Subject: [PATCH] wizard: replace deprecated gtk3 functions gdk_cursor_new was deprecated in version 3.16. https://developer.gnome.org/gdk3/stable/gdk3-Cursors.html#gdk-cursor-new gdk_display_get_device_manager was deprecated in version 3.20. https://developer.gnome.org/gdk3/stable/GdkDisplay.html#gdk-display-get-device-manager gtk_show_uri was deprecated in version 3.22 https://developer.gnome.org/gtk3/stable/gtk3-Filesystem-utilities.html#gtk-show-uri Signed-off-by: Martin Kutlak --- src/gui-wizard-gtk/wizard.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c index c5b0b7f..b9b27fe 100644 --- a/src/gui-wizard-gtk/wizard.c +++ b/src/gui-wizard-gtk/wizard.c @@ -627,7 +627,11 @@ static void open_browse_if_link(GtkWidget *text_view, GtkTextIter *iter) } GError *error = NULL; +#if ((GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 22) || (GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION == 22 && GTK_MICRO_VERSION < 5)) if (!gtk_show_uri(/* use default screen */ NULL, url, GDK_CURRENT_TIME, &error)) +#else + if (!gtk_show_uri_on_window(NULL, url, GDK_CURRENT_TIME, &error)) +#endif error_msg("Can't open url '%s': %s", url, error->message); break; @@ -765,8 +769,8 @@ static gboolean visibility_notify_event(GtkWidget *text_view, GdkEventVisibility gint wx, wy, bx, by; GdkWindow *win = gtk_text_view_get_window(GTK_TEXT_VIEW(text_view), GTK_TEXT_WINDOW_TEXT); - GdkDeviceManager *device_manager = gdk_display_get_device_manager(gdk_window_get_display (win)); - GdkDevice *pointer = gdk_device_manager_get_client_pointer(device_manager); + GdkSeat *display_seat = gdk_display_get_default_seat(gdk_window_get_display(win)); + GdkDevice *pointer = gdk_seat_get_pointer(display_seat); gdk_window_get_device_position(gtk_widget_get_window(text_view), pointer, &wx, &wy, NULL); gtk_text_view_window_to_buffer_coords(GTK_TEXT_VIEW(text_view), @@ -3873,8 +3877,8 @@ void create_assistant(GtkApplication *app, bool expert_mode) g_signal_connect (g_tv_event_log, "visibility-notify-event", G_CALLBACK (visibility_notify_event), NULL); g_signal_connect (gtk_text_view_get_buffer(g_tv_event_log), "changed", G_CALLBACK (on_log_changed), NULL); - hand_cursor = gdk_cursor_new (GDK_HAND2); - regular_cursor = gdk_cursor_new (GDK_XTERM); + hand_cursor = gdk_cursor_new_for_display(gdk_display_get_default(), GDK_HAND2); + regular_cursor = gdk_cursor_new_for_display(gdk_display_get_default(), GDK_XTERM); /* switch to right starting page */ on_page_prepare(g_assistant, gtk_notebook_get_nth_page(g_assistant, 0), NULL); -- 2.21.0