Skip to content

Commit

Permalink
fix(app): handle min/max height and width on windws
Browse files Browse the repository at this point in the history
  • Loading branch information
jwerle committed Nov 4, 2024
1 parent 01d3475 commit 86ce0d1
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/app/app.cc
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,32 @@ namespace SSC {
break;
}

case WM_GETMINMAXINFO: {
const auto screen = Window::getSizeInPixels();
auto info = reinterpret_cast<LPMINMAXINFO>(lParam);

info->ptMinTrackSize.x = Window::getSizeInPixels(
app->windowManager.options.defaultMinWidth,
screen.width
);

info->ptMinTrackSize.y = Window::getSizeInPixels(
app->windowManager.options.defaultMinHeight,
screen.height
);

info->ptMaxTrackSize.x = Window::getSizeInPixels(
app->windowManager.options.defaultMaxWidth,
screen.width
);

info->ptMaxTrackSize.y = Window::getSizeInPixels(
app->windowManager.options.defaultMaxHeight,
screen.height
);
break;
}

default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
Expand Down

0 comments on commit 86ce0d1

Please sign in to comment.