[libegg] Use g_object_unref to unref GdkCursor with GTK+ 3.0.0



commit 4e35ccd0bcbe8f160ebc1c1de5893176d76c4751
Author: Xan Lopez <xan gnome org>
Date:   Sat Feb 12 22:41:41 2011 +0100

    Use g_object_unref to unref GdkCursor with GTK+ 3.0.0
    
    gdk_cursor_unref is deprecated.

 libegg/datetime/egg-datetime.c              |    4 ++++
 libegg/dock/egg-dock-item.c                 |    4 ++++
 libegg/toolbareditor/egg-editable-toolbar.c |    4 ++++
 libegg/toolbareditor/egg-toolbar-editor.c   |    4 ++++
 4 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/libegg/datetime/egg-datetime.c b/libegg/datetime/egg-datetime.c
index 8299115..8b270ca 100644
--- a/libegg/datetime/egg-datetime.c
+++ b/libegg/datetime/egg-datetime.c
@@ -858,7 +858,11 @@ popup_show (GtkWindow *popup)
 			   | GDK_BUTTON_RELEASE_MASK
 			   | GDK_POINTER_MOTION_MASK),
 			  NULL, cursor, GDK_CURRENT_TIME);
+#if GTK_CHECK_VERSION (3,0,0)
+	g_object_unref (cursor);
+#else
 	gdk_cursor_unref (cursor);
+#endif
 }
 
 static void
diff --git a/libegg/dock/egg-dock-item.c b/libegg/dock/egg-dock-item.c
index ad6d910..7c6481e 100644
--- a/libegg/dock/egg-dock-item.c
+++ b/libegg/dock/egg-dock-item.c
@@ -1325,7 +1325,11 @@ egg_dock_item_drag_start (EggDockItem *item)
     /* grab the keyboard & pointer */
     gtk_grab_add (GTK_WIDGET (item));
 
+#if GTK_CHECK_VERSION (3,0,0)
+    g_object_unref (fleur);
+#else
     gdk_cursor_unref (fleur);
+#endif
 
     g_signal_emit (item, egg_dock_item_signals [DOCK_DRAG_BEGIN], 0);
 }
diff --git a/libegg/toolbareditor/egg-editable-toolbar.c b/libegg/toolbareditor/egg-editable-toolbar.c
index 44f393d..24649e3 100644
--- a/libegg/toolbareditor/egg-editable-toolbar.c
+++ b/libegg/toolbareditor/egg-editable-toolbar.c
@@ -439,7 +439,11 @@ configure_item_cursor (GtkToolItem *item,
           cursor = gdk_cursor_new_for_display (gdk_screen_get_display (screen),
 					       GDK_HAND2);
           gdk_window_set_cursor (window, cursor);
+#if GTK_CHECK_VERSION (3,0,0)
+          g_object_unref (cursor);
+#else
           gdk_cursor_unref (cursor);
+#endif
 
           gtk_drag_source_set (widget, GDK_BUTTON1_MASK, dest_drag_types,
                                G_N_ELEMENTS (dest_drag_types), GDK_ACTION_MOVE);
diff --git a/libegg/toolbareditor/egg-toolbar-editor.c b/libegg/toolbareditor/egg-toolbar-editor.c
index fc97cbb..bf76ca8 100644
--- a/libegg/toolbareditor/egg-toolbar-editor.c
+++ b/libegg/toolbareditor/egg-toolbar-editor.c
@@ -363,7 +363,11 @@ set_drag_cursor (GtkWidget *widget)
   cursor = gdk_cursor_new_for_display (gdk_screen_get_display (screen),
 				       GDK_HAND2);
   gdk_window_set_cursor (gtk_widget_get_window (widget), cursor);
+#if GTK_CHECK_VERSION (3,0,0)
+  g_object_unref (cursor);
+#else
   gdk_cursor_unref (cursor);
+#endif
 }
 
 static void



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