From b70806409d2e9c498c32f784462521649eac5e6b Mon Sep 17 00:00:00 2001 From: fourtf Date: Thu, 26 Dec 2019 23:23:59 +0100 Subject: [PATCH] workaround for white border --- src/widgets/BaseWindow.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/widgets/BaseWindow.cpp b/src/widgets/BaseWindow.cpp index d4ad58466..1bec57660 100644 --- a/src/widgets/BaseWindow.cpp +++ b/src/widgets/BaseWindow.cpp @@ -515,6 +515,25 @@ void BaseWindow::resizeEvent(QResizeEvent *) //this->moveIntoDesktopRect(this); +#ifdef USEWINSDK + if (!this->isResizeFixing_) + { + this->isResizeFixing_ = true; + QTimer::singleShot(50, this, [this] { + RECT rect; + ::GetWindowRect((HWND)this->winId(), &rect); + ::SetWindowPos((HWND)this->winId(), nullptr, 0, 0, + rect.right - rect.left + 1, rect.bottom - rect.top, + SWP_NOMOVE | SWP_NOZORDER); + ::SetWindowPos((HWND)this->winId(), nullptr, 0, 0, + rect.right - rect.left, rect.bottom - rect.top, + SWP_NOMOVE | SWP_NOZORDER); + QTimer::singleShot(10, this, + [this] { this->isResizeFixing_ = false; }); + }); + } +#endif + this->calcButtonsSizes(); }