diff options
author | raveit65 <[email protected]> | 2016-06-14 21:42:03 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2016-06-15 09:46:48 +0200 |
commit | 49163ff9ca68d0cfc3f759fa7b82c570c03a9dec (patch) | |
tree | dc1acb14db1949a43ba71410bc2c66b4a23cf8cb | |
parent | e3afef2d6a4ff033192337cd9788c262055e5fd6 (diff) | |
download | mate-desktop-49163ff9ca68d0cfc3f759fa7b82c570c03a9dec.tar.bz2 mate-desktop-49163ff9ca68d0cfc3f759fa7b82c570c03a9dec.tar.xz |
GTK+-3 about: do not use deprecated gdk_cursor_new and gdk_window_get_pointer
-rw-r--r-- | libmate-desktop/mate-aboutdialog.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/libmate-desktop/mate-aboutdialog.c b/libmate-desktop/mate-aboutdialog.c index 6e862b0..29d5737 100644 --- a/libmate-desktop/mate-aboutdialog.c +++ b/libmate-desktop/mate-aboutdialog.c @@ -460,11 +460,13 @@ mate_about_dialog_init (MateAboutDialog *about) { GtkDialog *dialog = GTK_DIALOG (about); MateAboutDialogPrivate *priv; + GdkDisplay *display; GtkWidget *vbox, *hbox, *button, *close_button, *image; _mate_desktop_init_i18n (); /* Data */ + display = gtk_widget_get_display (GTK_WIDGET (about)); priv = MATE_ABOUT_DIALOG_GET_PRIVATE (about); about->private_data = priv; @@ -480,8 +482,8 @@ mate_about_dialog_init (MateAboutDialog *about) priv->documenters = NULL; priv->artists = NULL; - priv->hand_cursor = gdk_cursor_new (GDK_HAND2); - priv->regular_cursor = gdk_cursor_new (GDK_XTERM); + priv->hand_cursor = gdk_cursor_new_for_display (display, GDK_HAND2); + priv->regular_cursor = gdk_cursor_new_for_display (display, GDK_XTERM); priv->hovering_over_link = FALSE; priv->wrap_license = FALSE; @@ -1889,9 +1891,20 @@ text_view_visibility_notify_event (GtkWidget *text_view, GdkEventVisibility *event, MateAboutDialog *about) { +#if GTK_CHECK_VERSION (3, 0, 0) + GdkDeviceManager *device_manager; + GdkDevice *device; +#endif gint wx, wy, bx, by; +#if GTK_CHECK_VERSION (3, 0, 0) + device_manager = gdk_display_get_device_manager (gtk_widget_get_display(text_view)); + device = gdk_device_manager_get_client_pointer (device_manager); + + gdk_window_get_device_position (gtk_widget_get_window (text_view), device, &wx, &wy, NULL); +#else gdk_window_get_pointer (gtk_widget_get_window (text_view), &wx, &wy, NULL); +#endif gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (text_view), GTK_TEXT_WINDOW_WIDGET, |