Closed Bug 1025616 Opened 10 years ago Closed 10 years ago

cursor: grab/-moz-grab falls back to pointer cursor on some GTK themes

Categories

(Core :: Widget: Gtk, defect)

30 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla34
Tracking Status
firefox30 --- wontfix
firefox31 + wontfix
firefox32 + wontfix
firefox33 + verified
firefox34 + verified

People

(Reporter: yboniface, Assigned: Gijs)

References

Details

(Keywords: regression, reproducible, testcase)

Attachments

(2 files)

Attached file test_cursor.html
If I set "cursor: grab" or "cursor: -moz-grab" I have a "pointer" cursor, I'm expecting a "grab" cursor (open hand). This appeared with version 30 I think.
"cursor: grabbing;" is ok.
See attachment to have a simple test case.
CSS reference: https://developer.mozilla.org/en-US/docs/Web/CSS/cursor
Product: Firefox → Core
This seems bound to be bug 310924's fault.
Component: General → Widget: Gtk
From the patch:

+    // Those two aren’t standardized. Trying both KDE’s and GNOME’s names
     case eCursor_grab:
-        newType = MOZ_CURSOR_HAND_GRAB;
+        gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "openhand");
+        if (!gdkcursor)
+            gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "hand1");
+        if (!gdkcursor)
+            newType = MOZ_CURSOR_HAND_GRAB;
         break;


Are these IDs just wrong, or...?
"hand1" is the same as GDK_HAND2 (eCursor_hyperlink) in both Gold and Adwaita, so yes, that seems wrong.
hi, i wrote the patch.

“wrong” is too hard here where only a semi-official freedesktop spec exists that doesn’t cover much.

most cursor themes have “openhand” and “closedhand”, but the theme “DMZ” (and the derived “Adwaita”) seem to have only the closed ones as “dnd-none” and friends.

therefore i decided that a hand with an outstretched finger is better than no hand or a closed hand.

maybe the move/fleur/… thingy is also good for falling back to, but “openhand” is definitely the first choice.
(In reply to flying sheep from comment #5) 
....
> therefore i decided that a hand with an outstretched finger is better than
> no hand or a closed hand.
> maybe the move/fleur/… thingy is also good for falling back to, but
> “openhand” is definitely the first choice.

I don't agree with your opinion ".. but openhand is definitely the first choice". In a draggable map with clickable areas or markers, there is no difference in the cursor in this case. User cannot see where is the map draggable and where they can click something. cursor:grab and cursor:pointer should look different definitely!
"openhand" is not causing the problem, but "hand1" should not be used for grab.

If cursor theme doesn't support "openhand" or provide a match for the hash of Gecko's bitmap (e.g. obsidian), then Gecko's bitmap should be used.

(In reply to flying sheep from comment #5)

> maybe the move/fleur/… thingy is also good for falling back to

I think these are usually used once a drag has begun, but "grab" is meant to indicate that something can be grabbed (and dragged).
(In reply to Joachim Benz from comment #6)
> I don't agree with your opinion ".. but openhand is definitely the first choice". 

you mean “hand1”, my (perhaps misguided) choice of fallback. “openhand” IS the first choice, because it means exactly the same as “cursor: grab”; an open hand with all 5 fingers outstretched.

(In reply to Karl Tomlinson (needinfo?:karlt) from comment #7)
> If cursor theme doesn't support "openhand" or provide a match for the hash
> of Gecko's bitmap (e.g. obsidian), then Gecko's bitmap should be used.

so you mean that we shouldn’t fall back to “move” before falling back to a bitmap?

that’s the question:

1. fall back to a integrated, but wrong cursor like e.g. “move” (many cursor themes do this themselves: they just symlink some cursors they don’t provide to similar alternatives. i used “hand1”, to provide “openhand” if not available, but i can see that “move” might be a better choice.)
2. fall back to a non-integrated, ugly, but correct bitmap of an open hand
(2b. improve the bitmaps to no longer be as ugly and pixelated)

other, non-exclusive option: fix DMZ and Adwaita to include the “openhand” cursor as it should.
(In reply to flying sheep from comment #8)
> (In reply to Karl Tomlinson (needinfo?:karlt) from comment #7)
> > If cursor theme doesn't support "openhand" or provide a match for the hash
> > of Gecko's bitmap (e.g. obsidian), then Gecko's bitmap should be used.
> 
> so you mean that we shouldn’t fall back to “move” before falling back to a
> bitmap?

Yes, and note that the hash is tried before the bitmap.
Some themes provide a cursor for the hash.

> that’s the question:
> 
> 1. fall back to a integrated, but wrong cursor like e.g. “move” (many cursor
> themes do this themselves: they just symlink some cursors they don’t provide
> to similar alternatives. i used “hand1”, to provide “openhand” if not
> available, but i can see that “move” might be a better choice.)
> 2. fall back to a non-integrated, ugly, but correct bitmap of an open hand
> (2b. improve the bitmaps to no longer be as ugly and pixelated)

The cursors should be distinguishable, so 1 is not an option.  If some themes choose to make different cursors look the same, then people can choose whether or not to use those themes.

> other, non-exclusive option: fix DMZ and Adwaita to include the “openhand”
> cursor as it should.

The addition of "openhand" was good.  That allows themes to provide cursors without having to use the magic hash.
Too late for 31. We will take it for 32.
If it is critical for 31 ESR, we can have a discussion on this to have it in ESR 31.1.0.
I'm marking this as won't fix for 32 as we haven't made an progress recently.

Gijs - Can you help restart this bug with more information of by helping to find an owner or owning team?
Flags: needinfo?(gijskruitbosch+bugs)
(In reply to Lawrence Mandel [:lmandel] from comment #11)
> I'm marking this as won't fix for 32 as we haven't made an progress recently.
> 
> Gijs - Can you help restart this bug with more information of by helping to
> find an owner or owning team?

I don't really know enough about how this could be moved forward, but Karl would, as far as I can tell. :-)

Karl, is there any way we could get this on someone's radar to fix soonish?

I don't know enough about linux desktop theming to understand if we've arrived at the ideal solution yet, but it seems we at least agree that the "hand1" fallback is bad. AFAICR from looking at the patch, that should be trivial to revert, and we can figure out the perfect solution afterwards if more discussion is needed?
Flags: needinfo?(gijskruitbosch+bugs) → needinfo?(karlt)
(In reply to Lawrence Mandel [:lmandel] from comment #11)
> Gijs - Can you help restart this bug with more information of by helping to
> find an owner or owning team?

There is no owning team for bugs in the gtk port.

(In reply to :Gijs Kruitbosch from comment #12)
> Karl, is there any way we could get this on someone's radar to fix soonish?

So, unfortunately, no.

> I don't know enough about linux desktop theming to understand if we've
> arrived at the ideal solution yet, but it seems we at least agree that the
> "hand1" fallback is bad. AFAICR from looking at the patch, that should be
> trivial to revert, and we can figure out the perfect solution afterwards if
> more discussion is needed?

Yes, we just need the two lines associated with "hand1" removed, and this bug can be marked fixed.
Flags: needinfo?(karlt)
Like this?
Attachment #8476964 - Flags: review?(karlt)
Assignee: nobody → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Comment on attachment 8476964 [details] [diff] [review]
fix -moz-grab cursor on GTK to not use hand1,

Perfect, thanks.
Attachment #8476964 - Flags: review?(karlt) → review+
remote:   https://hg.mozilla.org/integration/fx-team/rev/781d505d27af
Flags: qe-verify+
Summary: cursor: grab/-moz-grab in Firefox 30? → cursor: grab/-moz-grab falls back to pointer cursor on some GTK themes
Whiteboard: [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/781d505d27af
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → mozilla34
Comment on attachment 8476964 [details] [diff] [review]
fix -moz-grab cursor on GTK to not use hand1,

Approval Request Comment
[Feature/regressing bug #]: bug 310924
[User impact if declined]: wrong cursor used when "grab" or "grabbing" cursor is specified
[Describe test coverage new/current, TBPL]: none; checked locally that this fixes the issue
[Risks and why]: low, simple change
[String/UUID change made/needed]: no
Attachment #8476964 - Flags: approval-mozilla-aurora?
Attachment #8476964 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Reproduced with Nightly 2014-06-15: the cursor: grab and cursor: -moz-grab are displayed as pointers.
Verified as fixed with Firefox 33 beta 7 (Build ID: 20140923222114) and latest Aurora 34.0a2 (Build ID: 20140925004001) on Linux 12.04 64-bit by using various themes (E.g.: Adwaita, Zukitwo Colors pack theme, Gnomish Dark).
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: