Mir

Mir cursor has no hotspot setting, assumes (0, 0)

Bug #1189775 reported by Daniel van Vugt
18
This bug affects 2 people
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.

Tags: cursor patch

Related branches

Changed in mir:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Raymond Wells (rfw2nd) wrote :

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.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Hi Raymond,

Thanks for that! However, you need to make a merge proposal for the change to be reviewed and accepted.

To do this:
$ bzr branch lp:mir
$ cd mir
(make changes)
$ bzr commit -m "Description of change"
$ bzr push lp:~rfw2nd/mir/name-of-branch

Then go to https://code.launchpad.net/~rfw2nd/mir/name-of-branch and select "Propose for merging".

Revision history for this message
Raymond Wells (rfw2nd) wrote :

Merge Proposed. :)

Changed in mir:
assignee: nobody → Raymond Wells (rfw2nd)
status: Triaged → In Progress
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
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "hotspot.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mir - 0.5.0+14.10.20140717-0ubuntu1

---------------
mir (0.5.0+14.10.20140717-0ubuntu1) utopic; urgency=medium

  [ Daniel van Vugt ]
  * New upstream release 0.5.0 (https://launchpad.net/mir/+milestone/0.5.0)
    - mirclient ABI unchanged at 8. Clients do not need rebuilding.
    - mirserver ABI bumped to 23. Servers need rebuilding, but probably don't
      need modification:
      . DefaultServerConfiguration/Cursor API: Cursor interfaces changed, most
        notably CursorImages moved from ::mir::graphics to ::mir::input.
      . DefaultServerConfiguration: New "prompt" API.
      . DefaultServerConfiguration: "clock" member is now static.
      . SessionAuthorizer: New functions.
      . ServerConfiguration: New function added: the_prompt_connector().
    - Enhancements:
      . Add AddressSanitizer cmake build type.
      . frontend, client API, tests: add support for prompt session
        permissions and for client detecting errors.
      . server: Ensure our emergency cleanup handling infrastructure is
        signal-safe.
      . Implement and enable an xcursor based image loader for cursors.
      . Fix warnings raised by the new g++-4.9.
      . shared, scene: Introduce a generic listener collection.
      . MirMotionEvent: Define a struct typedef to allow for
        pointer_coordinates to be used individually.
    - Bugs fixed:
      . Nexus 10 leaks during overlay operations (LP: #1331769)
      . MultiThreadedCompositor deadlocks (LP: #1335311)
      . Intermittent test failure in ClientSurfaceEvents can client query
        orientation (LP: #1335741)
      . Intermittent test failure in ClientSurfaceEvents/OrientationEvents
        (LP: #1335752)
      . Intermittent memory error in ClientSurfaceEvents on
        orientation query (LP: #1335819)
      . mir_unit_tests.EventDistributorTest.* SEGFAULT (LP: #1338902)
      . [regression] Device locks randomly on welcome screen (LP: #1339700)
      . Intermittent deadlock when switching to session with custom display
        config & closing other session (LP: #1340669)
      . Mir cursor has no hotspot setting, assumes (0, 0) (LP: #1189775)
      . clang built mir_unit_tests.ProtobufSocketCommunicatorFD crashes
        intermittently (LP: #1300653)
      . g++-4.9 binary incompatibilities with libraries built with g++-4.8
        (LP: #1329089)
      . [test regression] SurfaceLoop fails sporadically on deleting surfaces
        for a disconnecting client (LP: #1335747)
      . Intermittent test failure ServerShutdown when clients are blocked
        (LP: #1335873)
      . [regression] mir_demo_client_multiwin is displayed with obviously
        wrong colours (LP: #1339471)
      . Partially onscreen surfaces not occluded when covered by another
        surface (LP: #1340078)
      . SurfaceConfigurator::attribute_set always say "unfocused" for focus
        property changes (LP: #1336548)
 -- Ubuntu daily release <email address hidden> Thu, 17 Jul 2014 07:58:53 +0000

Changed in mir (Ubuntu):
status: Triaged → Fix Released
Changed in mir:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.