From b83d8f7339336ced73b6659104686f84a4806d0a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 21 Sep 2011 15:07:37 +0000 Subject: [PATCH] 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 --- src/common/sizer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index 9bc6fcc416..f964661d2e 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -909,6 +909,11 @@ wxSize wxSizer::ComputeFittingClientSize(wxWindow *window) 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. sizeMax = tlw->WindowToClientSize(sizeMax); } -- 2.45.2