mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-08-17 08:53:06 +08:00
Restrict the new size after DPI change to the display size
wxSizer::GetMinSize() can return a size bigger than the display size, but we never want to use such size for the window, so ensure that it fits the display client area. This also ensures that the window doesn't become bigger than its max size.
This commit is contained in:
@@ -318,7 +318,7 @@ bool wxNonOwnedWindow::HandleDPIChange(const wxSize& newDPI, const wxRect& newRe
|
||||
wxRect actualNewRect = newRect;
|
||||
if ( wxSizer* sizer = GetSizer() )
|
||||
{
|
||||
const wxSize minSize = ClientToWindowSize(sizer->GetMinSize());
|
||||
const wxSize minSize = sizer->ComputeFittingClientSize(this);
|
||||
wxSize diff = minSize - newRect.GetSize();
|
||||
|
||||
// We don't want to shrink the window as if the user had increased
|
||||
|
||||
Reference in New Issue
Block a user