[nautilus/wip/gbsneto/other-locations] project: drop gdk_cursor_new usage



commit 8dc020d952165ed00c76cf1367dff5ba39c09f6b
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Thu Jul 16 13:32:32 2015 -0300

    project: drop gdk_cursor_new usage
    
    The gdk_cursor_new function is deprecated and it's
    replacement, gdk_cursor_new_for_display, should be
    used instead.
    
    Use gdk_cursor_new_for_display instead of gdk_cursor_new.

 libnautilus-private/nautilus-canvas-container.c |   10 ++++++----
 src/nautilus-list-view.c                        |    2 +-
 src/nautilus-properties-window.c                |    2 +-
 src/nautilus-window.c                           |    2 +-
 4 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/libnautilus-private/nautilus-canvas-container.c b/libnautilus-private/nautilus-canvas-container.c
index 67a8cb8..e3a975c 100644
--- a/libnautilus-private/nautilus-canvas-container.c
+++ b/libnautilus-private/nautilus-canvas-container.c
@@ -4155,12 +4155,14 @@ start_stretching (NautilusCanvasContainer *container)
 {
        NautilusCanvasContainerDetails *details;
        NautilusCanvasIcon *icon;
+        GdkDisplay *display;
        GtkWidget *toplevel;
        GtkCornerType corner;
        GdkCursor *cursor;
 
        details = container->details;
        icon = details->stretch_icon;
+        display = gtk_widget_get_display (GTK_WIDGET (container));
        
        /* Check if we hit the stretch handles. */
        if (!nautilus_canvas_item_hit_test_stretch_handles (icon->item,
@@ -4171,16 +4173,16 @@ start_stretching (NautilusCanvasContainer *container)
 
        switch (corner) {
        case GTK_CORNER_TOP_LEFT:
-               cursor = gdk_cursor_new (GDK_TOP_LEFT_CORNER);
+               cursor = gdk_cursor_new_for_display (display, GDK_TOP_LEFT_CORNER);
                break;
        case GTK_CORNER_BOTTOM_LEFT:
-               cursor = gdk_cursor_new (GDK_BOTTOM_LEFT_CORNER);
+               cursor = gdk_cursor_new_for_display (display, GDK_BOTTOM_LEFT_CORNER);
                break;
        case GTK_CORNER_TOP_RIGHT:
-               cursor = gdk_cursor_new (GDK_TOP_RIGHT_CORNER);
+               cursor = gdk_cursor_new_for_display (display, GDK_TOP_RIGHT_CORNER);
                break;
        case GTK_CORNER_BOTTOM_RIGHT:
-               cursor = gdk_cursor_new (GDK_BOTTOM_RIGHT_CORNER);
+               cursor = gdk_cursor_new_for_display (display, GDK_BOTTOM_RIGHT_CORNER);
                break;
        default: 
                cursor = NULL;
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index 933249d..540afde 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -2986,7 +2986,7 @@ nautilus_list_view_click_policy_changed (NautilusFilesView *directory_view)
                g_clear_object (&hand_cursor);
        } else if (get_click_policy () == NAUTILUS_CLICK_POLICY_SINGLE) {
                if (hand_cursor == NULL) {
-                       hand_cursor = gdk_cursor_new(GDK_HAND2);
+                       hand_cursor = gdk_cursor_new_for_display (gtk_widget_get_display (GTK_WIDGET (view)), 
GDK_HAND2);
                }
        }
 }
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index 4ad4d8b..d153e88 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -3105,7 +3105,7 @@ start_long_operation (NautilusPropertiesWindow *window)
                /* start long operation */
                GdkCursor * cursor;
                
-               cursor = gdk_cursor_new (GDK_WATCH);
+               cursor = gdk_cursor_new_for_display (gtk_widget_get_display (GTK_WIDGET (window)), GDK_WATCH);
                gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (window)), cursor);
                g_object_unref (cursor);
        }
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 28fde51..a20617d 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -828,7 +828,7 @@ update_cursor (NautilusWindow *window)
        slot = nautilus_window_get_active_slot (window);
 
        if (nautilus_window_slot_get_allow_stop (slot)) {
-               cursor = gdk_cursor_new (GDK_WATCH);
+               cursor = gdk_cursor_new_for_display (gtk_widget_get_display (GTK_WIDGET (window)), GDK_WATCH);
                gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (window)), cursor);
                g_object_unref (cursor);
        } else {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]