Unfortunately this doesn’t seem to be supported out of the box. If you’re on mac, you just need to call a method on the
NSWindow you can retrieve from
app::getWindow()->getNative(). You’ll need to compile as objective-c++ so recommend putting this in a separate file with a free function.
NSView * view = (NSView *)getWindow()->getNative();
[[view window] setMinSize:NSMakeSize(600, 300)];
On windows, it’s a little bit less straightforward, and involves hooking the window message loop in order to respond to the
This code hasn’t been tested so please take it with a grain of salt, but will hopefully give you a push in the right direction. You’ll need to call
DestroyHooking from your app’s
cleanup() methods respectively.
Turns out you’re not allowed to modify the window limits from within a hook, so you have to install a custom wndproc to catch the event. I’ve tested this on windows 10 and it works fine. Just call
InitHooking ( getWindow() ) from
setup() and you’re good to go.
static WNDPROC kPrevWndProc;
static HWND kHwnd;
LRESULT APIENTRY HandleWndProc ( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
if ( hwnd == kHwnd )
switch ( uMsg )
LPMINMAXINFO limits = (LPMINMAXINFO)lParam;
limits->ptMinTrackSize.x = 1200;
limits->ptMinTrackSize.y = 800;
return CallWindowProc ( kPrevWndProc, hwnd, uMsg, wParam, lParam );
void InitHooking ( const app::WindowRef& window )
kHwnd = static_cast<HWND> ( window->getNative() );
kPrevWndProc = (WNDPROC)( SetWindowLongPtr ( kHwnd, GWLP_WNDPROC, (LONG_PTR)(HandleWndProc) ) );