Mir

Merge lp://qastaging/~alan-griffiths/mir/client-initiates-user-move-and-resize into lp://qastaging/mir

Proposed by Alan Griffiths
Status: Merged
Approved by: Daniel van Vugt
Approved revision: no longer in the source branch.
Merged at revision: 4129
Proposed branch: lp://qastaging/~alan-griffiths/mir/client-initiates-user-move-and-resize
Merge into: lp://qastaging/mir
Prerequisite: lp://qastaging/~alan-griffiths/mir/request-with-authority
Diff against target: 385 lines (+293/-0)
9 files modified
include/client/mir_toolkit/mir_window.h (+9/-0)
src/client/mir_surface.cpp (+5/-0)
src/client/mir_surface.h (+1/-0)
src/client/mir_surface_api.cpp (+14/-0)
src/client/symbols.map (+2/-0)
src/protobuf/mir_protobuf.proto (+1/-0)
tests/acceptance-tests/CMakeLists.txt (+1/-0)
tests/acceptance-tests/client_mediated_user_gestures.cpp (+259/-0)
tests/acceptance-tests/drag_and_drop.cpp (+1/-0)
To merge this branch: bzr merge lp://qastaging/~alan-griffiths/mir/client-initiates-user-move-and-resize
Reviewer Review Type Date Requested Status
Mir CI Bot continuous-integration Approve
Gerry Boland (community) Abstain
Daniel van Vugt Abstain
Chris Halse Rogers Approve
Andreas Pokorny (community) Approve
Review via email: mp+320917@code.qastaging.launchpad.net

Commit message

Client side and initial tests for a client initiating a user move gesture

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

PASSED: Continuous integration, rev:4112
https://mir-jenkins.ubuntu.com/job/mir-ci/3238/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/4358
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4445
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4435
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4435
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4435
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4390
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4390/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/4390
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4390/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4390
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4390/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/4390
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4390/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/4390
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4390/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/4390
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4390/artifact/output/*zip*/output.zip

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

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

I've linked the 'move' bug 1420334.

But why write more code for client-initiated resizing? That already works :)

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

As an example of a self-resizing client, try 'tiled' which has a resize grip in the bottom right corner. It already works.

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

> I've linked the 'move' bug 1420334.
>
> But why write more code for client-initiated resizing? That already works :)

No it doesn't. ;)

I agree clients can resize, but they can't request the shell to initiate a resize gesture. There is no way to invoke the touch resize handles under U8, drag the left edge or top.

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

That's true, but the feature you're talking about in Unity7 also does not have resize handles (right click titlebar and then Resize, or just Alt+F8).

So either the client initiates the resize, and that works perfectly already; or
the server initiates resize, and that works perfectly already too.

Even if you did want it to pop up the resize handles, that's still a shell operation since the window menu itself is part of the shell. Not part of the client.

I think this branch should be just about movement.

Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

There is a difference between submitting a buffer with a different size, and resizing a window. So if we want to support CSD, this change is necessary.

review: Approve
Revision history for this message
Gerry Boland (gerboland) wrote :

How is this API to be used by the client? I.e. where is the client specifying the new size/position?

Is it that the client gets a mouseDown event with a cookie that it decides should cause a resize/move, so calls the mir_window_request_user_resize with that cookie. Then
(a) shell intercepts all other input events, instead sending resize events to the client? Or
(b) shell keep sending the mouseMove events to the client, and client resizes its window/buffer as it pleases (WM can restrict those choices though)?
On resize completion, mouseUp event finally sent to client?

If a user wants to resize the top-left corner of a window, is that a move & resize? Should that be an atomic operation instead?

The only reason I see that Mir's current window resize api is insufficient for client-size-initiated-resize is the cursor - we want the cursor to be the shell-themed resize image, and to remain that image even if the cursor moves beyond the window borders.

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

> How is this API to be used by the client? I.e. where is the client specifying
> the new size/position?

The client isn't specifying the position or size. It is requesting the shell treats an input event as the beginning of a gesture.

> Is it that the client gets a mouseDown event with a cookie that it decides
> should cause a resize/move, so calls the mir_window_request_user_resize with
> that cookie. Then
> (a) shell intercepts all other input events, instead sending resize events to
> the client? Or
> (b) shell keep sending the mouseMove events to the client, and client resizes
> its window/buffer as it pleases (WM can restrict those choices though)?
> On resize completion, mouseUp event finally sent to client?

(a)

> If a user wants to resize the top-left corner of a window, is that a move &
> resize? Should that be an atomic operation instead?

That's an atomic operation in those shells that currently support it. Initiating the resize through a client API shouldn't change that.

> The only reason I see that Mir's current window resize api is insufficient for
> client-size-initiated-resize is the cursor - we want the cursor to be the
> shell-themed resize image, and to remain that image even if the cursor moves
> beyond the window borders.

Hmm, I can see it will be easier to reach consensus on the USER_MOVE codepath. Maybe I should split that out?

Revision history for this message
William Hua (attente) wrote :

Andreas is right, even if we can change the buffer size, this isn't the same as requesting a resize operation from an input event.

In gtk, we have this api we're expected to implement:

https://git.gnome.org/browse/gtk+/tree/gdk/gdkwindow.c#n8649

So for mir_window_request_user_resize(), I'd expect it to be able to at least accept a directional argument that allows us to do a fixed resize in a certain direction. I believe there should also be special semantics if the client doesn't specify any direction, where the server should decide that based on the initial mouse motion or initial arrow key press.

I wouldn't expect the client to get a mouse up event on completion of the resize, or any events other than resize ones during the client's resizing. So from Gerry's comment, (a) is the most sensible for us in gtk, especially from the api's point of view. If there's non-resizable windows, the server should already know that from the time the window was created, and just reject any resize operation in that case.

It also needs to be implemented so that the user can also resize using the keyboard arrow keys as well.

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

> Hmm, I can see it will be easier to reach consensus on the USER_MOVE codepath.
> Maybe I should split that out?

OK, I'm dropping the resize code from this MP as it clearly needs further consideration.

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

PASSED: Continuous integration, rev:4115
https://mir-jenkins.ubuntu.com/job/mir-ci/3253/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/4381
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4470
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4460
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4460
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4460
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4413
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4413/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/4413
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4413/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4413
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4413/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/4413
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4413/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/4413
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4413/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/4413
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4413/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Revision history for this message
Chris Halse Rogers (raof) wrote :

This seems sensible to me.

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

*shrug*

My request has been satisfied but I would hazard a guess this functionality may take us a few attempts to cover all the major use cases.

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

I'm fairly sure we need zero more work done on resizing. All the resizing use cases are covered by existing APIs.

On the topic of client-initiated movement though, please start thinking about the Chrome/Chromium use case too: You drag a tab out of the window, that then creates a new window where the cursor remains on the same relative tab coordinate in the new window. If it's not baked in to the drag action then we'll need to be able to create that new top-level window at a precise coordinate relative to the old window (which may be the parent but can also be closed leaving just the child open).

Revision history for this message
Gerry Boland (gerboland) wrote :

No objections here

review: Abstain
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/1243/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/4408/console
    None: https://mir-jenkins.ubuntu.com/job/generic-land-mp/1312/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4500/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4490/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4490/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4490/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4440/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4440/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4440/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4440/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4440/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4440/console

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

04:02:04 Text conflict in src/client/mir_surface.cpp
04:02:04 1 conflicts encountered.

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

PASSED: Continuous integration, rev:4116
https://mir-jenkins.ubuntu.com/job/mir-ci/3277/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/4418
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4510
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4500
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4500
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4500
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4450
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4450/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/4450
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4450/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4450
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4450/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/4450
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4450/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/4450
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4450/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/4450
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4450/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches