The last case is the curious one. So I'm saying if result == true then the shell has successfully set exactly what you asked for.
If result == false, then the shell hasn't done what you asked for, but it might have done something different (e.g. chosen a similar state it supports instead of what you asked for).
So maybe the attribute/state result needs a rethink. But mir_surface_set_state isn't the important case here. The important case for this proposal is multi-attribute morphing in future:
mir_surface_morph(surface, new_spec) == result
only returns true if ALL attributes of new_spec could be applied and supported together. Else result==false and nothing is changed. Totally clear and unambiguous in that case. And the behaviour of such functions should be documented clearly in the client headers.
Oh good point. You can find the answer buried deep in the diff but I will explain:
mir_ surface_ set_state( surface, valid_supported _state) == true surface_ set_state( surface, invalid_state) == false surface_ set_state( surface, valid_unsupport ed_state) == false
mir_
mir_
The last case is the curious one. So I'm saying if result == true then the shell has successfully set exactly what you asked for.
If result == false, then the shell hasn't done what you asked for, but it might have done something different (e.g. chosen a similar state it supports instead of what you asked for).
So maybe the attribute/state result needs a rethink. But mir_surface_ set_state isn't the important case here. The important case for this proposal is multi-attribute morphing in future:
mir_ surface_ morph(surface, new_spec) == result
only returns true if ALL attributes of new_spec could be applied and supported together. Else result==false and nothing is changed. Totally clear and unambiguous in that case. And the behaviour of such functions should be documented clearly in the client headers.