FIX: wxDisplay crash on wxNOT_FOUND

Change-Id: If7b936d361873e20fb71b7fc35c9d270cd39a763
This commit is contained in:
chunmao.guo 2022-08-12 13:11:03 +08:00 committed by Lane.Wei
parent d4ddd8f470
commit af54a34567
5 changed files with 8 additions and 8 deletions

View file

@ -342,7 +342,7 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
// BBS: fix taskbar overlay on windows
#ifdef WIN32
auto setMaxSize = [this]() {
wxDisplay display(wxDisplay::GetFromWindow(this));
wxDisplay display(this);
auto size = display.GetClientArea().GetSize();
// 8 pixels shadow
SetMaxSize(size + wxSize{16, 16});
@ -353,7 +353,7 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
});
setMaxSize();
this->Bind(wxEVT_MAXIMIZE, [this](auto &e) {
wxDisplay display(wxDisplay::GetFromWindow(this));
wxDisplay display(this);
auto pos = display.GetClientArea().GetPosition();
Move(pos - wxPoint{8, 8});
e.Skip();