[TASKMGR]

fix keyboard navigation for the tabcontrol
See issue 4245 for more details.

svn path=/trunk/; revision=66472
This commit is contained in:
Christoph von Wittich 2015-02-26 16:16:36 +00:00
parent 329f3e0d7f
commit dc9f351bfc

View file

@ -47,6 +47,7 @@ int nOldWidth; /* Holds the previous client area width */
int nOldHeight; /* Holds the previous client area height */ int nOldHeight; /* Holds the previous client area height */
BOOL bInMenuLoop = FALSE; /* Tells us if we are in the menu loop */ BOOL bInMenuLoop = FALSE; /* Tells us if we are in the menu loop */
BOOL bWasKeyboardInput = FALSE; /* TabChange by Keyboard or Mouse ? */
TASKMANAGER_SETTINGS TaskManagerSettings; TASKMANAGER_SETTINGS TaskManagerSettings;
@ -411,12 +412,21 @@ TaskManagerWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
case WM_NOTIFY: case WM_NOTIFY:
pnmh = (LPNMHDR)lParam; pnmh = (LPNMHDR)lParam;
if ((pnmh->hwndFrom == hTabWnd) && if ((pnmh->hwndFrom == hTabWnd) &&
(pnmh->idFrom == IDC_TAB) && (pnmh->idFrom == IDC_TAB))
(pnmh->code == TCN_SELCHANGE))
{ {
switch (pnmh->code)
{
case TCN_SELCHANGE:
TaskManager_OnTabWndSelChange(); TaskManager_OnTabWndSelChange();
}
break; break;
case TCN_KEYDOWN:
bWasKeyboardInput = TRUE;
break;
case NM_CLICK:
bWasKeyboardInput = FALSE;
break;
}
}
#if 0 #if 0
case WM_NCPAINT: case WM_NCPAINT:
hdc = GetDC(hDlg); hdc = GetDC(hDlg);
@ -1045,6 +1055,7 @@ void TaskManager_OnTabWndSelChange(void)
/* /*
* Give the application list control focus * Give the application list control focus
*/ */
if (!bWasKeyboardInput)
SetFocus(hApplicationPageListCtrl); SetFocus(hApplicationPageListCtrl);
break; break;
@ -1070,6 +1081,7 @@ void TaskManager_OnTabWndSelChange(void)
/* /*
* Give the process list control focus * Give the process list control focus
*/ */
if (!bWasKeyboardInput)
SetFocus(hProcessPageListCtrl); SetFocus(hProcessPageListCtrl);
break; break;
@ -1116,6 +1128,7 @@ void TaskManager_OnTabWndSelChange(void)
/* /*
* Give the tab control focus * Give the tab control focus
*/ */
if (!bWasKeyboardInput)
SetFocus(hTabWnd); SetFocus(hTabWnd);
break; break;
} }