diff options
Diffstat (limited to 'libcaja-private/caja-icon-canvas-item.c')
-rw-r--r-- | libcaja-private/caja-icon-canvas-item.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/libcaja-private/caja-icon-canvas-item.c b/libcaja-private/caja-icon-canvas-item.c index bd913815..692c77b3 100644 --- a/libcaja-private/caja-icon-canvas-item.c +++ b/libcaja-private/caja-icon-canvas-item.c @@ -149,6 +149,8 @@ struct CajaIconCanvasItemDetails EelIRect bounds_cache_for_layout; EelIRect bounds_cache_for_entire_item; + GdkWindow *cursor_window; + /* Accessibility bits */ GailTextUtil *text_util; }; @@ -255,6 +257,12 @@ caja_icon_canvas_item_finalize (GObject *object) details = CAJA_ICON_CANVAS_ITEM (object)->details; + if (details->cursor_window != NULL) + { + gdk_window_set_cursor (details->cursor_window, NULL); + g_object_unref (details->cursor_window); + } + if (details->pixbuf != NULL) { g_object_unref (details->pixbuf); @@ -2021,8 +2029,10 @@ caja_icon_canvas_item_event (EelCanvasItem *item, GdkEvent *event) { CajaIconCanvasItem *icon_item; GdkCursor *cursor; + GdkWindow *cursor_window; icon_item = CAJA_ICON_CANVAS_ITEM (item); + cursor_window = ((GdkEventAny *) event)->window; switch (event->type) { @@ -2040,8 +2050,10 @@ 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); + gdk_window_set_cursor (cursor_window, cursor); g_object_unref (cursor); + + icon_item->details->cursor_window = g_object_ref (cursor_window); } /* FIXME bugzilla.gnome.org 42473: @@ -2088,7 +2100,8 @@ caja_icon_canvas_item_event (EelCanvasItem *item, GdkEvent *event) eel_canvas_item_request_update (item); /* show default cursor */ - gdk_window_set_cursor (((GdkEventAny *)event)->window, NULL); + gdk_window_set_cursor (cursor_window, NULL); + g_clear_object (&icon_item->details->cursor_window); } return TRUE; |