diff options
author | Franco Tortoriello <[email protected]> | 2016-12-29 21:22:37 -0300 |
---|---|---|
committer | lukefromdc <[email protected]> | 2016-12-31 00:45:57 -0500 |
commit | f604ba59b9a1e45c1fc45c0e94869e416f5a94b0 (patch) | |
tree | 95d0ddcab1c5f667e7174b36059a53c15d42b568 /libcaja-private/caja-icon-canvas-item.c | |
parent | 91dcd8a19665b6738f8304db127f45b503e00ce3 (diff) | |
download | caja-f604ba59b9a1e45c1fc45c0e94869e416f5a94b0.tar.bz2 caja-f604ba59b9a1e45c1fc45c0e94869e416f5a94b0.tar.xz |
Fix cursor on single-click navigation mode.
On this mode, after opening a folder, the hand cursor was used until the user
moved the cursor over a file or folder.
Based on Nautilus commit
https://git.gnome.org/browse/nautilus/commit/?id=2644c6ef4e7839e976d4861d6c86e16e34d46a13
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; |