Merge lp:~alan-griffiths/mir/first-pass-of-surface-spec-modification into lp:mir
| Status: | Merged | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Approved by: | Alan Griffiths on 2015-04-14 | ||||||||
| Approved revision: | 2488 | ||||||||
| Merged at revision: | 2484 | ||||||||
| Proposed branch: | lp:~alan-griffiths/mir/first-pass-of-surface-spec-modification | ||||||||
| Merge into: | lp:mir | ||||||||
| Prerequisite: | lp:~alan-griffiths/mir/some-surface-modification-infrastructure | ||||||||
| Diff against target: |
397 lines (+184/-56) 9 files modified
include/client/mir_toolkit/mir_surface.h (+23/-3) src/client/mir_surface.cpp (+1/-2) src/client/mir_surface.h (+1/-3) src/client/mir_surface_api.cpp (+41/-40) src/client/symbols.map (+2/-0) src/server/shell/canonical_window_manager.cpp (+36/-5) src/server/shell/canonical_window_manager.h (+7/-0) tests/acceptance-tests/test_client_surfaces.cpp (+3/-3) tests/acceptance-tests/test_surface_modifications.cpp (+70/-0) |
||||||||
| To merge this branch: | bzr merge lp:~alan-griffiths/mir/first-pass-of-surface-spec-modification | ||||||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Robert Carr (community) | Approve on 2015-04-14 | ||
| Kevin DuBois (community) | Approve on 2015-04-14 | ||
| PS Jenkins bot | continuous-integration | Approve on 2015-04-14 | |
| Thomas Voß (community) | Approve on 2015-04-14 | ||
| Alexandros Frantzis (community) | Approve on 2015-04-14 | ||
| Alberto Aguirre | Approve on 2015-04-13 | ||
| Alan Griffiths | Abstain on 2015-04-13 | ||
| Chris Halse Rogers | 2015-04-09 | Approve on 2015-04-13 | |
|
Review via email:
|
|||
Commit Message
client API, shell: start exposing the surface spec modification functionality
Description of the Change
client API, shell: start exposing the surface spec modification functionality
- 2477. By Alan Griffiths on 2015-04-09
-
merge lp:mir
- 2478. By Alan Griffiths on 2015-04-09
-
TODOs about outstanding work on resize implementation
| Chris Halse Rogers (raof) wrote : | # |
This looks mostly sensible, but does mean that we need a separate API for introspecting the state of surfaces. IIRC the longer-term plan was to move all the surface introspection into MirSurfaceSpec accessors and deprecate things such as MirSurfaceParam
That said, now that I think of it some more, I think being able to get a SurfaceSpec from an existing surface and apply it would probably a misfeature, as the possibility for clients to accidentally override user changes would be high.
Hm. If we need to support morphing from different surface types - dialog to normal, for example - we'll need to have a mir_surface_
I'm not sure what I think about this. On the one hand, it might be nice to not have the same type for both. On the other, that's obvious duplication. I guess I lean towards the former; one type with perhaps surprising behaviour.
17 +mir_connection
Why does this take a MirConnection? It's not used for anything, and it doesn't seem likely that it'll be used for anything in the future.
| Chris Halse Rogers (raof) wrote : | # |
I guess that's “needs discussion” ☺
| Alan Griffiths (alan-griffiths) wrote : | # |
*Needs Discussion*
> This looks mostly sensible, but does mean that we need a separate API for
> introspecting the state of surfaces. IIRC the longer-term plan was to move all
> the surface introspection into MirSurfaceSpec accessors and deprecate things
> such as MirSurfaceParam
While I'm not strongly against it I'm not sure there is currently such a plan. The client trying to use the "existing state" with a surface specification leads to synchronization issues. Like this:
> That said, now that I think of it some more, I think being able to get a
> SurfaceSpec from an existing surface and apply it would probably a misfeature,
> as the possibility for clients to accidentally override user changes would be
> high.
~~~~
> Hm. If we need to support morphing from different surface types - dialog to
> normal, for example - we'll need to have a mir_surface_
> will be somewhat redundant with the mir_connection_
> of functions. A client would be able to mir_create_
> all the same details as mir_connection_
> pass it to mir_surface_
> an abort(), because the MirConnection isn't set.
>
> I'm not sure what I think about this. On the one hand, it might be nice to not
> have the same type for both. On the other, that's obvious duplication. I guess
> I lean towards the former; one type with perhaps surprising behaviour.
Well, while MirSurfaceSpec isn't currently polymorphic the various mir_surface_
For example, mir_surface_
Alternatively, we could just constrain the state of MirSurfaceSpec in the functions that accept it and use the various mir_connection_
> 17 +mir_connection
> Why does this take a MirConnection? It's not used for anything, and it doesn't
> seem likely that it'll be used for anything in the future.
Initially it was for consistency, but given the points you raise above we could use it to initialize MirSurfaceSpec:
Although, if we decide on that approach this function should probably be renamed mir_connection_
- 2479. By Alan Griffiths on 2015-04-10
-
merge lp:mir
- 2480. By Alan Griffiths on 2015-04-10
-
merge lp:~alan-griffiths/mir/some-surface-modification-infrastructure
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2480
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 2481. By Alan Griffiths on 2015-04-10
-
Reuse existing constraint logic on resize
- 2482. By Alan Griffiths on 2015-04-10
-
merge lp:mir
- 2483. By Alan Griffiths on 2015-04-10
-
SurfaceModifica
tions.surface_ spec_change_ [width| height] _is_notified
| Kevin DuBois (kdub) wrote : | # |
nits:
93 namespace { // Private for now. TODO: Finalize and publish later (LP: #1422522)
comment needs removal
46 +
47 +
extra whitespace
57 +MirSurfaceSpec
could we just remove this, and keep MirSurfaceSpec() = default?
| Kevin DuBois (kdub) wrote : | # |
As for the API changes, I'm all for publishing some sort of surface-changing functions (with a slightly different way proposed in the rfc-branch https:/
My points here:
After I call mir_surface_
This also leads to the topic of guaranteeing that the surface is in a particular state while the client decides what to do with the surface next. Like, it seems sensible that we have to lock the surface state, and then apply all the changes at once, and then 'unlock' the surface for further server-started changes.
It also seems that just rejecting change-specs the server doesn't like will lead to a somewhat frustrating back-and-forth for the clients trying to apply the change they want and then being told for non-obvious reasons that the change that was requested was rejected.
- 2484. By Alan Griffiths on 2015-04-10
-
Fix nits
| Alan Griffiths (alan-griffiths) wrote : | # |
> nits:
> 93 namespace { // Private for now. TODO: Finalize and publish later (LP:
> #1422522)
> comment needs removal
Done
>
> 46 +
> 47 +
> extra whitespace
Done
> 57 +MirSurfaceSpec
> could we just remove this, and keep MirSurfaceSpec() = default?
We could, but there's no advantage to having it inline (and it might change as result of discussion).
| Alan Griffiths (alan-griffiths) wrote : | # |
> As for the API changes, I'm all for publishing some sort of surface-changing
> functions (with a slightly different way proposed in the rfc-branch
> https:/
But isn't that now about arranging buffer streams within a surface, and not to do with modifying the surface.
> My points here:
> After I call mir_surface_
> with the surface. It makes more sense (to me at least) to query the surface,
> where MirSurfaceSpec "lives", for the existing specification of the surface.
I don't think the MirSurfaceSpec is associated with a surface. If I were to call mir_surface_
> This also leads to the topic of guaranteeing that the surface is in a
> particular state while the client decides what to do with the surface next.
> Like, it seems sensible that we have to lock the surface state, and then apply
> all the changes at once, and then 'unlock' the surface for further server-
> started changes.
Clients cannot reasonably "lock" the state of the surface - the window manager needs to respond to user input, display changes etc.
> It also seems that just rejecting change-specs the server doesn't like will
> lead to a somewhat frustrating back-and-forth for the clients trying to apply
> the change they want and then being told for non-obvious reasons that the
> change that was requested was rejected.
There is no way for a client to get a meaningful response to a change spec request. It is "fire and forget". There will likely be corresponding events from the server - but even if the request is honored in full the surface may never be in the requested state because of concurrent changes by (e.g.) the user.
| Alan Griffiths (alan-griffiths) wrote : | # |
> There is no way for a client to get a meaningful response to a change spec
> request. It is "fire and forget". There will likely be corresponding events
> from the server - but even if the request is honored in full the surface may
> never be in the requested state because of concurrent changes by (e.g.) the
> user.
This was discussed to death in lp:~vanvugt/mir/wait-result/+merge/252403
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:2482
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| Alan Griffiths (alan-griffiths) wrote : | # |
Another thought is that we don't necessarily need mir_surface_
We could, for example, do this:
void morph_to_
{
auto const spec = mir_connection_
mir_
mir_
}
This way we avoid the complexity of managing the required parameters for the new type.
The "con" is that it is then difficult to "inherit" parameters from the existing surface.
But this is not a problem with the current MP - we can still chose several options building upon it.
| Alberto Aguirre (albaguirre) wrote : | # |
I think this MP is reasonable.
I don't think a mir_surface_
I know that would require passing width/height/
In any case this MP looks ok to me.
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:2484
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| Kevin DuBois (kdub) wrote : | # |
nits fixed, unblocking while I think more about the observations in my above comment.
| Chris Halse Rogers (raof) wrote : | # |
I'm conceptually happy with this.
I was thinking that we needed a surface-
For the specific case of Kevin's MirBufferStream bypass work, the introspection API is only necessary to ease testing - clients are perfectly capable of maintaining their own stacking and positioning state.
I'm in favour of doing the mir_connection_
With that, I don't mind the useless MirConnection parameter to spec_for_changes :).
Why does mir_surface_
| Alan Griffiths (alan-griffiths) wrote : | # |
*Needs Discussion*
> Why does mir_surface_
> mind it doing so, but as (extensively!) discussed, there's nothing useful a
> client can do with it.
I agree it is useless. But it is consistent with the other APIs we discussed. Is it better to be inconsistent and return void now? Or to plan on removing the wait handle in all similar APIs when we next break ABI compatibility?
| Alberto Aguirre (albaguirre) wrote : | # |
I would vote for just returning void, but it's not a blocking issue.
- 2485. By Alan Griffiths on 2015-04-13
-
Don't return a useless wait handle from surface modification requests
- 2486. By Alan Griffiths on 2015-04-13
-
merge lp:mir
| Alan Griffiths (alan-griffiths) wrote : | # |
> I would vote for just returning void, but it's not a blocking issue.
Let's do it then
| Robert Carr (robertcarr) wrote : | # |
146 and 153
+void mir_surface_
+...set_name...
Should catch exceptions right?
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:2486
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| Kevin DuBois (kdub) wrote : | # |
So, I'm okay with this approach, as opposed to some sort of "lock" guarantee, as that seems to raise all sorts of questions about what a 'locked' surface might mean.
The wait handle seemed useless too, so also okay with its removal.
Chris's point that the nested stuff (or other clients) can maintain some of their own info is a good one. I'm not sure though that we explain well what changing a surface spec means... It makes sense to me to say that "when the title name is set to "X" on the MirSurfaceSpec, it will be presented as "X" when the server chooses to show a title", as opposed to saying "when the title name is set to "X" on the MirSurfaceSpec, it can be silently rejected"
needs-info:
1) Shouldn't this take a MirSurfaceSpec* instead of of a MirSurface*?
31 +void mir_surface_
2) Is it (or will it be) possible to construct a MirSurfaceSpec that's invalid? For instance, if we have a mir_surface_
- 2487. By Alan Griffiths on 2015-04-14
-
Better error handling
- 2488. By Alan Griffiths on 2015-04-14
-
merge lp:mir
| Alan Griffiths (alan-griffiths) wrote : | # |
> needs-info:
> 1) Shouldn't this take a MirSurfaceSpec* instead of of a MirSurface*?
> 31 +void mir_surface_
No, this is a signature change (dropping the wait handle) to an existing method that's a "convenience wrapper" around the MirSurfaceSpec calls needed to change a surface title. (C.f. lp:~vanvugt/mir/rename-api/+merge/252864/comments/628924.)
> 2) Is it (or will it be) possible to construct a MirSurfaceSpec that's
> invalid? For instance, if we have a mir_surface_
> y), and someone tries to morph a tooltip to a tooltip that spans multiple
> monitors that seems to violate the meaning of the types in the spec document.
> It might make sense to indicate to the client that its request was "flat-out
> rejected forever", instead of "accepted as something that the server will try
> to apply when appropriate".
That's a poor example of a MirSurfaceSpec that's invalid: How is that any different from the existing scenario of a "someone" requesting a tooltip that spans multiple monitors without a modification? The server knows what monitors are attached at the time it processes the request (and what "shell space" exists on the monitors) and sizes the surface accordingly.
A better example would be creating a MirSurfaceSpec for changes and then calling mir_surface_
| Alan Griffiths (alan-griffiths) wrote : | # |
> 146 and 153
> +void mir_surface_
> +...set_name...
>
> Should catch exceptions right?
Fixed
| Alexandros Frantzis (afrantzis) wrote : | # |
Looks sensible.
31 +void mir_surface_
Now that we have a way to perform the same task with a more general mechanism, I am not convinced that we should keep mir_surface_
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:2488
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| Kevin DuBois (kdub) wrote : | # |
@Alan, I see now that its just a convenience wrapper, so okay with the signature.
resolved the second point on IRC, my assumption that there were invalid change MirSurfaceSpecs isn't part of the intended model.
okay by me, and can port base the rfc branch I have up on this one

PASSED: Continuous integration, rev:2478 jenkins. qa.ubuntu. com/job/ mir-ci/ 3488/ jenkins. qa.ubuntu. com/job/ mir-android- vivid-i386- build/2008 jenkins. qa.ubuntu. com/job/ mir-clang- vivid-amd64- build/2007 jenkins. qa.ubuntu. com/job/ mir-mediumtests -vivid- touch/1958 jenkins. qa.ubuntu. com/job/ mir-vivid- amd64-ci/ 1485 jenkins. qa.ubuntu. com/job/ mir-vivid- amd64-ci/ 1485/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- vivid-armhf/ 1958 jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- vivid-armhf/ 1958/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -runner- mako/4894 s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 19520
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/mir- ci/3488/ rebuild
http://