project: replace deprecated gdk_cursor_new

In 3.16 release gdk_cursor_new was deprecated in
favor of gdk_cursor_new_for_display.

Nautilus, however, did not updated to use the
proposed function, and is still using the deprecated
method.

Fix that by using the proposed gdk_cursor_new_for_display
method.
This commit is contained in:
Georges Basile Stavracas Neto 2015-07-21 18:00:31 -03:00
parent 70a7ad4470
commit e6a2a3f4b7
4 changed files with 16 additions and 9 deletions

View file

@ -4156,11 +4156,13 @@ start_stretching (NautilusCanvasContainer *container)
NautilusCanvasContainerDetails *details;
NautilusCanvasIcon *icon;
GtkWidget *toplevel;
GdkDisplay *display;
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;

View file

@ -2963,6 +2963,7 @@ nautilus_list_view_click_policy_changed (NautilusView *directory_view)
GtkTreeView *tree;
view = NAUTILUS_LIST_VIEW (directory_view);
display = gtk_widget_get_display (GTK_WIDGET (view));
/* ensure that we unset the hand cursor and refresh underlined rows */
if (get_click_policy () == NAUTILUS_CLICK_POLICY_DOUBLE) {
@ -2982,7 +2983,6 @@ nautilus_list_view_click_policy_changed (NautilusView *directory_view)
win = gtk_widget_get_window (GTK_WIDGET (tree));
gdk_window_set_cursor (win, NULL);
display = gtk_widget_get_display (GTK_WIDGET (view));
if (display != NULL) {
gdk_display_flush (display);
}
@ -2991,7 +2991,7 @@ nautilus_list_view_click_policy_changed (NautilusView *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 (display, GDK_HAND2);
}
}
}

View file

@ -3103,9 +3103,11 @@ start_long_operation (NautilusPropertiesWindow *window)
{
if (window->details->long_operation_underway == 0) {
/* start long operation */
GdkDisplay *display;
GdkCursor * cursor;
cursor = gdk_cursor_new (GDK_WATCH);
display = gtk_widget_get_display (GTK_WIDGET (window));
cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (window)), cursor);
g_object_unref (cursor);
}

View file

@ -761,7 +761,10 @@ 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);
GdkDisplay *display;
display = gtk_widget_get_display (GTK_WIDGET (window));
cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (window)), cursor);
g_object_unref (cursor);
} else {