Fix Floating dockable panels don't minimize to system tray issue

Fixes #8928, close #8953
This commit is contained in:
Udo Hoffmann 2020-10-05 16:40:10 +02:00 committed by Don HO
parent 4830b770d5
commit 41d619d9b7
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E
4 changed files with 18 additions and 0 deletions

View File

@ -1912,6 +1912,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
_pTrayIco = new trayIconControler(hwnd, IDI_M30ICON, NPPM_INTERNAL_MINIMIZED_TRAY, ::LoadIcon(_pPublicInterface->getHinst(), MAKEINTRESOURCE(IDI_M30ICON)), TEXT("")); _pTrayIco = new trayIconControler(hwnd, IDI_M30ICON, NPPM_INTERNAL_MINIMIZED_TRAY, ::LoadIcon(_pPublicInterface->getHinst(), MAKEINTRESOURCE(IDI_M30ICON)), TEXT(""));
_pTrayIco->doTrayIcon(ADD); _pTrayIco->doTrayIcon(ADD);
_dockingManager.showFloatingContainers(false);
::ShowWindow(hwnd, SW_HIDE); ::ShowWindow(hwnd, SW_HIDE);
return TRUE; return TRUE;
} }
@ -1943,6 +1944,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
{ {
_pEditView->getFocus(); _pEditView->getFocus();
::ShowWindow(hwnd, SW_SHOW); ::ShowWindow(hwnd, SW_SHOW);
_dockingManager.showFloatingContainers(true);
if (!_pPublicInterface->isPrelaunch()) if (!_pPublicInterface->isPrelaunch())
_pTrayIco->doTrayIcon(REMOVE); _pTrayIco->doTrayIcon(REMOVE);
::SendMessage(hwnd, WM_SIZE, 0, 0); ::SendMessage(hwnd, WM_SIZE, 0, 0);

View File

@ -3298,6 +3298,7 @@ void Notepad_plus::command(int id)
{ {
NppGUI & nppGUI = const_cast<NppGUI &>((NppParameters::getInstance()).getNppGUI()); NppGUI & nppGUI = const_cast<NppGUI &>((NppParameters::getInstance()).getNppGUI());
::ShowWindow(_pPublicInterface->getHSelf(), nppGUI._isMaximized?SW_MAXIMIZE:SW_SHOW); ::ShowWindow(_pPublicInterface->getHSelf(), nppGUI._isMaximized?SW_MAXIMIZE:SW_SHOW);
_dockingManager.showFloatingContainers(true);
fileNew(); fileNew();
} }
break; break;
@ -3306,6 +3307,7 @@ void Notepad_plus::command(int id)
{ {
NppGUI & nppGUI = const_cast<NppGUI &>((NppParameters::getInstance()).getNppGUI()); NppGUI & nppGUI = const_cast<NppGUI &>((NppParameters::getInstance()).getNppGUI());
::ShowWindow(_pPublicInterface->getHSelf(), nppGUI._isMaximized?SW_MAXIMIZE:SW_SHOW); ::ShowWindow(_pPublicInterface->getHSelf(), nppGUI._isMaximized?SW_MAXIMIZE:SW_SHOW);
_dockingManager.showFloatingContainers(true);
// Send sizing info to make window fit (specially to show tool bar. Fixed issue #2600) // Send sizing info to make window fit (specially to show tool bar. Fixed issue #2600)
::SendMessage(_pPublicInterface->getHSelf(), WM_SIZE, 0, 0); ::SendMessage(_pPublicInterface->getHSelf(), WM_SIZE, 0, 0);
@ -3316,6 +3318,7 @@ void Notepad_plus::command(int id)
{ {
NppGUI & nppGUI = const_cast<NppGUI &>((NppParameters::getInstance()).getNppGUI()); NppGUI & nppGUI = const_cast<NppGUI &>((NppParameters::getInstance()).getNppGUI());
::ShowWindow(_pPublicInterface->getHSelf(), nppGUI._isMaximized?SW_MAXIMIZE:SW_SHOW); ::ShowWindow(_pPublicInterface->getHSelf(), nppGUI._isMaximized?SW_MAXIMIZE:SW_SHOW);
_dockingManager.showFloatingContainers(true);
BufferID bufferID = _pEditView->getCurrentBufferID(); BufferID bufferID = _pEditView->getCurrentBufferID();
Buffer * buf = MainFileManager.getBufferByID(bufferID); Buffer * buf = MainFileManager.getBufferByID(bufferID);
if (!buf->isUntitled() || buf->docLength() != 0) if (!buf->isUntitled() || buf->docLength() != 0)
@ -3330,6 +3333,7 @@ void Notepad_plus::command(int id)
{ {
NppGUI & nppGUI = const_cast<NppGUI &>((NppParameters::getInstance()).getNppGUI()); NppGUI & nppGUI = const_cast<NppGUI &>((NppParameters::getInstance()).getNppGUI());
::ShowWindow(_pPublicInterface->getHSelf(), nppGUI._isMaximized?SW_MAXIMIZE:SW_SHOW); ::ShowWindow(_pPublicInterface->getHSelf(), nppGUI._isMaximized?SW_MAXIMIZE:SW_SHOW);
_dockingManager.showFloatingContainers(true);
// Send sizing info to make window fit (specially to show tool bar. Fixed issue #2600) // Send sizing info to make window fit (specially to show tool bar. Fixed issue #2600)
::SendMessage(_pPublicInterface->getHSelf(), WM_SIZE, 0, 0); ::SendMessage(_pPublicInterface->getHSelf(), WM_SIZE, 0, 0);

View File

@ -220,6 +220,16 @@ void DockingManager::showContainer(HWND hCont, bool display)
} }
} }
void DockingManager::showFloatingContainers(bool show)
{
for (size_t i=0; i < _vContainer.size(); i++)
{
size_t iElementCnt = _vContainer[i]->getElementCnt();
if (iElementCnt > 0)
_vContainer[i]->display(show);
}
}
LRESULT DockingManager::runProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) LRESULT DockingManager::runProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
switch (message) switch (message)

View File

@ -60,6 +60,8 @@ public :
onSize(); onSize();
} }
void showFloatingContainers(bool show);
void updateContainerInfo(HWND hClient); void updateContainerInfo(HWND hClient);
void createDockableDlg(tTbData data, int iCont = CONT_LEFT, bool isVisible = false); void createDockableDlg(tTbData data, int iCont = CONT_LEFT, bool isVisible = false);
void setActiveTab(int iCont, int iItem); void setActiveTab(int iCont, int iItem);