mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-28 00:04:25 +02:00
Fixed dock-able panels not restoring for mono instances
The bug happens when Notepad++ is in the tray, and is restored via mono instance restore mechanism. Fixes #9454, close #12817
This commit is contained in:
parent
05977f6308
commit
afacc8338e
@ -2480,6 +2480,33 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case NPPM_INTERNAL_RESTOREMONOINSTANCE:
|
||||||
|
{
|
||||||
|
// When mono instance, bring this one to front
|
||||||
|
if (_pTrayIco != nullptr && _pTrayIco->isInTray())
|
||||||
|
{
|
||||||
|
// We are in tray, restore properly..
|
||||||
|
::SendMessage(hwnd, NPPM_INTERNAL_MINIMIZED_TRAY, 0, WM_LBUTTONUP);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// We were not in tray..
|
||||||
|
int sw = 0;
|
||||||
|
|
||||||
|
if (::IsZoomed(hwnd))
|
||||||
|
sw = SW_MAXIMIZE;
|
||||||
|
else if (::IsIconic(hwnd))
|
||||||
|
sw = SW_RESTORE;
|
||||||
|
|
||||||
|
if (sw != 0)
|
||||||
|
::ShowWindow(hwnd, sw);
|
||||||
|
|
||||||
|
::SetForegroundWindow(hwnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
case WM_SYSCOMMAND:
|
case WM_SYSCOMMAND:
|
||||||
{
|
{
|
||||||
const NppGUI & nppgui = (nppParam.getNppGUI());
|
const NppGUI & nppgui = (nppParam.getNppGUI());
|
||||||
|
@ -644,6 +644,7 @@
|
|||||||
#define NPPM_INTERNAL_CLEANSMARTHILITING (NOTEPADPLUS_USER_INTERNAL + 68)
|
#define NPPM_INTERNAL_CLEANSMARTHILITING (NOTEPADPLUS_USER_INTERNAL + 68)
|
||||||
#define NPPM_INTERNAL_CLEANBRACEMATCH (NOTEPADPLUS_USER_INTERNAL + 69)
|
#define NPPM_INTERNAL_CLEANBRACEMATCH (NOTEPADPLUS_USER_INTERNAL + 69)
|
||||||
#define NPPM_INTERNAL_WINDOWSSESSIONEXIT (NOTEPADPLUS_USER_INTERNAL + 70)
|
#define NPPM_INTERNAL_WINDOWSSESSIONEXIT (NOTEPADPLUS_USER_INTERNAL + 70)
|
||||||
|
#define NPPM_INTERNAL_RESTOREMONOINSTANCE (NOTEPADPLUS_USER_INTERNAL + 71)
|
||||||
|
|
||||||
// See Notepad_plus_msgs.h
|
// See Notepad_plus_msgs.h
|
||||||
//#define NOTEPADPLUS_USER (WM_USER + 1000)
|
//#define NOTEPADPLUS_USER (WM_USER + 1000)
|
||||||
|
@ -531,17 +531,8 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR pCmdLine, int)
|
|||||||
// First of all, destroy static object NppParameters
|
// First of all, destroy static object NppParameters
|
||||||
nppParameters.destroyInstance();
|
nppParameters.destroyInstance();
|
||||||
|
|
||||||
int sw = 0;
|
// Restore the window, bring it to front, etc
|
||||||
|
::SendMessage(hNotepad_plus, NPPM_INTERNAL_RESTOREMONOINSTANCE, 0, 0);
|
||||||
if (::IsZoomed(hNotepad_plus))
|
|
||||||
sw = SW_MAXIMIZE;
|
|
||||||
else if (::IsIconic(hNotepad_plus))
|
|
||||||
sw = SW_RESTORE;
|
|
||||||
|
|
||||||
if (sw != 0)
|
|
||||||
::ShowWindow(hNotepad_plus, sw);
|
|
||||||
|
|
||||||
::SetForegroundWindow(hNotepad_plus);
|
|
||||||
|
|
||||||
if (params.size() > 0) //if there are files to open, use the WM_COPYDATA system
|
if (params.size() > 0) //if there are files to open, use the WM_COPYDATA system
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user