summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Ulbrich <[email protected]>2016-01-15 20:42:24 +0100
committerWolfgang Ulbrich <[email protected]>2016-01-15 20:42:24 +0100
commit50970d1bb15d1f9c682e92dda345e59cfcf5330f (patch)
treec180dd1b1f6a57381daa88b0ad580b55f4279ed1
parentccfe6d5364ecfd8f3bafef853e6a9fc7457a0af4 (diff)
downloadcaja-50970d1bb15d1f9c682e92dda345e59cfcf5330f.tar.bz2
caja-50970d1bb15d1f9c682e92dda345e59cfcf5330f.tar.xz
don't use deprecated gdk_cursor_new for both toolkit versions
gdk_cursor_new i deprecated with gtk+-3.16 and gdk_cursor_new_for_display is available since 2.2
-rw-r--r--libcaja-private/caja-icon-container.c10
-rw-r--r--src/caja-window.c6
-rw-r--r--src/file-manager/fm-list-view.c4
-rw-r--r--src/file-manager/fm-properties-window.c4
4 files changed, 16 insertions, 8 deletions
diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c
index c6186295..049f2fc2 100644
--- a/libcaja-private/caja-icon-container.c
+++ b/libcaja-private/caja-icon-container.c
@@ -4974,11 +4974,13 @@ start_stretching (CajaIconContainer *container)
CajaIcon *icon;
EelDPoint world_point;
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. */
world_point.x = details->drag_x;
@@ -4991,16 +4993,16 @@ start_stretching (CajaIconContainer *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/caja-window.c b/src/caja-window.c
index 1392bad2..885815b8 100644
--- a/src/caja-window.c
+++ b/src/caja-window.c
@@ -415,7 +415,11 @@ update_cursor (CajaWindow *window)
if (slot->allow_stop)
{
- cursor = gdk_cursor_new (GDK_WATCH);
+ GdkDisplay *display;
+ GdkCursor * cursor;
+
+ 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);
#if GTK_CHECK_VERSION(3,0,0)
g_object_unref (cursor);
diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c
index f78b080a..fd25904a 100644
--- a/src/file-manager/fm-list-view.c
+++ b/src/file-manager/fm-list-view.c
@@ -2930,6 +2930,7 @@ fm_list_view_click_policy_changed (FMDirectoryView *directory_view)
GtkTreeView *tree;
view = FM_LIST_VIEW (directory_view);
+ display = gtk_widget_get_display (GTK_WIDGET (view));
/* ensure that we unset the hand cursor and refresh underlined rows */
if (click_policy_auto_value == CAJA_CLICK_POLICY_DOUBLE)
@@ -2953,7 +2954,6 @@ fm_list_view_click_policy_changed (FMDirectoryView *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);
@@ -2974,7 +2974,7 @@ fm_list_view_click_policy_changed (FMDirectoryView *directory_view)
{
if (hand_cursor == NULL)
{
- hand_cursor = gdk_cursor_new(GDK_HAND2);
+ hand_cursor = gdk_cursor_new_for_display (display, GDK_HAND2);
}
}
}
diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c
index 13b40b27..4f5d3bf0 100644
--- a/src/file-manager/fm-properties-window.c
+++ b/src/file-manager/fm-properties-window.c
@@ -4063,9 +4063,11 @@ start_long_operation (FMPropertiesWindow *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);
#if GTK_CHECK_VERSION(3,0,0)
g_object_unref (cursor);