diff options
author | Matthias Clasen <mclasen@redhat.com> | 2016-01-06 14:54:33 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2016-01-06 14:57:42 -0500 |
commit | d9befb9086ba7882b5c2813518ab3c3e02c0ed7f (patch) | |
tree | c78befc44c2c538aeca53c08f19c11c8f6b54515 /gdk/x11 | |
parent | b6e11d087c951b01e70d7bae926e3f6323374fd6 (diff) | |
download | gtk+-d9befb9086ba7882b5c2813518ab3c3e02c0ed7f.tar.gz |
x11: Only do cursor name fallback for standard names
Always returning a left_ptr if we can't find anything better
broke firefox application-specific fallback for missing cursors.
Keep that working by only doing the fallback for the CSS cursor
names, not for things like hashes.
https://bugzilla.gnome.org/show_bug.cgi?id=760141
Diffstat (limited to 'gdk/x11')
-rw-r--r-- | gdk/x11/gdkcursor-x11.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/gdk/x11/gdkcursor-x11.c b/gdk/x11/gdkcursor-x11.c index d7388f1186..03d49baa96 100644 --- a/gdk/x11/gdkcursor-x11.c +++ b/gdk/x11/gdkcursor-x11.c @@ -611,17 +611,23 @@ static const struct { const gchar *css_name, *traditional_name; } name_map[] = { { "default", "left_ptr" }, + { "help", "left_ptr" }, + { "context-menu", "left_ptr" }, { "pointer", "hand" }, { "progress", "left_ptr_watch" }, { "wait", "watch" }, { "cell", "crosshair" }, { "crosshair", "cross" }, { "text", "xterm" }, + { "vertical-text","xterm" }, { "alias", "dnd-link" }, { "copy", "dnd-copy" }, + { "move", "dnd-move" }, { "no-drop", "dnd-none" }, { "not-allowed", "crossed_circle" }, { "grab", "hand2" }, + { "grabbing", "hand2" }, + { "all-scroll", "left_ptr" }, { "col-resize", "h_double_arrow" }, { "row-resize", "v_double_arrow" }, { "n-resize", "top_side" }, @@ -636,6 +642,8 @@ static const struct { { "ns-resize", "v_double_arrow" }, { "nesw-resize", "fd_double_arrow" }, { "nwse-resize", "bd_double_arrow" }, + { "zoom-in", "left_ptr" }, + { "zoom-out", "left_ptr" }, { NULL, NULL } }; @@ -650,7 +658,7 @@ name_fallback (const gchar *name) return name_map[i].traditional_name; } - return "left_ptr"; + return NULL; } GdkCursor* @@ -683,9 +691,17 @@ _gdk_x11_display_get_cursor_for_name (GdkDisplay *display, xdisplay = GDK_DISPLAY_XDISPLAY (display); xcursor = XcursorLibraryLoadCursor (xdisplay, name); if (xcursor == None) - xcursor = XcursorLibraryLoadCursor (xdisplay, name_fallback (name)); - if (xcursor == None) - xcursor = XcursorLibraryLoadCursor (xdisplay, "left_ptr"); + { + const char *fallback; + + fallback = name_fallback (name); + if (fallback) + { + xcursor = XcursorLibraryLoadCursor (xdisplay, fallback); + if (xcursor == None) + xcursor = XcursorLibraryLoadCursor (xdisplay, "left_ptr"); + } + } if (xcursor == None) return NULL; } |