Fix no focus on edit zone regression

Fix no focus on edit zone after switching back to Notepad++.
This regression is introduced by ee884f87bb (#10910)

ref:
ee884f87bb (commitcomment-62032223)
This commit is contained in:
Don Ho 2021-12-16 17:37:11 +01:00
parent 1c81788881
commit ac52f406f3
1 changed files with 14 additions and 0 deletions

View File

@ -1759,6 +1759,20 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
return TRUE;
}
case WM_ACTIVATE:
{
if (wParam != WA_INACTIVE && _pEditView && _pNonEditView)
{
_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;
}
case WM_SYNCPAINT:
{
RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_ALLCHILDREN);