Merge lp:~vanvugt/qtubuntu/fix-cursor into lp:qtubuntu

Proposed by Daniel van Vugt
Status: Merged
Approved by: Daniel d'Andrada
Approved revision: 347
Merged at revision: 348
Proposed branch: lp:~vanvugt/qtubuntu/fix-cursor
Merge into: lp:qtubuntu
Diff against target: 49 lines (+20/-15)
1 file modified
src/ubuntumirclient/cursor.cpp (+20/-15)
To merge this branch: bzr merge lp:~vanvugt/qtubuntu/fix-cursor
Reviewer Review Type Date Requested Status
Daniel d'Andrada (community) Approve
Unity8 CI Bot continuous-integration Approve
Lukáš Tinkl (community) Needs Information
Gerry Boland Pending
Review via email: mp+306597@code.launchpad.net

Commit message

Implement named cursors that Mir understands (LP: #1625853)

Description of the change

The old strings probably worked in the past. But it appears mir-team changed the set of valid cursor names at some point and didn't tell anyone(?).

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:343
https://unity8-jenkins.ubuntu.com/job/lp-qtubuntu-ci/121/
Executed test runs:

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-qtubuntu-ci/121/rebuild

review: Needs Fixing (continuous-integration)
lp:~vanvugt/qtubuntu/fix-cursor updated
344. By Daniel van Vugt

Try again

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:344
https://unity8-jenkins.ubuntu.com/job/lp-qtubuntu-ci/122/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2962
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2990
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2848
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2848/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2848
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2848/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2848
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2848/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2848
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2848/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2848
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2848/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2848
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2848/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2848
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2848/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2848
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2848/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2848
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2848/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-qtubuntu-ci/122/rebuild

review: Approve (continuous-integration)
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

What about these changes? https://pastebin.kde.org/p2syqimva

(the only thing I'm slightly unsure is Qt::ForbiddenCursor)

review: Needs Information
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

Sorry, slightly more correct/complete version: https://pastebin.kde.org/pseu0vpuf

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

unity8 and Qt knows more cursors than can be expressed by those mir_*_cursor_name symbols. Those FIXME fallbacks are not acceptable as they will cause regressions in Qt/QML based apps.

review: Needs Fixing
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

xcursor is a pretty loose standard. a shell should take whatever the cursor name string is and see if the current cursor theme provides it. It could go an extra mile and have fallbacks for well-know cursor names in case the specified one isn't there (like unity8 does).

That's all there's to it. Don't see how using those mir string constants help with anything in that regard.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I considered fallbacks to fill the gaps in the Mir API but it feels unclean because it's technically violating the Mir API in a way that Mir doesn't notice.

It's worth noting that your X cursor names will only work on Unity8. And soon may not even work on Unity8 since we'll start using the hardware cursor (unity-system-compositor). Basically we just need to fix Mir bug 1388987 ASAP.

lp:~vanvugt/qtubuntu/fix-cursor updated
345. By Daniel van Vugt

Best of both worlds (the missing cursors will now at least work in
Unity8)

346. By Daniel van Vugt

Remove blank line

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:346
https://unity8-jenkins.ubuntu.com/job/lp-qtubuntu-ci/127/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/2976/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3004
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2862
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2862/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2862
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2862/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2862
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2862/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2862/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2862/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2862/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2862
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2862/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2862
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2862/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2862
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2862/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-qtubuntu-ci/127/rebuild

review: Needs Fixing (continuous-integration)
lp:~vanvugt/qtubuntu/fix-cursor updated
347. By Daniel van Vugt

Try again, Jenkins

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:347
https://unity8-jenkins.ubuntu.com/job/lp-qtubuntu-ci/128/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2977
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3005
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2863
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2863/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2863
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2863/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2863
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2863/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2863
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2863/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2863
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2863/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2863
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2863/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2863
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2863/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2863
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2863/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2863
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2863/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-qtubuntu-ci/128/rebuild

review: Approve (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

> It's worth noting that your X cursor names will only work on Unity8. And soon
> may not even work on Unity8 since we'll start using the hardware cursor
> (unity-system-compositor). Basically we just need to fix Mir bug 1388987
> ASAP.

Unity8 will still be deciding which image the hardware cursor will use. So my previous observations still hold.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/ubuntumirclient/cursor.cpp'
2--- src/ubuntumirclient/cursor.cpp 2016-06-22 17:16:33 +0000
3+++ src/ubuntumirclient/cursor.cpp 2016-09-28 09:28:51 +0000
4@@ -26,25 +26,30 @@
5 UbuntuCursor::UbuntuCursor(MirConnection *connection)
6 : mConnection(connection)
7 {
8- mShapeToCursorName[Qt::ArrowCursor] = "left_ptr";
9+ /*
10+ * TODO: Add the missing cursors to Mir (LP: #1388987)
11+ * Those are the ones without a mir_ prefix, which are X11 cursors
12+ * and won't be understood by any shell other than Unity8.
13+ */
14+ mShapeToCursorName[Qt::ArrowCursor] = mir_arrow_cursor_name;
15 mShapeToCursorName[Qt::UpArrowCursor] = "up_arrow";
16- mShapeToCursorName[Qt::CrossCursor] = "cross";
17- mShapeToCursorName[Qt::WaitCursor] = "watch";
18- mShapeToCursorName[Qt::IBeamCursor] = "xterm";
19- mShapeToCursorName[Qt::SizeVerCursor] = "size_ver";
20- mShapeToCursorName[Qt::SizeHorCursor] = "size_hor";
21- mShapeToCursorName[Qt::SizeBDiagCursor] = "size_bdiag";
22- mShapeToCursorName[Qt::SizeFDiagCursor] = "size_fdiag";
23- mShapeToCursorName[Qt::SizeAllCursor] = "size_all";
24- mShapeToCursorName[Qt::BlankCursor] = "blank";
25- mShapeToCursorName[Qt::SplitVCursor] = "split_v";
26- mShapeToCursorName[Qt::SplitHCursor] = "split_h";
27- mShapeToCursorName[Qt::PointingHandCursor] = "hand";
28+ mShapeToCursorName[Qt::CrossCursor] = mir_crosshair_cursor_name;
29+ mShapeToCursorName[Qt::WaitCursor] = mir_busy_cursor_name;
30+ mShapeToCursorName[Qt::IBeamCursor] = mir_caret_cursor_name;
31+ mShapeToCursorName[Qt::SizeVerCursor] = mir_vertical_resize_cursor_name;
32+ mShapeToCursorName[Qt::SizeHorCursor] = mir_horizontal_resize_cursor_name;
33+ mShapeToCursorName[Qt::SizeBDiagCursor] = mir_diagonal_resize_bottom_to_top_cursor_name;
34+ mShapeToCursorName[Qt::SizeFDiagCursor] = mir_diagonal_resize_top_to_bottom_cursor_name;
35+ mShapeToCursorName[Qt::SizeAllCursor] = mir_omnidirectional_resize_cursor_name;
36+ mShapeToCursorName[Qt::BlankCursor] = mir_disabled_cursor_name;
37+ mShapeToCursorName[Qt::SplitVCursor] = mir_vsplit_resize_cursor_name;
38+ mShapeToCursorName[Qt::SplitHCursor] = mir_hsplit_resize_cursor_name;
39+ mShapeToCursorName[Qt::PointingHandCursor] = mir_pointing_hand_cursor_name;
40 mShapeToCursorName[Qt::ForbiddenCursor] = "forbidden";
41 mShapeToCursorName[Qt::WhatsThisCursor] = "whats_this";
42 mShapeToCursorName[Qt::BusyCursor] = "left_ptr_watch";
43- mShapeToCursorName[Qt::OpenHandCursor] = "openhand";
44- mShapeToCursorName[Qt::ClosedHandCursor] = "closedhand";
45+ mShapeToCursorName[Qt::OpenHandCursor] = mir_open_hand_cursor_name;
46+ mShapeToCursorName[Qt::ClosedHandCursor] = mir_closed_hand_cursor_name;
47 mShapeToCursorName[Qt::DragCopyCursor] = "dnd-copy";
48 mShapeToCursorName[Qt::DragMoveCursor] = "dnd-move";
49 mShapeToCursorName[Qt::DragLinkCursor] = "dnd-link";

Subscribers

People subscribed via source and target branches