Mir

Code review comment for lp:~vanvugt/mir/wait-result

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

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
   mir_surface_set_state(surface, invalid_state) == false
   mir_surface_set_state(surface, valid_unsupported_state) == false

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.

« Back to merge proposal