summaryrefslogtreecommitdiffstats
path: root/abs/extra/gtk3/0002-wayland-Only-do-cursor-name-fallback-for-standard-na.patch
blob: 94b69fb6d9ae4dc8317a1fda091539ff065ced7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
From 81a287478a4db9ce650cc764474b9c173b137dee Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Wed, 6 Jan 2016 14:56:06 -0500
Subject: [PATCH 2/2] wayland: 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
---
 gdk/wayland/gdkcursor-wayland.c | 29 +++++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/gdk/wayland/gdkcursor-wayland.c b/gdk/wayland/gdkcursor-wayland.c
index 8aee5ae..bdfa316 100644
--- a/gdk/wayland/gdkcursor-wayland.c
+++ b/gdk/wayland/gdkcursor-wayland.c
@@ -87,17 +87,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" },
@@ -112,6 +118,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 }
 };
 
@@ -126,7 +134,7 @@ name_fallback (const gchar *name)
         return name_map[i].traditional_name;
     }
 
-  return "left_ptr";
+  return NULL;
 }
 
 static gboolean
@@ -144,17 +152,22 @@ _gdk_wayland_cursor_update (GdkWaylandDisplay *wayland_display,
                                                         cursor->scale);
   c = wl_cursor_theme_get_cursor (theme, cursor->name);
   if (!c)
-    c = wl_cursor_theme_get_cursor (theme, name_fallback (cursor->name));
+    {
+      const char *fallback;
+
+      fallback = name_fallback (cursor->name);
+      if (fallback)
+        {
+          c = wl_cursor_theme_get_cursor (theme, name_fallback (cursor->name));
+          if (!c)
+            c = wl_cursor_theme_get_cursor (theme, "left_ptr");
+        }
+    }
 
   if (!c)
     {
       g_warning (G_STRLOC ": Unable to load %s from the cursor theme", cursor->name);
-
-      /* return the left_ptr cursor as a fallback */
-      c = wl_cursor_theme_get_cursor (theme, "left_ptr");
-
-      if (!c)
-        return FALSE;
+      return FALSE;
     }
 
   cursor->wl_cursor = c;
-- 
2.7.0