aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/pugl_embed_demo.c1
-rw-r--r--pugl/detail/win.c6
2 files changed, 5 insertions, 2 deletions
diff --git a/examples/pugl_embed_demo.c b/examples/pugl_embed_demo.c
index bf7f19c..e21dd55 100644
--- a/examples/pugl_embed_demo.c
+++ b/examples/pugl_embed_demo.c
@@ -295,6 +295,7 @@ main(int argc, char** argv)
const PuglRect parentFrame = { 0, 0, 512, 512 };
puglSetDefaultSize(app.parent, 512, 512);
puglSetMinSize(app.parent, borderWidth * 3, borderWidth * 3);
+ puglSetMaxSize(app.parent, 1024, 1024);
puglSetAspectRatio(app.parent, 1, 1, 16, 9);
puglSetBackend(app.parent, puglGlBackend());
diff --git a/pugl/detail/win.c b/pugl/detail/win.c
index 22bcfbf..bacc72f 100644
--- a/pugl/detail/win.c
+++ b/pugl/detail/win.c
@@ -592,8 +592,10 @@ handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam)
mmi = (MINMAXINFO*)lParam;
mmi->ptMinTrackSize.x = view->minWidth;
mmi->ptMinTrackSize.y = view->minHeight;
- mmi->ptMaxTrackSize.x = view->maxWidth;
- mmi->ptMaxTrackSize.y = view->maxHeight;
+ if (view->maxWidth > 0 && view->maxHeight > 0) {
+ mmi->ptMaxTrackSize.x = view->maxWidth;
+ mmi->ptMaxTrackSize.y = view->maxHeight;
+ }
break;
case WM_PAINT:
GetUpdateRect(view->impl->hwnd, &rect, false);