Don't limit window size to (0, 0) in wxSizer if getting display size failed.
It's possible that wxDisplay::GetClientArea() returns (0, 0) size indicating that it failed. Don't set the maximal window size to (0, 0) in this case as this prevents the user from seeing the window at all and just don't do anything instead. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69172 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -909,6 +909,11 @@ wxSize wxSizer::ComputeFittingClientSize(wxWindow *window)
|
|||||||
|
|
||||||
sizeMax = wxDisplay(disp).GetClientArea().GetSize();
|
sizeMax = wxDisplay(disp).GetClientArea().GetSize();
|
||||||
|
|
||||||
|
// If determining the display size failed, skip the max size checks as
|
||||||
|
// we really don't want to create windows of (0, 0) size.
|
||||||
|
if ( !sizeMax.x || !sizeMax.y )
|
||||||
|
return size;
|
||||||
|
|
||||||
// space for decorations and toolbars etc.
|
// space for decorations and toolbars etc.
|
||||||
sizeMax = tlw->WindowToClientSize(sizeMax);
|
sizeMax = tlw->WindowToClientSize(sizeMax);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user