Personally I'm happy with the existing approach: it's a precondition & we don't need to check.
Agreed, the server should withstand such values if they are ever sent (in a way that applies to all surfaces). I *think* I've seen code that handles this for all surface types, but am not sure where it is.
Maybe a test is in order that goes through all the surface create functions with bad sizes?
If, hypothetically, we adopt your suggestion and client updates a valid spec with mir_surface_spec_set_width()/mir_surface_spec_set_height() - how would you handle bad values here? Turning the existing spec into an error object?
Personally I'm happy with the existing approach: it's a precondition & we don't need to check.
Agreed, the server should withstand such values if they are ever sent (in a way that applies to all surfaces). I *think* I've seen code that handles this for all surface types, but am not sure where it is.
Maybe a test is in order that goes through all the surface create functions with bad sizes?
If, hypothetically, we adopt your suggestion and client updates a valid spec with mir_surface_ spec_set_ width() /mir_surface_ spec_set_ height( ) - how would you handle bad values here? Turning the existing spec into an error object?