Commit 8f1f7439 authored by Benjamin Otte's avatar Benjamin Otte Committed by Matthias Clasen

gtk: Use g_object_unref instead of gdk_cursor_unref

parent a9637f05
...@@ -796,8 +796,8 @@ gtk_about_dialog_finalize (GObject *object) ...@@ -796,8 +796,8 @@ gtk_about_dialog_finalize (GObject *object)
g_slist_foreach (priv->visited_links, (GFunc)g_free, NULL); g_slist_foreach (priv->visited_links, (GFunc)g_free, NULL);
g_slist_free (priv->visited_links); g_slist_free (priv->visited_links);
gdk_cursor_unref (priv->hand_cursor); g_object_unref (priv->hand_cursor);
gdk_cursor_unref (priv->regular_cursor); g_object_unref (priv->regular_cursor);
G_OBJECT_CLASS (gtk_about_dialog_parent_class)->finalize (object); G_OBJECT_CLASS (gtk_about_dialog_parent_class)->finalize (object);
} }
......
...@@ -1968,7 +1968,7 @@ get_screen_color (GtkWidget *button) ...@@ -1968,7 +1968,7 @@ get_screen_color (GtkWidget *button)
GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_PRESS_MASK | GDK_POINTER_MOTION_MASK, GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_PRESS_MASK | GDK_POINTER_MOTION_MASK,
picker_cursor, picker_cursor,
time); time);
gdk_cursor_unref (picker_cursor); g_object_unref (picker_cursor);
if (grab_status != GDK_GRAB_SUCCESS) if (grab_status != GDK_GRAB_SUCCESS)
{ {
......
...@@ -734,7 +734,7 @@ gtk_drag_get_cursor (GdkDisplay *display, ...@@ -734,7 +734,7 @@ gtk_drag_get_cursor (GdkDisplay *display,
for (i = 0 ; i < n_drag_cursors - 1; i++) for (i = 0 ; i < n_drag_cursors - 1; i++)
if (drag_cursors[i].cursor != NULL) if (drag_cursors[i].cursor != NULL)
{ {
gdk_cursor_unref (drag_cursors[i].cursor); g_object_unref (drag_cursors[i].cursor);
drag_cursors[i].cursor = NULL; drag_cursors[i].cursor = NULL;
} }
} }
...@@ -751,7 +751,7 @@ gtk_drag_get_cursor (GdkDisplay *display, ...@@ -751,7 +751,7 @@ gtk_drag_get_cursor (GdkDisplay *display,
{ {
if (display != gdk_cursor_get_display (drag_cursors[i].cursor)) if (display != gdk_cursor_get_display (drag_cursors[i].cursor))
{ {
gdk_cursor_unref (drag_cursors[i].cursor); g_object_unref (drag_cursors[i].cursor);
drag_cursors[i].cursor = NULL; drag_cursors[i].cursor = NULL;
} }
} }
...@@ -776,7 +776,7 @@ gtk_drag_get_cursor (GdkDisplay *display, ...@@ -776,7 +776,7 @@ gtk_drag_get_cursor (GdkDisplay *display,
if (display == gdk_cursor_get_display (info->drag_cursors[i])) if (display == gdk_cursor_get_display (info->drag_cursors[i]))
return info->drag_cursors[i]; return info->drag_cursors[i];
gdk_cursor_unref (info->drag_cursors[i]); g_object_unref (info->drag_cursors[i]);
info->drag_cursors[i] = NULL; info->drag_cursors[i] = NULL;
} }
...@@ -3891,7 +3891,7 @@ gtk_drag_source_info_destroy (GtkDragSourceInfo *info) ...@@ -3891,7 +3891,7 @@ gtk_drag_source_info_destroy (GtkDragSourceInfo *info)
{ {
if (info->drag_cursors[i] != NULL) if (info->drag_cursors[i] != NULL)
{ {
gdk_cursor_unref (info->drag_cursors[i]); g_object_unref (info->drag_cursors[i]);
info->drag_cursors[i] = NULL; info->drag_cursors[i] = NULL;
} }
} }
......
...@@ -2699,7 +2699,7 @@ update_cursors (GtkWidget *widget) ...@@ -2699,7 +2699,7 @@ update_cursors (GtkWidget *widget)
display = gtk_widget_get_display (widget); display = gtk_widget_get_display (widget);
cursor = gdk_cursor_new_for_display (display, GDK_XTERM); cursor = gdk_cursor_new_for_display (display, GDK_XTERM);
gdk_window_set_cursor (icon_info->window, cursor); gdk_window_set_cursor (icon_info->window, cursor);
gdk_cursor_unref (cursor); g_object_unref (cursor);
} }
else else
{ {
...@@ -2863,7 +2863,7 @@ gtk_entry_realize (GtkWidget *widget) ...@@ -2863,7 +2863,7 @@ gtk_entry_realize (GtkWidget *widget)
gdk_window_set_user_data (priv->text_area, entry); gdk_window_set_user_data (priv->text_area, entry);
if (attributes_mask & GDK_WA_CURSOR) if (attributes_mask & GDK_WA_CURSOR)
gdk_cursor_unref (attributes.cursor); g_object_unref (attributes.cursor);
gtk_widget_style_attach (widget); gtk_widget_style_attach (widget);
...@@ -4029,7 +4029,7 @@ gtk_entry_motion_notify (GtkWidget *widget, ...@@ -4029,7 +4029,7 @@ gtk_entry_motion_notify (GtkWidget *widget,
cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget), GDK_XTERM); cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget), GDK_XTERM);
gdk_window_set_cursor (priv->text_area, cursor); gdk_window_set_cursor (priv->text_area, cursor);
gdk_cursor_unref (cursor); g_object_unref (cursor);
priv->mouse_cursor_obscured = FALSE; priv->mouse_cursor_obscured = FALSE;
} }
...@@ -4142,7 +4142,7 @@ set_invisible_cursor (GdkWindow *window) ...@@ -4142,7 +4142,7 @@ set_invisible_cursor (GdkWindow *window)
gdk_window_set_cursor (window, cursor); gdk_window_set_cursor (window, cursor);
gdk_cursor_unref (cursor); g_object_unref (cursor);
} }
static void static void
...@@ -4336,7 +4336,7 @@ gtk_entry_state_flags_changed (GtkWidget *widget, ...@@ -4336,7 +4336,7 @@ gtk_entry_state_flags_changed (GtkWidget *widget,
gdk_window_set_cursor (priv->text_area, cursor); gdk_window_set_cursor (priv->text_area, cursor);
if (cursor) if (cursor)
gdk_cursor_unref (cursor); g_object_unref (cursor);
priv->mouse_cursor_obscured = FALSE; priv->mouse_cursor_obscured = FALSE;
......
...@@ -6053,7 +6053,7 @@ set_busy_cursor (GtkFileChooserDefault *impl, ...@@ -6053,7 +6053,7 @@ set_busy_cursor (GtkFileChooserDefault *impl,
gdk_display_flush (display); gdk_display_flush (display);
if (cursor) if (cursor)
gdk_cursor_unref (cursor); g_object_unref (cursor);
} }
/* Creates a sort model to wrap the file system model and sets it on the tree view */ /* Creates a sort model to wrap the file system model and sets it on the tree view */
......
...@@ -914,7 +914,7 @@ set_invisible_mouse_cursor (GdkWindow *window) ...@@ -914,7 +914,7 @@ set_invisible_mouse_cursor (GdkWindow *window)
gdk_window_set_cursor (window, cursor); gdk_window_set_cursor (window, cursor);
gdk_cursor_unref (cursor); g_object_unref (cursor);
} }
static void static void
......
...@@ -1199,7 +1199,7 @@ gtk_handle_box_button_press (GtkWidget *widget, ...@@ -1199,7 +1199,7 @@ gtk_handle_box_button_press (GtkWidget *widget,
G_CALLBACK (gtk_handle_box_grab_event), hb); G_CALLBACK (gtk_handle_box_grab_event), hb);
} }
gdk_cursor_unref (fleur); g_object_unref (fleur);
event_handled = TRUE; event_handled = TRUE;
} }
else if (priv->child_detached) /* Double click */ else if (priv->child_detached) /* Double click */
......
...@@ -684,7 +684,7 @@ set_cross_grab (GtkHSV *hsv, ...@@ -684,7 +684,7 @@ set_cross_grab (GtkHSV *hsv,
NULL, NULL,
cursor, cursor,
time); time);
gdk_cursor_unref (cursor); g_object_unref (cursor);
} }
static gboolean static gboolean
......
...@@ -3799,7 +3799,7 @@ gtk_label_update_cursor (GtkLabel *label) ...@@ -3799,7 +3799,7 @@ gtk_label_update_cursor (GtkLabel *label)
gdk_window_set_cursor (priv->select_info->window, cursor); gdk_window_set_cursor (priv->select_info->window, cursor);
if (cursor) if (cursor)
gdk_cursor_unref (cursor); g_object_unref (cursor);
} }
} }
...@@ -5113,7 +5113,7 @@ gtk_label_create_window (GtkLabel *label) ...@@ -5113,7 +5113,7 @@ gtk_label_create_window (GtkLabel *label)
gdk_window_set_user_data (priv->select_info->window, widget); gdk_window_set_user_data (priv->select_info->window, widget);
if (attributes_mask & GDK_WA_CURSOR) if (attributes_mask & GDK_WA_CURSOR)
gdk_cursor_unref (attributes.cursor); g_object_unref (attributes.cursor);
} }
static void static void
......
...@@ -390,7 +390,7 @@ set_hand_cursor (GtkWidget *widget, ...@@ -390,7 +390,7 @@ set_hand_cursor (GtkWidget *widget,
gdk_display_flush (display); gdk_display_flush (display);
if (cursor) if (cursor)
gdk_cursor_unref (cursor); g_object_unref (cursor);
} }
static void static void
......
...@@ -1134,7 +1134,7 @@ gtk_paned_realize (GtkWidget *widget) ...@@ -1134,7 +1134,7 @@ gtk_paned_realize (GtkWidget *widget)
&attributes, attributes_mask); &attributes, attributes_mask);
gdk_window_set_user_data (priv->handle, paned); gdk_window_set_user_data (priv->handle, paned);
if (attributes_mask & GDK_WA_CURSOR) if (attributes_mask & GDK_WA_CURSOR)
gdk_cursor_unref (attributes.cursor); g_object_unref (attributes.cursor);
gtk_widget_style_attach (widget); gtk_widget_style_attach (widget);
...@@ -1439,7 +1439,7 @@ gtk_paned_state_changed (GtkWidget *widget, ...@@ -1439,7 +1439,7 @@ gtk_paned_state_changed (GtkWidget *widget,
gdk_window_set_cursor (priv->handle, cursor); gdk_window_set_cursor (priv->handle, cursor);
if (cursor) if (cursor)
gdk_cursor_unref (cursor); g_object_unref (cursor);
} }
} }
......
...@@ -402,7 +402,7 @@ set_busy_cursor (GtkPrintUnixDialog *dialog, ...@@ -402,7 +402,7 @@ set_busy_cursor (GtkPrintUnixDialog *dialog,
gdk_display_flush (display); gdk_display_flush (display);
if (cursor) if (cursor)
gdk_cursor_unref (cursor); g_object_unref (cursor);
} }
static void static void
......
...@@ -765,7 +765,7 @@ set_busy_cursor (GtkRecentChooserDefault *impl, ...@@ -765,7 +765,7 @@ set_busy_cursor (GtkRecentChooserDefault *impl,
gdk_display_flush (display); gdk_display_flush (display);
if (cursor) if (cursor)
gdk_cursor_unref (cursor); g_object_unref (cursor);
} }
static void static void
......
...@@ -4171,7 +4171,7 @@ gtk_text_view_state_flags_changed (GtkWidget *widget, ...@@ -4171,7 +4171,7 @@ gtk_text_view_state_flags_changed (GtkWidget *widget,
gdk_window_set_cursor (text_view->priv->text_window->bin_window, cursor); gdk_window_set_cursor (text_view->priv->text_window->bin_window, cursor);
if (cursor) if (cursor)
gdk_cursor_unref (cursor); g_object_unref (cursor);
text_view->priv->mouse_cursor_obscured = FALSE; text_view->priv->mouse_cursor_obscured = FALSE;
} }
...@@ -4196,7 +4196,7 @@ set_invisible_cursor (GdkWindow *window) ...@@ -4196,7 +4196,7 @@ set_invisible_cursor (GdkWindow *window)
gdk_window_set_cursor (window, cursor); gdk_window_set_cursor (window, cursor);
gdk_cursor_unref (cursor); g_object_unref (cursor);
} }
static void static void
...@@ -4220,7 +4220,7 @@ gtk_text_view_unobscure_mouse_cursor (GtkTextView *text_view) ...@@ -4220,7 +4220,7 @@ gtk_text_view_unobscure_mouse_cursor (GtkTextView *text_view)
cursor = gdk_cursor_new_for_display (gtk_widget_get_display (GTK_WIDGET (text_view)), cursor = gdk_cursor_new_for_display (gtk_widget_get_display (GTK_WIDGET (text_view)),
GDK_XTERM); GDK_XTERM);
gdk_window_set_cursor (text_view->priv->text_window->bin_window, cursor); gdk_window_set_cursor (text_view->priv->text_window->bin_window, cursor);
gdk_cursor_unref (cursor); g_object_unref (cursor);
text_view->priv->mouse_cursor_obscured = FALSE; text_view->priv->mouse_cursor_obscured = FALSE;
} }
} }
...@@ -8428,7 +8428,7 @@ text_window_realize (GtkTextWindow *win, ...@@ -8428,7 +8428,7 @@ text_window_realize (GtkTextWindow *win,
cursor = gdk_cursor_new_for_display (gdk_window_get_display (window), cursor = gdk_cursor_new_for_display (gdk_window_get_display (window),
GDK_XTERM); GDK_XTERM);
gdk_window_set_cursor (win->bin_window, cursor); gdk_window_set_cursor (win->bin_window, cursor);
gdk_cursor_unref (cursor); g_object_unref (cursor);
} }
gtk_im_context_set_client_window (GTK_TEXT_VIEW (widget)->priv->im_context, gtk_im_context_set_client_window (GTK_TEXT_VIEW (widget)->priv->im_context,
......
...@@ -1354,7 +1354,7 @@ _gtk_tree_view_column_realize_button (GtkTreeViewColumn *column) ...@@ -1354,7 +1354,7 @@ _gtk_tree_view_column_realize_button (GtkTreeViewColumn *column)
gtk_tree_view_column_update_button (column); gtk_tree_view_column_update_button (column);
gdk_cursor_unref (attr.cursor); g_object_unref (attr.cursor);
} }
void void
......
...@@ -5202,7 +5202,7 @@ set_grip_cursor (GtkWindow *window) ...@@ -5202,7 +5202,7 @@ set_grip_cursor (GtkWindow *window)
display = gtk_widget_get_display (widget); display = gtk_widget_get_display (widget);
cursor = gdk_cursor_new_for_display (display, cursor_type); cursor = gdk_cursor_new_for_display (display, cursor_type);
gdk_window_set_cursor (priv->grip_window, cursor); gdk_window_set_cursor (priv->grip_window, cursor);
gdk_cursor_unref (cursor); g_object_unref (cursor);
} }
else else
gdk_window_set_cursor (priv->grip_window, NULL); gdk_window_set_cursor (priv->grip_window, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment