Fix white flash on Notepad++ startup in darkmode issue
Fix #3955, fix #10601, close #10639
This commit is contained in:
parent
d692b5060f
commit
35e3fb9688
|
@ -141,6 +141,16 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
|
|||
::SetWindowPlacement(_hSelf,&posInfo);
|
||||
}
|
||||
|
||||
//when npp starts up in dark mode, draw dark background to client area temporarily.
|
||||
if (NppDarkMode::isEnabled())
|
||||
{
|
||||
RECT windowClientArea;
|
||||
HDC hdc = GetDCEx(_hSelf, NULL, DCX_CACHE | DCX_LOCKWINDOWUPDATE); //lock window update flag due to line 36 and 111 in this file
|
||||
GetClientRect(_hSelf, &windowClientArea);
|
||||
FillRect(hdc, &windowClientArea, CreateSolidBrush(NppDarkMode::getBackgroundColor()));
|
||||
ReleaseDC(_hSelf, hdc);
|
||||
}
|
||||
|
||||
if ((nppGUI._tabStatus & TAB_MULTILINE) != 0)
|
||||
::SendMessage(_hSelf, WM_COMMAND, IDM_VIEW_DRAWTABBAR_MULTILINE, 0);
|
||||
|
||||
|
|
Loading…
Reference in New Issue