Where do we validate surface attributes?

Christopher James Halse Rogers chris at cooperteam.net
Wed Jul 1 04:35:05 UTC 2015

On Wed, Jul 1, 2015 at 3:36 AM, Alberto Aguirre 
<alberto.aguirre at canonical.com> wrote:
> I think we should avoid replicating validation rules when possible, 
> because in the end, validation is really up to the window manager 
> policy - its the one entity which knows the valid combination of 
> parameters.

I don't think this should be true, and it certainly *wasn't* true when 
we had a constrained client API.

There are certainly *some* attributes that are going to be 
shell-specific - window sizes, fullscreen placement, and so on - but I 
think there's a core that aren't. It doesn't make sense to make a menu 
surface without a parent, and so on.

Our client API isn't usable if we don't have defined semantics for 
various things - how does input interact with having a menu open? What 
happens if you make a menu with a menu as a parent? What happens if you 
close a menu?

For the benefit of both clients and shells it would be good if we 
implemented at least some of this in Mir. A correct shell will need to 
have this behaviour, and clients will need to be able to depend on this 

The semantic content of our API is not just there so that shells can do 
the right thing when a client creates a parented-dialog; it's also 
there so that clients can know what the right thing is.

More information about the Mir-devel mailing list