Mir cursor has no hotspot setting, assumes (0, 0)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mir |
Fix Released
|
Medium
|
Robert Carr | ||
mir (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
The Mir cursor has no hotspot setting and just assumes (0, 0).
A configurable hotspot location will be required for:
1. Ensuring the hotspot is the precise point of the arrow (not quite location 0,0).
2. Supporting other cursors where the hotspot is different, like centred cross-hairs.
3. Left-handed support?...
This could be implemented as either:
A. A coordinate in the cursor image to use as the hotspot; or
B. Assume the hotspot is always the centre of the image.
(A) is how it's usually done on other systems, but (B) is most portable because it means we don't need to create any custom tooling to make any cursor.
Once you know the hotspot location within the image, you just offset the hardware cursor by the negative of that coordinate.
Related branches
- Daniel van Vugt: Needs Fixing
- Kevin DuBois (community): Needs Information
-
Diff: 71 lines (+12/-4)3 files modifiedinclude/server/mir/graphics/cursor.h (+1/-0)
src/server/graphics/gbm/gbm_cursor.cpp (+8/-2)
src/server/graphics/gbm/gbm_cursor.h (+3/-2)
Changed in mir: | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in mir: | |
milestone: | none → 0.1.0 |
Changed in mir: | |
milestone: | 0.1.0 → 0.1.1 |
Changed in mir: | |
milestone: | 0.1.1 → 0.1.2 |
Changed in mir: | |
status: | In Progress → Triaged |
assignee: | Raymond Wells (rfw2nd) → nobody |
milestone: | 0.1.2 → none |
tags: | added: cursor |
Changed in mir: | |
milestone: | none → 0.5.0 |
status: | Triaged → Fix Committed |
assignee: | nobody → Robert Carr (robertcarr) |
Changed in mir (Ubuntu): | |
importance: | Undecided → Medium |
status: | New → Triaged |
Changed in mir: | |
status: | Fix Committed → Fix Released |
First Mir patch. :)
I added a method set_hotspot to Cursor, and an implementation in GBMCursor.
I made the hotspot a "geometry::Point" because someone using the interface will see the hotspot as a point on the cursor, but represent it internally as a "geometry: :Displacement" to make the implementation easier.
I did some manual testing in the mir_demo_ client_ fingerprint app and it works :). I'll need to dig into the automated testing code so I can make some automatic tests for it.