Fix three small focus issues

Fix #8419, close #8420
This commit is contained in:
Udo Hoffmann 2020-06-16 15:51:50 +02:00 committed by Don HO
parent 95c6d1ea1e
commit 6f09695c2d
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E
3 changed files with 5 additions and 2 deletions

View File

@ -253,6 +253,7 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
// of the last session from config.xml.
::SendMessage(_hSelf, WM_COMMAND, IDM_VIEW_PROJECT_PANEL_1, 0);
}
::SendMessage(_hSelf, WM_ACTIVATE, WA_ACTIVE, 0);
// Notify plugins that Notepad++ is ready
SCNotification scnN;

View File

@ -1185,6 +1185,7 @@ void DockingCont::showToolbar(tTbData* pTbData, BOOL state)
int DockingCont::hideToolbar(tTbData *pTbData, BOOL hideClient)
{
int iItem = searchPosInTab(pTbData);
BOOL hadFocus = ::IsChild (pTbData->hClient, ::GetFocus());
// delete item
if (TRUE == ::SendMessage(_hContTab, TCM_DELETEITEM, iItem, 0))
@ -1218,6 +1219,9 @@ int DockingCont::hideToolbar(tTbData *pTbData, BOOL hideClient)
{
::SendMessage(_hParent, WM_SIZE, 0, 0);
}
// set focus to current edit window if the docking window had focus
if (hadFocus)
::PostMessage(::GetParent(_hParent), WM_ACTIVATE, WA_ACTIVE, 0);
}
// keep sure, that client is hide!!!

View File

@ -361,8 +361,6 @@ LRESULT DockingManager::runProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM l
{
tTbData TbData = *(reinterpret_cast<DockingCont*>(lParam))->getDataOfActiveTb();
LRESULT res = SendNotify(TbData.hClient, DMN_CLOSE); // Be sure the active item is OK with closing
if (res == 0) // Item will be closing?
::PostMessage(_hParent, WM_ACTIVATE, WA_ACTIVE, 0); // Tell editor to take back focus
return res;
}
case DMM_FLOATALL: