Mir

Merge lp:~brandontschaefer/mir/pointer-confinement-demo into lp:mir

Proposed by Brandon Schaefer
Status: Merged
Approved by: Daniel van Vugt
Approved revision: no longer in the source branch.
Merged at revision: 3624
Proposed branch: lp:~brandontschaefer/mir/pointer-confinement-demo
Merge into: lp:mir
Diff against target: 304 lines (+289/-0)
2 files modified
examples/CMakeLists.txt (+6/-0)
examples/pointer_confinement.c (+283/-0)
To merge this branch: bzr merge lp:~brandontschaefer/mir/pointer-confinement-demo
Reviewer Review Type Date Requested Status
Mir CI Bot continuous-integration Approve
Daniel van Vugt Approve
Alan Griffiths Approve
Review via email: mp+300141@code.launchpad.net

Commit message

A demo to show off pointer confinement and a way to test it out. Need to look at fullscreen and other possible issues.

Description of the change

A demo to show off pointer confinement and a way to test it out. Need to look at fullscreen and other possible issues.

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

FAILED: Continuous integration, rev:3591
https://mir-jenkins.ubuntu.com/job/mir-ci/1289/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/1508/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1561
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1552
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1552
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1552
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1523/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1523/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1523/console
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1523/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1523
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1523/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1523/console

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1289/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3593
https://mir-jenkins.ubuntu.com/job/mir-ci/1300/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/1525/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1578
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1569
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1569
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1569
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1540
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1540/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1540
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1540/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1540/console
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1540/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1540
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1540/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1540
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1540/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1300/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3594
https://mir-jenkins.ubuntu.com/job/mir-ci/1302/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/1527/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1580
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1571
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1571
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1571
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1542
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1542/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1542
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1542/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1542/console
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1542/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1542
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1542/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1542
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1542/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1302/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3596
https://mir-jenkins.ubuntu.com/job/mir-ci/1303/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/1528/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1581
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1572
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1572
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1572
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1543
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1543/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1543
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1543/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1543/console
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1543/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1543
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1543/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1543
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1543/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1303/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3596
https://mir-jenkins.ubuntu.com/job/mir-ci/1322/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/1558/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1611
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1602
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1602
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1602
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1573
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1573/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1573
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1573/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1573/console
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1573/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1573
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1573/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1573
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1573/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1322/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3597
https://mir-jenkins.ubuntu.com/job/mir-ci/1323/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/1560/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1613
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1604
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1604
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1604
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1575
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1575/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1575
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1575/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1575/console
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1575/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1575
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1575/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1575
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1575/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1323/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3598
https://mir-jenkins.ubuntu.com/job/mir-ci/1324/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/1561/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1614
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1605
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1605
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1605
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1576
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1576/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1576/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1576/console
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1576/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1576
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1576/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1576
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1576/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1324/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3599
https://mir-jenkins.ubuntu.com/job/mir-ci/1325/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/1562
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1615
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1606
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1606
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1606
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1577
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1577/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1577
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1577/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1577
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1577/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1577
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1577/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1577
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1577/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1325/rebuild

review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

I'm not sure what the expected behaviour is, or whether the pointer confinement implementation or demo is broken but...

Scenario #1:

$ sudo bin/mir_demo_server --vt 4 --launch bin/mir_demo_client_pointer_confinement

1. Initially you see two "cursors" - the server's arrow and the client's box
2. Drag Alt+Middle down and right to resize the client to a smaller rectangle and release

Result: the server's arrow disappears and the client resizes

3. Move the mouse

Result: the server's arrow reappears next to the client
... the server's arrow is confined to the original client area
... when the server's arrow is over the client it disappears and the red box moves erratically

Scenario #1:

$ sudo bin/mir_demo_server --vt 4 --launch bin/mir_demo_client_pointer_confinement

1. Initially you see two "cursors" - the server's arrow and the client's box
2. Drag Alt+Primary down and right to move the client and release

Result: the server's arrow disappears and the client moves

3. Move the mouse

Result: the server's arrow reappears in the original client area
... the server's arrow is confined to the original client area
... when the server's arrow is over the client it disappears and the red box moves erratically

review: Needs Fixing
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Pointer confinement is whats broken. This demo just hides the cursor (when confined) and moves the red square based on the dx/dy (though it can be quite jump if you move a lot). Any suggestions are welcome to making it more appealing. I dont think anything is *broken* in the demo, just need to fix pointer confinement.

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> Pointer confinement is whats broken. This demo just hides the cursor (when
> confined) and moves the red square based on the dx/dy (though it can be quite
> jump if you move a lot). Any suggestions are welcome to making it more
> appealing. I dont think anything is *broken* in the demo, just need to fix
> pointer confinement.

OK

review: Approve
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

OTOH the movement of the red square is so erratic it doesn't "feel" like a cursor. (And if you resize the window the speed is wrong - e.g. after Alt+F11 to fullscreen I need hardly move the mouse to cross the whole display.)

Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

I suppose i can divide the dx/dy by 2 to slow the raw dx/dy down. The main issue is that im keeping it at 400x400 soo it fits on krillin. Though I should just get the width/height and set it to half so theres more room to move around.

The issue with fullscreen is it seems to stretch the window over the fullscreen? Im not really sure how fullscreen is working under the hood but all im doing is setting the window state. Ill try to make to a bit smoother though!

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

Nice. I needed an example, thanks. Just a few issues...

(1) Mouse is a bit erratic/unresponsive because mouse_x/y should be float, not int. As dx/dy are floats and libinput gives them values less than 1. You're adding fractional values to ints so for anything other than fast mouse movements it won't respond.

(2) It's C++ that's very close to being plain C. Consider renaming .cpp to .c and just replacing std::atomics with float/sig_atomic_t. You won't need locking primitives for the mouse_x/y stuff because it's technically equally racy either way :)

(3) I can Alt+drag the window while it has the cursor grabbed, and it will stop when the invisible cursor hits the screen edge. Seems like we're missing something to tell the shell to not be able to Alt+drag the window while it has the cursor grabbed.

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

(4) Need more comments explaining what this is (?)

251 +
252 + /*|-----------|
253 + *| 3 4-0 |
254 + *| / |
255 + *| 5-1 2 |
256 + *|-----------|
257 + **/

On that note, you could just upload the same vertices each time without recalculating them and set a uniform 2f to the vertex shader to translate each time (like examples/target.c). But with so few vertices it's probably not worth it and less code as is.

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

(5) Window resizing is not being handled (square and its motion get squashed/amplified in one dimensions). See other demo clients for how to handle that.

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

(6) There's no need for v_color if it's constant. Just make the colour a uniform instead of an attribute and use it in the fragment shader (not the vertex shader). Or even better, get rid of all the "_color" code and just have a trivial fragment shader:

    gl_FragColor = vec4(1.0,0.0,0.0,1.0);

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3602
https://mir-jenkins.ubuntu.com/job/mir-ci/1353/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/1611/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1664
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1655
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1655
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1655
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1626/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1626
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1626/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1626
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1626/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1626
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1626/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1626
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1626/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1353/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3603
https://mir-jenkins.ubuntu.com/job/mir-ci/1354/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/1612
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1665
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1656
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1656
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1656
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1627
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1627/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1627
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1627/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1627
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1627/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1627
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1627/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1627
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1627/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1354/rebuild

review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks for that. I was only blocking on (1) getting fixed. I'd still like to see the rest cleaned up some time in future.

More observations:

(7) It's strange clients can get relative motion events at all when they don't have the pointer confined, because the motion of course suddenly stops if the unconfined cursor leaves the surface.

(8) Consider this :) ... I realized only recently "confinement" is not sufficient to solve the menus problem. For that we need an unconfined pointer with fully grabbed events -> bug 1506713

review: Approve
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Autolanding.
Unapproved changes made after approval.
https://mir-jenkins.ubuntu.com/job/mir-autolanding/429/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/1622
    None: https://mir-jenkins.ubuntu.com/job/generic-land-mp/459/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1675
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1666
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1666
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1666
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1637
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1637/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1637
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1637/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1637
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1637/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1637
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1637/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1637
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1637/artifact/output/*zip*/output.zip

review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
https://mir-jenkins.ubuntu.com/job/mir-autolanding/429/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/1622
    FAILURE: https://mir-jenkins.ubuntu.com/job/generic-land-mp/459/console
    None: https://mir-jenkins.ubuntu.com/job/generic-land-mp/460/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1675
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1666
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1666
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1666
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1637
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1637/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1637
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1637/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1637
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1637/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1637
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1637/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1637
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1637/artifact/output/*zip*/output.zip

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The change from fmod to abs in r3604 needs re-testing/review as mir-ci-bot points out

review: Needs Information
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3604
https://mir-jenkins.ubuntu.com/job/mir-ci/1360/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/1625/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1678
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1669
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1669
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1669
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1640/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1640
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1640/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1640
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1640/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1640
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1640/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1640
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1640/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1360/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3605
https://mir-jenkins.ubuntu.com/job/mir-ci/1361/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/1626/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1679
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1670
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1670
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1670
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1641
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1641/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1641
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1641/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1641
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1641/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1641
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1641/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1641/console

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1361/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3606
https://mir-jenkins.ubuntu.com/job/mir-ci/1362/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/1627/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1680
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1671
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1671
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1671
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1642/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1642
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1642/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1642
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1642/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1642
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1642/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1642
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1642/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1362/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3606
https://mir-jenkins.ubuntu.com/job/mir-ci/1367/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/1640
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1693
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1684
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1684
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1684
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1655
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1655/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1655
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1655/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1655
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1655/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1655
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1655/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1655
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1655/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1367/rebuild

review: Approve (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3607
https://mir-jenkins.ubuntu.com/job/mir-ci/1368/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/1641/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1694
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1685
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1685
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1685
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1656
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1656/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1656/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1656
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1656/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1656
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1656/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1656/console

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1368/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3607
https://mir-jenkins.ubuntu.com/job/mir-ci/1371/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/1644
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1697
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1688
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1688
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1688
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1659
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1659/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1659
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1659/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1659
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1659/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1659
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1659/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1659
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1659/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1371/rebuild

review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Just re-tested and found that if you move the mouse left enough times, the red square goes missing off-screen and is hard to get back.

review: Needs Fixing
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Fixed now

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

Works now, thanks.

For those playing at home, the performance issues were:
  1. Use of int coordinates that should be float (thanks to libinput for that requirement).
  2. Drawing your own cursor in a triple-buffered client is naturally laggy (two frames behind). But we understand that problem fully and you can avoid the lag by switching to swap interval zero with: mir_demo_client_pointer_confinement -n

review: Approve
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
https://mir-jenkins.ubuntu.com/job/mir-autolanding/444/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/1675/console
    None: https://mir-jenkins.ubuntu.com/job/generic-land-mp/476/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1728
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1719
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1719
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1719
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1691/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1691
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1691/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/1691
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/1691/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1691
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1691/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1691
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1691/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1691
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1691/artifact/output/*zip*/output.zip

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Failure is unrelated to this branch. Weird these always appear together:

06:29:23 9: [ FAILED ] 5 tests, listed below:
06:29:23 9: [ FAILED ] ServerDisconnect.is_detected_by_client
06:29:23 9: [ FAILED ] ServerDisconnect.doesnt_stop_client_calling_API_functions
06:29:23 9: [ FAILED ] ServerStartup.creates_endpoint_on_filesystem
06:29:23 9: [ FAILED ] ServerStartup.after_server_sigkilled_can_start_new_instance
06:29:23 9: [ FAILED ] UnresponsiveClient.does_not_hang_server

review: Approve
Revision history for this message
Mir CI Bot (mir-ci-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/CMakeLists.txt'
2--- examples/CMakeLists.txt 2016-06-02 05:33:50 +0000
3+++ examples/CMakeLists.txt 2016-08-02 18:38:20 +0000
4@@ -70,6 +70,12 @@
5 target_link_libraries(mir_demo_client_target
6 eglapp
7 )
8+mir_add_wrapped_executable(mir_demo_client_pointer_confinement
9+ pointer_confinement.c
10+)
11+target_link_libraries(mir_demo_client_pointer_confinement
12+ eglapp
13+)
14 mir_add_wrapped_executable(mir_demo_client_camera
15 camera.c
16 )
17
18=== added file 'examples/pointer_confinement.c'
19--- examples/pointer_confinement.c 1970-01-01 00:00:00 +0000
20+++ examples/pointer_confinement.c 2016-08-02 18:38:20 +0000
21@@ -0,0 +1,283 @@
22+/*
23+ * Copyright © 2016 Canonical Ltd.
24+ *
25+ * This program is free software: you can redistribute it and/or modify
26+ * it under the terms of the GNU General Public License version 3 as
27+ * published by the Free Software Foundation.
28+ *
29+ * This program is distributed in the hope that it will be useful,
30+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
31+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32+ * GNU General Public License for more details.
33+ *
34+ * You should have received a copy of the GNU General Public License
35+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
36+ *
37+ * Author: Brandon Schaefer <brandon.schaefer@canonical.com>
38+ */
39+
40+#include "eglapp.h"
41+#include "mir_toolkit/mir_client_library.h"
42+
43+#include <GLES2/gl2.h>
44+#include <assert.h>
45+#include <stdio.h>
46+#include <signal.h>
47+#include <math.h>
48+
49+float mouse_x = 0.0f;
50+float mouse_y = 0.0f;
51+sig_atomic_t done = false;
52+
53+static void shutdown(int signum)
54+{
55+ if (!done)
56+ {
57+ done = true;
58+ printf("Signal %d received. Good night.\n", signum);
59+ }
60+}
61+
62+static float normalize(float xy, float wh, float size) { return (xy - wh/2.0f + size) / (wh/2.0f); }
63+
64+static GLuint load_shader(const char* src, GLenum type)
65+{
66+ GLuint shader = glCreateShader(type);
67+ if (shader)
68+ {
69+ GLint compiled;
70+ glShaderSource(shader, 1, &src, NULL);
71+ glCompileShader(shader);
72+ glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
73+ if (!compiled)
74+ {
75+ GLchar log[1024];
76+ glGetShaderInfoLog(shader, sizeof log - 1, NULL, log);
77+ log[sizeof log - 1] = '\0';
78+ printf("load_shader compile failed: %s\n", log);
79+ glDeleteShader(shader);
80+ shader = 0;
81+ }
82+ }
83+ return shader;
84+}
85+
86+static void handle_input_event(MirInputEvent const* event, MirSurface* surface)
87+{
88+ if (mir_input_event_get_type(event) == mir_input_event_type_pointer)
89+ {
90+ MirPointerEvent const* pev = mir_input_event_get_pointer_event(event);
91+ float dx = mir_pointer_event_axis_value(pev, mir_pointer_axis_relative_x);
92+ float dy = mir_pointer_event_axis_value(pev, mir_pointer_axis_relative_y);
93+
94+ mouse_x += dx;
95+ // - because opengl coords
96+ mouse_y += -dy;
97+ }
98+ else if (mir_input_event_get_type(event) == mir_input_event_type_key)
99+ {
100+ MirKeyboardEvent const* kev = mir_input_event_get_keyboard_event(event);
101+ int key_code = mir_keyboard_event_key_code(kev);
102+
103+ if (mir_keyboard_event_action(kev) != mir_keyboard_action_up)
104+ return;
105+
106+ if (key_code == XKB_KEY_q)
107+ {
108+ done = true;
109+ }
110+ else if (key_code == XKB_KEY_p)
111+ {
112+ // We start out grabbed
113+ static bool grabbed = true;
114+
115+ MirSurfaceSpec* spec = mir_connection_create_spec_for_changes(mir_eglapp_native_connection());
116+ MirPointerConfinementState state = mir_pointer_unconfined;
117+ MirCursorConfiguration* conf = NULL;
118+
119+ if (!grabbed)
120+ {
121+ state = mir_pointer_confined_to_surface;
122+ }
123+ else
124+ {
125+ conf = mir_cursor_configuration_from_name(mir_default_cursor_name);
126+ }
127+
128+ grabbed = !grabbed;
129+
130+ mir_surface_spec_set_pointer_confinement(spec, state);
131+
132+ mir_surface_apply_spec(surface, spec);
133+ mir_surface_spec_release(spec);
134+
135+ // If we are grabbing we'll make it NULL which will hide the cursor
136+ mir_surface_configure_cursor(surface, conf);
137+ mir_cursor_configuration_destroy(conf);
138+ }
139+ else if (key_code == XKB_KEY_f)
140+ {
141+ static bool fullscreen = false;
142+ MirSurfaceSpec* spec = mir_connection_create_spec_for_changes(mir_eglapp_native_connection());
143+ MirSurfaceState state = mir_surface_state_restored;
144+
145+ if (!fullscreen)
146+ {
147+ state = mir_surface_state_fullscreen;
148+ }
149+
150+ fullscreen = !fullscreen;
151+
152+ mir_surface_spec_set_state(spec, state);
153+ mir_surface_apply_spec(surface, spec);
154+ mir_surface_spec_release(spec);
155+ }
156+ }
157+}
158+
159+static void handle_event(MirSurface* surface, MirEvent const* event, void* context)
160+{
161+ (void) context;
162+ switch (mir_event_get_type(event))
163+ {
164+ case mir_event_type_input:
165+ handle_input_event(mir_event_get_input_event(event), surface);
166+ break;
167+ default:
168+ break;
169+ }
170+}
171+
172+static float fmodulus(float x, float y)
173+{
174+ float mod = fmod(x, y);
175+ if (mod < 0.0f)
176+ {
177+ mod += y;
178+ }
179+
180+ return mod;
181+}
182+
183+int main(int argc, char* argv[])
184+{
185+ char const v_shader_src[] =
186+ "attribute vec4 v_position; \n"
187+ " \n"
188+ "void main() \n"
189+ "{ \n"
190+ " gl_Position = v_position; \n"
191+ "} \n";
192+
193+ char const f_shader_src[] =
194+ "#ifdef GL_ES \n"
195+ "precision mediump float; \n"
196+ "#endif \n"
197+ " \n"
198+ "void main() \n"
199+ "{ \n"
200+ " gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); \n"
201+ "} \n";
202+
203+ int sqaure_size = 10;
204+ unsigned int width = 0, height = 0;
205+ if (!mir_eglapp_init(argc, argv, &width, &height))
206+ return 1;
207+
208+ width /= 2;
209+ height /= 2;
210+
211+ MirSurfaceSpec* spec = mir_connection_create_spec_for_changes(mir_eglapp_native_connection());
212+ mir_surface_spec_set_width (spec, width);
213+ mir_surface_spec_set_height(spec, height);
214+
215+ mir_surface_apply_spec(mir_eglapp_native_surface(), spec);
216+ mir_surface_spec_release(spec);
217+
218+ mouse_x = width / 2.0;
219+ mouse_y = height / 2.0;
220+
221+ GLuint vshader = load_shader(v_shader_src, GL_VERTEX_SHADER);
222+ assert(vshader);
223+ GLuint fshader = load_shader(f_shader_src, GL_FRAGMENT_SHADER);
224+ assert(fshader);
225+ GLuint prog = glCreateProgram();
226+ assert(prog);
227+ glAttachShader(prog, vshader);
228+ glAttachShader(prog, fshader);
229+ glLinkProgram(prog);
230+
231+ GLint linked;
232+ glGetProgramiv(prog, GL_LINK_STATUS, &linked);
233+ if (!linked)
234+ {
235+ GLchar log[1024];
236+ glGetProgramInfoLog(prog, sizeof log - 1, NULL, log);
237+ log[sizeof log - 1] = '\0';
238+ printf("Link failed: %s\n", log);
239+ return 2;
240+ }
241+
242+ glUseProgram(prog);
243+
244+ MirSurface* surface = mir_eglapp_native_surface();
245+ mir_surface_set_event_handler(surface, handle_event, NULL);
246+
247+ spec = mir_connection_create_spec_for_changes(mir_eglapp_native_connection());
248+ mir_surface_spec_set_pointer_confinement(spec, mir_pointer_confined_to_surface);
249+
250+ mir_surface_apply_spec(surface, spec);
251+ mir_surface_spec_release(spec);
252+
253+ // Hide cursor
254+ mir_surface_configure_cursor(surface, NULL);
255+
256+ glClearColor(0.3f, 0.3f, 0.3f, 1.0f);
257+
258+ signal(SIGINT, shutdown);
259+ signal(SIGTERM, shutdown);
260+ signal(SIGHUP, shutdown);
261+
262+ while (!done)
263+ {
264+ glClear(GL_COLOR_BUFFER_BIT);
265+ glEnable(GL_BLEND);
266+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
267+
268+ /*|-----------|
269+ *| 3 4-0 |
270+ *| / |
271+ *| 5-1 2 |
272+ *|-----------|
273+ **/
274+ float mod_x = fmodulus(mouse_x, width);
275+ float mod_y = fmodulus(mouse_y, height);
276+
277+ float four_zero_x = normalize(mod_x, width, sqaure_size);
278+ float four_zero_y = normalize(mod_y, height, sqaure_size);
279+
280+ float five_one_x = normalize(mod_x, width, 0.0f);
281+ float five_one_y = normalize(mod_y, height, 0.0f);
282+
283+ float two_x = normalize(mod_x, width, sqaure_size);
284+ float two_y = normalize(mod_y, height, 0.0f);
285+
286+ float three_x = normalize(mod_x, width, 0.0f);
287+ float three_y = normalize(mod_y, height, sqaure_size);
288+
289+ GLfloat square_vert[] = { five_one_x , five_one_y , 0.0f,
290+ two_x , two_y , 0.0f,
291+ three_x , three_y , 0.0f,
292+ four_zero_x, four_zero_y, 0.0f };
293+
294+ glEnableVertexAttribArray(0);
295+
296+ glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, square_vert);
297+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
298+
299+ mir_eglapp_swap_buffers();
300+ }
301+
302+ mir_eglapp_shutdown();
303+ return 0;
304+}

Subscribers

People subscribed via source and target branches