mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-22 21:34:58 +02:00
Fix dock panels visual glitch
The visual glitch is caused by 'Find in Search Results'. Fix #13402, fix #13459
This commit is contained in:
parent
e28db05754
commit
37a18bf3b8
@ -280,6 +280,20 @@ LRESULT DockingCont::runProcCaption(HWND hwnd, UINT Message, WPARAM wParam, LPAR
|
|||||||
|
|
||||||
switch (Message)
|
switch (Message)
|
||||||
{
|
{
|
||||||
|
case WM_ERASEBKGND:
|
||||||
|
{
|
||||||
|
if (!NppDarkMode::isEnabled())
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
RECT rc{};
|
||||||
|
::GetClientRect(hwnd, &rc);
|
||||||
|
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
case WM_LBUTTONDOWN:
|
case WM_LBUTTONDOWN:
|
||||||
{
|
{
|
||||||
_isMouseDown = TRUE;
|
_isMouseDown = TRUE;
|
||||||
@ -296,11 +310,11 @@ LRESULT DockingCont::runProcCaption(HWND hwnd, UINT Message, WPARAM wParam, LPAR
|
|||||||
if (!hookMouse)
|
if (!hookMouse)
|
||||||
{
|
{
|
||||||
DWORD dwError = ::GetLastError();
|
DWORD dwError = ::GetLastError();
|
||||||
TCHAR str[128];
|
TCHAR str[128]{};
|
||||||
::wsprintf(str, TEXT("GetLastError() returned %lu"), dwError);
|
::wsprintf(str, TEXT("GetLastError() returned %lu"), dwError);
|
||||||
::MessageBox(NULL, str, TEXT("SetWindowsHookEx(MOUSE) failed on runProcCaption"), MB_OK | MB_ICONERROR);
|
::MessageBox(NULL, str, TEXT("SetWindowsHookEx(MOUSE) failed on runProcCaption"), MB_OK | MB_ICONERROR);
|
||||||
}
|
}
|
||||||
::RedrawWindow(hwnd, NULL, NULL, TRUE);
|
::RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
focusClient();
|
focusClient();
|
||||||
@ -366,7 +380,7 @@ LRESULT DockingCont::runProcCaption(HWND hwnd, UINT Message, WPARAM wParam, LPAR
|
|||||||
if (_isMouseOver != isMouseOver)
|
if (_isMouseOver != isMouseOver)
|
||||||
{
|
{
|
||||||
::SetFocus(NULL);
|
::SetFocus(NULL);
|
||||||
::RedrawWindow(hwnd, NULL, NULL, TRUE);
|
::RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -428,7 +442,7 @@ LRESULT DockingCont::runProcCaption(HWND hwnd, UINT Message, WPARAM wParam, LPAR
|
|||||||
}
|
}
|
||||||
case WM_SETTEXT:
|
case WM_SETTEXT:
|
||||||
{
|
{
|
||||||
::RedrawWindow(hwnd, NULL, NULL, TRUE);
|
::RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@ -681,6 +695,10 @@ LRESULT DockingCont::runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RECT rc{};
|
||||||
|
::GetClientRect(hwnd, &rc);
|
||||||
|
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -697,7 +715,7 @@ LRESULT DockingCont::runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
PAINTSTRUCT ps;
|
PAINTSTRUCT ps{};
|
||||||
HDC hdc = ::BeginPaint(hwnd, &ps);
|
HDC hdc = ::BeginPaint(hwnd, &ps);
|
||||||
::FillRect(hdc, &ps.rcPaint, NppDarkMode::getDarkerBackgroundBrush());
|
::FillRect(hdc, &ps.rcPaint, NppDarkMode::getDarkerBackgroundBrush());
|
||||||
|
|
||||||
@ -1119,7 +1137,7 @@ intptr_t CALLBACK DockingCont::run_dlgProc(UINT Message, WPARAM wParam, LPARAM l
|
|||||||
int tabDpiDynamicalMinWidth = NppParameters::getInstance()._dpiManager.scaleX(24);
|
int tabDpiDynamicalMinWidth = NppParameters::getInstance()._dpiManager.scaleX(24);
|
||||||
::SendMessage(_hContTab, TCM_SETMINTABWIDTH, 0, tabDpiDynamicalMinWidth);
|
::SendMessage(_hContTab, TCM_SETMINTABWIDTH, 0, tabDpiDynamicalMinWidth);
|
||||||
|
|
||||||
break;
|
return TRUE;
|
||||||
}
|
}
|
||||||
case WM_NCCALCSIZE:
|
case WM_NCCALCSIZE:
|
||||||
case WM_SIZE:
|
case WM_SIZE:
|
||||||
@ -1133,12 +1151,18 @@ intptr_t CALLBACK DockingCont::run_dlgProc(UINT Message, WPARAM wParam, LPARAM l
|
|||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
RECT rc = {};
|
RECT rc{};
|
||||||
getClientRect(rc);
|
getClientRect(rc);
|
||||||
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case WM_CTLCOLORDLG:
|
||||||
|
case WM_CTLCOLORSTATIC:
|
||||||
|
{
|
||||||
|
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
|
||||||
|
}
|
||||||
|
|
||||||
case WM_DRAWITEM :
|
case WM_DRAWITEM :
|
||||||
{
|
{
|
||||||
// draw tab or caption
|
// draw tab or caption
|
||||||
|
@ -119,10 +119,10 @@ public:
|
|||||||
|
|
||||||
void setTabStyle(const BOOL & bDrawOgLine) {
|
void setTabStyle(const BOOL & bDrawOgLine) {
|
||||||
_bDrawOgLine = bDrawOgLine;
|
_bDrawOgLine = bDrawOgLine;
|
||||||
RedrawWindow(_hContTab, NULL, NULL, 0);
|
::RedrawWindow(_hContTab, nullptr, nullptr, RDW_INVALIDATE);
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual void destroy() {
|
void destroy() override{
|
||||||
for (int iTb = static_cast<int>(_vTbData.size()); iTb > 0; iTb--)
|
for (int iTb = static_cast<int>(_vTbData.size()); iTb > 0; iTb--)
|
||||||
{
|
{
|
||||||
delete _vTbData[iTb-1];
|
delete _vTbData[iTb-1];
|
||||||
@ -144,7 +144,7 @@ protected :
|
|||||||
return (((DockingCont *)(::GetWindowLongPtr(hwnd, GWLP_USERDATA)))->runProcTab(hwnd, Message, wParam, lParam));
|
return (((DockingCont *)(::GetWindowLongPtr(hwnd, GWLP_USERDATA)))->runProcTab(hwnd, Message, wParam, lParam));
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) override;
|
||||||
|
|
||||||
// drawing functions
|
// drawing functions
|
||||||
void drawCaptionItem(DRAWITEMSTRUCT *pDrawItemStruct);
|
void drawCaptionItem(DRAWITEMSTRUCT *pDrawItemStruct);
|
||||||
|
@ -96,7 +96,7 @@ void DockingManager::init(HINSTANCE hInst, HWND hWnd, Window ** ppWin)
|
|||||||
|
|
||||||
if (!_isRegistered)
|
if (!_isRegistered)
|
||||||
{
|
{
|
||||||
WNDCLASS clz;
|
WNDCLASS clz{};
|
||||||
|
|
||||||
clz.style = 0;
|
clz.style = 0;
|
||||||
clz.lpfnWndProc = staticWinProc;
|
clz.lpfnWndProc = staticWinProc;
|
||||||
@ -216,6 +216,20 @@ LRESULT DockingManager::runProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM l
|
|||||||
{
|
{
|
||||||
switch (message)
|
switch (message)
|
||||||
{
|
{
|
||||||
|
case WM_ERASEBKGND:
|
||||||
|
{
|
||||||
|
if (!NppDarkMode::isEnabled())
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
RECT rc{};
|
||||||
|
::GetClientRect(hwnd, &rc);
|
||||||
|
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
case WM_NCACTIVATE:
|
case WM_NCACTIVATE:
|
||||||
{
|
{
|
||||||
// activate/deactivate titlebar of toolbars
|
// activate/deactivate titlebar of toolbars
|
||||||
@ -660,8 +674,17 @@ void DockingManager::createDockableDlg(tTbData data, int iCont, bool isVisible)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// attach toolbar
|
// attach toolbar
|
||||||
if (_vContainer.size() > (size_t)iCont && _vContainer[iCont] != NULL)
|
if (_vContainer.size() > static_cast<size_t>(iCont) && _vContainer[iCont] != nullptr)
|
||||||
|
{
|
||||||
_vContainer[iCont]->createToolbar(data);
|
_vContainer[iCont]->createToolbar(data);
|
||||||
|
for (const auto& cont : _vContainer)
|
||||||
|
{
|
||||||
|
if (cont->isVisible() && cont != _vContainer[iCont])
|
||||||
|
{
|
||||||
|
::RedrawWindow(cont->getHSelf(), nullptr, nullptr, RDW_INVALIDATE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// notify client app
|
// notify client app
|
||||||
if (iCont < DOCKCONT_MAX)
|
if (iCont < DOCKCONT_MAX)
|
||||||
@ -706,7 +729,7 @@ void DockingManager::showDockableDlg(TCHAR* pszName, BOOL view)
|
|||||||
|
|
||||||
LRESULT DockingManager::SendNotify(HWND hWnd, UINT message)
|
LRESULT DockingManager::SendNotify(HWND hWnd, UINT message)
|
||||||
{
|
{
|
||||||
NMHDR nmhdr;
|
NMHDR nmhdr{};
|
||||||
nmhdr.code = message;
|
nmhdr.code = message;
|
||||||
nmhdr.hwndFrom = _hParent;
|
nmhdr.hwndFrom = _hParent;
|
||||||
nmhdr.idFrom = ::GetDlgCtrlID(_hParent);
|
nmhdr.idFrom = ::GetDlgCtrlID(_hParent);
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
#include "DockingSplitter.h"
|
#include "DockingSplitter.h"
|
||||||
#include "Notepad_plus_msgs.h"
|
#include "Notepad_plus_msgs.h"
|
||||||
#include "Parameters.h"
|
#include "Parameters.h"
|
||||||
#include "NppDarkMode.h"
|
|
||||||
|
|
||||||
BOOL DockingSplitter::_isVertReg = FALSE;
|
BOOL DockingSplitter::_isVertReg = FALSE;
|
||||||
BOOL DockingSplitter::_isHoriReg = FALSE;
|
BOOL DockingSplitter::_isHoriReg = FALSE;
|
||||||
@ -30,7 +29,7 @@ void DockingSplitter::init(HINSTANCE hInst, HWND hWnd, HWND hMessage, UINT flags
|
|||||||
_hMessage = hMessage;
|
_hMessage = hMessage;
|
||||||
_flags = flags;
|
_flags = flags;
|
||||||
|
|
||||||
WNDCLASS wc;
|
WNDCLASS wc{};
|
||||||
DWORD hwndExStyle = (DWORD)GetWindowLongPtr(hWnd, GWL_EXSTYLE);
|
DWORD hwndExStyle = (DWORD)GetWindowLongPtr(hWnd, GWL_EXSTYLE);
|
||||||
_isRTL = hwndExStyle & WS_EX_LAYOUTRTL;
|
_isRTL = hwndExStyle & WS_EX_LAYOUTRTL;
|
||||||
|
|
||||||
@ -56,7 +55,7 @@ void DockingSplitter::init(HINSTANCE hInst, HWND hWnd, HWND hMessage, UINT flags
|
|||||||
wc.cbWndExtra = 0;
|
wc.cbWndExtra = 0;
|
||||||
wc.hInstance = _hInst;
|
wc.hInstance = _hInst;
|
||||||
wc.hIcon = NULL;
|
wc.hIcon = NULL;
|
||||||
wc.hbrBackground = (HBRUSH)(COLOR_3DFACE+1);
|
wc.hbrBackground = ::GetSysColorBrush(COLOR_3DFACE);
|
||||||
wc.lpszMenuName = NULL;
|
wc.lpszMenuName = NULL;
|
||||||
|
|
||||||
if (!::RegisterClass(&wc))
|
if (!::RegisterClass(&wc))
|
||||||
@ -129,7 +128,7 @@ LRESULT DockingSplitter::runProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
|||||||
{
|
{
|
||||||
if (_isLeftButtonDown == TRUE)
|
if (_isLeftButtonDown == TRUE)
|
||||||
{
|
{
|
||||||
POINT pt;
|
POINT pt{};
|
||||||
|
|
||||||
::GetCursorPos(&pt);
|
::GetCursorPos(&pt);
|
||||||
|
|
||||||
@ -152,9 +151,10 @@ LRESULT DockingSplitter::runProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
RECT rc = {};
|
RECT rc{};
|
||||||
getClientRect(rc);
|
::GetClientRect(hwnd, &rc);
|
||||||
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getBackgroundBrush());
|
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
default :
|
default :
|
||||||
|
Loading…
x
Reference in New Issue
Block a user