Fix wrong horizontal scroll bar position after restoring Window position

Fix #8466, close #8475
pull/8506/head
Udo Hoffmann 2020-06-25 13:41:45 +02:00 committed by Don HO
parent 53b03cc5c5
commit 267da64d33
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E
2 changed files with 6 additions and 1 deletions

View File

@ -1646,6 +1646,10 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case WM_ACTIVATE:
{
_pEditView->getFocus();
auto x = _pEditView->execute(SCI_GETXOFFSET);
_pEditView->execute(SCI_SETXOFFSET, x);
x = _pNonEditView->execute(SCI_GETXOFFSET);
_pNonEditView->execute(SCI_SETXOFFSET, x);
return TRUE;
}

View File

@ -221,13 +221,14 @@ public:
{
::DestroyWindow(_hSelf);
_hSelf = NULL;
_pScintillaFunc = NULL;
};
virtual void init(HINSTANCE hInst, HWND hPere);
LRESULT execute(UINT Msg, WPARAM wParam=0, LPARAM lParam=0) const {
try {
return _pScintillaFunc(_pScintillaPtr, Msg, wParam, lParam);
return (_pScintillaFunc) ? _pScintillaFunc(_pScintillaPtr, Msg, wParam, lParam) : -1;
}
catch (...)
{