summaryrefslogtreecommitdiff
path: root/libcaja-private
diff options
context:
space:
mode:
authorFranco Tortoriello <[email protected]>2016-12-29 21:22:37 -0300
committermonsta <[email protected]>2017-01-22 13:24:35 +0300
commit0cc80dfb513c3986659c41bdf0edf06c7702f77b (patch)
treeb6ee0789cee13f5a81b5db390f582656c8946da1 /libcaja-private
parent5d10e2fd61222796bbd540dc1c452de50a075747 (diff)
downloadcaja-0cc80dfb513c3986659c41bdf0edf06c7702f77b.tar.bz2
caja-0cc80dfb513c3986659c41bdf0edf06c7702f77b.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')
-rw-r--r--libcaja-private/caja-icon-canvas-item.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/libcaja-private/caja-icon-canvas-item.c b/libcaja-private/caja-icon-canvas-item.c
index 13e59bfd..14bd2db3 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;
};
@@ -275,6 +277,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);
@@ -2571,8 +2579,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)
{
@@ -2590,12 +2600,13 @@ 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);
#if GTK_CHECK_VERSION(3,0,0)
g_object_unref (cursor);
#else
gdk_cursor_unref (cursor);
#endif
+ icon_item->details->cursor_window = g_object_ref (cursor_window);
}
/* FIXME bugzilla.gnome.org 42473:
@@ -2642,7 +2653,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;