summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Ulbrich <[email protected]>2016-01-15 16:09:47 +0100
committerWolfgang Ulbrich <[email protected]>2016-01-15 16:09:47 +0100
commit2de22faab6d8918f6d5001edeb3f794cac829710 (patch)
treeb8dd8e221be8d6fdaefc4f5ea7299f0993e4ba87
parent76cad7a49fd7c5876e780bda4823d55a73ed2556 (diff)
downloadcaja-2de22faab6d8918f6d5001edeb3f794cac829710.tar.bz2
caja-2de22faab6d8918f6d5001edeb3f794cac829710.tar.xz
GTK3 general: don't use gdk_cursor_unref()
taken from: https://git.gnome.org/browse/nautilus/commit/?id=74a8f78
-rw-r--r--eel/eel-editable-label.c6
-rw-r--r--libcaja-private/caja-icon-canvas-item.c4
-rw-r--r--libcaja-private/caja-icon-container.c4
-rw-r--r--src/caja-window.c4
-rw-r--r--src/file-manager/fm-list-view.c4
-rw-r--r--src/file-manager/fm-properties-window.c4
6 files changed, 24 insertions, 2 deletions
diff --git a/eel/eel-editable-label.c b/eel/eel-editable-label.c
index 53c68df9..21dfd673 100644
--- a/eel/eel-editable-label.c
+++ b/eel/eel-editable-label.c
@@ -1926,12 +1926,14 @@ eel_editable_label_realize (GtkWidget *widget)
gtk_widget_set_window (widget, window);
gdk_window_set_user_data (window, widget);
- gdk_cursor_unref (attributes.cursor);
-
#if GTK_CHECK_VERSION(3,0,0)
+ g_object_unref (attributes.cursor);
+
style = gtk_widget_get_style_context (widget);
gtk_style_context_set_background (style, gtk_widget_get_window (widget));
#else
+ gdk_cursor_unref (attributes.cursor);
+
style = gtk_style_attach (gtk_widget_get_style (widget) , gtk_widget_get_window (widget));
gtk_widget_set_style (widget, style);
diff --git a/libcaja-private/caja-icon-canvas-item.c b/libcaja-private/caja-icon-canvas-item.c
index e8787406..21da113f 100644
--- a/libcaja-private/caja-icon-canvas-item.c
+++ b/libcaja-private/caja-icon-canvas-item.c
@@ -2592,7 +2592,11 @@ caja_icon_canvas_item_event (EelCanvasItem *item, GdkEvent *event)
cursor = gdk_cursor_new_for_display (gdk_display_get_default(),
GDK_HAND2);
gdk_window_set_cursor (((GdkEventAny *)event)->window, cursor);
+#if GTK_CHECK_VERSION(3,0,0)
+ g_object_unref (cursor);
+#else
gdk_cursor_unref (cursor);
+#endif
}
/* FIXME bugzilla.gnome.org 42473:
diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c
index a4f2fc1b..c6186295 100644
--- a/libcaja-private/caja-icon-container.c
+++ b/libcaja-private/caja-icon-container.c
@@ -5026,7 +5026,11 @@ start_stretching (CajaIconContainer *container)
cursor,
GDK_CURRENT_TIME);
if (cursor)
+#if GTK_CHECK_VERSION(3,0,0)
+ g_object_unref (cursor);
+#else
gdk_cursor_unref (cursor);
+#endif
/* Ensure the window itself is focused.. */
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (container));
diff --git a/src/caja-window.c b/src/caja-window.c
index 6a1cb402..1392bad2 100644
--- a/src/caja-window.c
+++ b/src/caja-window.c
@@ -417,7 +417,11 @@ update_cursor (CajaWindow *window)
{
cursor = gdk_cursor_new (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);
+#else
gdk_cursor_unref (cursor);
+#endif
}
else
{
diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c
index 56ff9b17..f78b080a 100644
--- a/src/file-manager/fm-list-view.c
+++ b/src/file-manager/fm-list-view.c
@@ -2960,11 +2960,15 @@ fm_list_view_click_policy_changed (FMDirectoryView *directory_view)
}
}
+#if GTK_CHECK_VERSION(3,0,0)
+ g_clear_object (&hand_cursor);
+#else
if (hand_cursor != NULL)
{
gdk_cursor_unref (hand_cursor);
hand_cursor = NULL;
}
+#endif
}
else if (click_policy_auto_value == CAJA_CLICK_POLICY_SINGLE)
{
diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c
index 87b75a6d..13b40b27 100644
--- a/src/file-manager/fm-properties-window.c
+++ b/src/file-manager/fm-properties-window.c
@@ -4067,7 +4067,11 @@ start_long_operation (FMPropertiesWindow *window)
cursor = gdk_cursor_new (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);
+#else
gdk_cursor_unref (cursor);
+#endif
}
window->details->long_operation_underway ++;
}