Fix three small focus issues

Fix #8419, close #8420
pull/8437/head
Udo Hoffmann 5 years ago committed by Don HO
parent 95c6d1ea1e
commit 6f09695c2d
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E

@ -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;

@ -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!!!

@ -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:

Loading…
Cancel
Save