https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2d53e953cd19ea11b6ab8…
commit 2d53e953cd19ea11b6ab8221e959b2f143be7fb3
Author: Egor Ananyin <ananinegor(a)gmail.com>
AuthorDate: Tue Aug 15 22:37:27 2023 +0300
Commit: GitHub <noreply(a)github.com>
CommitDate: Tue Aug 15 21:37:27 2023 +0200
[TASKMGR] Do not disable status bar when opening system menu (#5571)
We do not need to clean the status bar when opening the system menu as it does not
show any hints.
CORE-19061
---
base/applications/taskmgr/taskmgr.c | 22 ++++++++++++++--------
base/applications/taskmgr/taskmgr.h | 4 ++--
2 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/base/applications/taskmgr/taskmgr.c b/base/applications/taskmgr/taskmgr.c
index 44bc24b2f96..6cbf8c7994e 100644
--- a/base/applications/taskmgr/taskmgr.c
+++ b/base/applications/taskmgr/taskmgr.c
@@ -482,14 +482,23 @@ TaskManagerWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM
lParam)
TrayIcon_UpdateIcon();
break;
+ case WM_INITMENUPOPUP:
+ /* Do not disable the status bar if we opened the system menu */
+ if (!HIWORD(lParam))
+ TaskManager_DisableStatusBar(hDlg);
+ else
+ TaskManager_EnableStatusBar(hDlg);
+ break;
case WM_ENTERMENULOOP:
- TaskManager_OnEnterMenuLoop(hDlg);
+ bInMenuLoop = TRUE;
break;
case WM_EXITMENULOOP:
- TaskManager_OnExitMenuLoop(hDlg);
+ bInMenuLoop = FALSE;
+ TaskManager_EnableStatusBar(hDlg);
break;
case WM_MENUSELECT:
- TaskManager_OnMenuSelect(hDlg, LOWORD(wParam), HIWORD(wParam), (HMENU)lParam);
+ if (!(HIWORD(wParam) & MF_SYSMENU))
+ TaskManager_OnMenuSelect(hDlg, LOWORD(wParam), HIWORD(wParam),
(HMENU)lParam);
break;
case WM_SYSCOLORCHANGE:
/* Forward WM_SYSCOLORCHANGE to common controls */
@@ -887,24 +896,21 @@ void TaskManager_OnRestoreMainWindow(void)
SetWindowPos(hMainWnd, (OnTop ? HWND_TOPMOST : HWND_TOP), 0, 0, 0, 0, SWP_NOSIZE |
SWP_NOMOVE | SWP_SHOWWINDOW);
}
-void TaskManager_OnEnterMenuLoop(HWND hWnd)
+void TaskManager_DisableStatusBar(HWND hWnd)
{
int nParts;
/* Update the status bar pane sizes */
nParts = -1;
SendMessageW(hStatusWnd, SB_SETPARTS, 1, (LPARAM) (LPINT)&nParts);
- bInMenuLoop = TRUE;
SendMessageW(hStatusWnd, SB_SETTEXT, (WPARAM)0, (LPARAM)L"");
}
-void TaskManager_OnExitMenuLoop(HWND hWnd)
+void TaskManager_EnableStatusBar(HWND hWnd)
{
RECT rc;
int nParts[3];
- bInMenuLoop = FALSE;
-
/* Update the status bar pane sizes */
GetClientRect(hWnd, &rc);
nParts[0] = STATUS_SIZE1;
diff --git a/base/applications/taskmgr/taskmgr.h b/base/applications/taskmgr/taskmgr.h
index 28136f8271c..a3b6220e8b9 100644
--- a/base/applications/taskmgr/taskmgr.h
+++ b/base/applications/taskmgr/taskmgr.h
@@ -94,8 +94,8 @@ void FillSolidRect(HDC hDC, LPCRECT lpRect, COLORREF clr);
void LoadSettings(void);
void SaveSettings(void);
void TaskManager_OnRestoreMainWindow(void);
-void TaskManager_OnEnterMenuLoop(HWND hWnd);
-void TaskManager_OnExitMenuLoop(HWND hWnd);
+void TaskManager_DisableStatusBar(HWND hWnd);
+void TaskManager_EnableStatusBar(HWND hWnd);
void TaskManager_OnMenuSelect(HWND hWnd, UINT nItemID, UINT nFlags, HMENU hSysMenu);
void TaskManager_OnViewUpdateSpeed(DWORD);
void TaskManager_OnTabWndSelChange(void);