| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…XINFO The SetMinimumSize and SetMaximumSize methods on Windows were empty placeholder implementations that did nothing. This caused setting window size constraints to have no effect in Flutter apps and other consumers. Fix by: - Storing min/max size constraints in Window::Impl - Registering a WM_GETMINMAXINFO handler via WindowMessageDispatcher that reads the constraints from the Window object and sets ptMinTrackSize/ptMaxTrackSize on the MINMAXINFO structure - This works for both self-created windows and Flutter-hosted windows (via Window(void*) constructor) - Triggering SWP_FRAMECHANGED after setting constraints so the window immediately re-evaluates them - Properly cleaning up the handler in the destructor Closes libnativeapi/nativeapi-flutter#9
Use per-monitor DPI scaling across Windows platform code: apply GetScaleFactorForMonitor/Window to convert between physical pixels and logical coordinates for displays, cursor, and window geometry. Updated DisplayManager::GetCursorPosition, Display::GetPosition/GetSize/GetWorkArea/GetScaleFactor, and many Window methods (SetBounds/GetBounds/SetSize/GetSize/SetContentSize/GetContentSize/SetContentBounds/SetPosition/GetPosition and min/max handling) to scale values and round when setting sizes/positions. Added dpi_utils_windows.h declaration and exposed GetScaleFactorForMonitor in dpi_utils_windows.cpp, included dpi header where needed, and added <cmath> for std::lround. All DPI calls fallback to 1.0 when unavailable; added a comment noting Center uses physical pixels.
| Back | FazBrowse Home | New Git URL |
Description
Fixes nativeapi-flutter#9 — setting minimum/maximum window size on Windows had no effect because the SetMinimumSize and SetMaximumSize methods were empty placeholder implementations.
Root Cause
The Windows implementation of SetMinimumSize / SetMaximumSize in window_windows.cpp contained only placeholder comments acknowledging that the feature "would be handled in WM_GETMINMAXINFO message" but never actually implemented it.
Solution
This PR properly implements window size constraints on Windows by:
The solution works for both self-created windows and Flutter-hosted windows (via Window(void*) constructor wrapping the Flutter window handle).
Verification