glfwSetWindowSize + size constraints: what is the expected behavior?

Since I am working on porting glfw to the emscripten platform I want to make sure I understand the expected behavior when using glfwSetWindowSize while having size constraints (like glfwSetWindowSizeLimits or glfwSetWindowAspectRatio).

It seems clear to me that if you set a size limit (via glfwSetWindowSizeLimits), then on the desktop platform (ex: macOS), if the user resizes the window manually by dragging the edge of the window, then the size limit will kick-in preventing the user from making the window too big/small depending on the parameters provided to glfwSetWindowSizeLimits.

But what if the code calls glfwSetWindowSize with a size that is outside the size limits? What is the expected behavior? Should it behave as if the user had tried to make the window too big/small? Or should it completely disregard the size constraints?

Thank you

It’s a bit inconsistent as the limits are for the most part only enforced by the window managers. Most of them allow the window to be programmatically resized to dimensions that break the set limits. It’s not currently consistent what happens when a size limit conflicts with an aspect ratio limit either.

All of it can currently be considered unspecified behavior. It should be harmonized if possible but there hasn’t been time. Until then I don’t even know what to recommend. You can pick a set of behaviors that seem reasonable or mimic that of an existing platform.

Thank you for your feedback!