# Forcing a Minimum Size

**URL:** <https://discourse.glfw.org/t/forcing-a-minimum-size/93>\
**Category:** support\
**Created:** [September 21, 2014, 12:29pm UTC](https://discourse.glfw.org/t/forcing-a-minimum-size/93 "2014-09-21T12:29:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [September 21, 2014, 12:29pm UTC](https://discourse.glfw.org/t/forcing-a-minimum-size/93/1 "2014-09-21T12:29:35Z")

</div>

**[mast4as](https://sourceforge.net/u/mast4as/)** wrote on [Sunday, September 21, 2014](https://sourceforge.net/p/glfw/discussion/247562/thread/1d42fdaf/#9ec1):

Hello,

1. FLGW is very useful. Thx for developing it.

2. I am trying to have an app in which the window can’t be resized below a minimum size.

I can’t seem able to do this at all. I tried to play with:

glfwSetWindowSizeCallback(window, windowSizeCallback);

void windowSizeCallback(GLFWwindow\* window, int width, int height)  
{  
printf(“new size %d %d\n”, width, height);  
glfwSetWindowSize(window, 640, 480);  
}

but first, you can still resize the window below it’s minimum size and two, while the call back always seems to be called, the windows is not always resized to 640,480. In ohter words, they are times where this doesn’t seem to work…?

Is there a good solution to this. What I want is:

- window size can’t be lower than 400,400 say
- user can resize it and make it bigger than that.
- if the user resized the window, if the size is greater than 400,400 he/she can see the window changing size. But if he/she tries to make it smaller than 400,400 the window keeps a fixed size.

Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [September 21, 2014, 12:34pm UTC](https://discourse.glfw.org/t/forcing-a-minimum-size/93/2 "2014-09-21T12:34:59Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Sunday, September 21, 2014](https://sourceforge.net/p/glfw/discussion/247562/thread/1d42fdaf/#3719):

This is planned for 3.2 with the `glfwSetWindowSizeLimits` function, which will support minimum size, maximum size and enforced aspect ratio, but currently there is no way to do it.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [September 21, 2014, 12:41pm UTC](https://discourse.glfw.org/t/forcing-a-minimum-size/93/3 "2014-09-21T12:41:38Z")

</div>

**[mast4as](https://sourceforge.net/u/mast4as/)** wrote on [Sunday, September 21, 2014](https://sourceforge.net/p/glfw/discussion/247562/thread/1d42fdaf/#bbb7):

Great – good to know. I can work around it for mow.

Please keep going with this good and very useful work.
