Fix white border appearing around maximized window (#4190)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
fixes https://github.com/Chatterino/chatterino2/issues/2205
This commit is contained in:
kornes 2022-11-25 20:32:45 +00:00 committed by GitHub
parent fe2a9ccbff
commit f2b35fb7dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 11 deletions

View file

@ -8,6 +8,7 @@
- Bugfix: Fixed messages where Right-to-Left order is mixed in multiple lines. (#4173)
- Bugfix: Fixed the wrong right-click menu showing in the chat input box. (#4177)
- Bugfix: Fixed popup windows not appearing/minimizing correctly on the Windows taskbar. (#4181)
- Bugfix: Fixed white border appearing around maximized window on Windows. (#4190)
## 2.4.0-beta

View file

@ -793,8 +793,9 @@ bool BaseWindow::handleSHOWWINDOW(MSG *msg)
{
this->shown_ = true;
const MARGINS shadow = {8, 8, 8, 8};
DwmExtendFrameIntoClientArea(HWND(this->winId()), &shadow);
// disable OS window border
const MARGINS margins = {-1};
DwmExtendFrameIntoClientArea(HWND(this->winId()), &margins);
}
if (!this->initalBounds_.isNull())
{
@ -819,17 +820,15 @@ bool BaseWindow::handleNCCALCSIZE(MSG *msg, long *result)
#ifdef USEWINSDK
if (this->hasCustomWindowFrame())
{
// int cx = GetSystemMetrics(SM_CXSIZEFRAME);
// int cy = GetSystemMetrics(SM_CYSIZEFRAME);
if (msg->wParam == TRUE)
{
NCCALCSIZE_PARAMS *ncp =
(reinterpret_cast<NCCALCSIZE_PARAMS *>(msg->lParam));
ncp->lppos->flags |= SWP_NOREDRAW;
RECT *clientRect = &ncp->rgrc[0];
clientRect->top -= 1;
// remove 1 extra pixel on top of custom frame
auto *ncp = reinterpret_cast<NCCALCSIZE_PARAMS *>(msg->lParam);
if (ncp)
{
ncp->lppos->flags |= SWP_NOREDRAW;
ncp->rgrc[0].top -= 1;
}
}
*result = 0;