Skip to content

Commit 4866a25

Browse files
authored
[EXPLORER] Fix Taskbar context menu Z-order bug (reactos#8186)
Taskbar task button context menu was wrongly overlapped by Taskbar. reactos#8105 introduced this bug. JIRA issue: CORE-20260 - Don't bring the taskbar to top on no rude app. - Check the target window by FindTaskItem in OnWindowActivated and OnWindowDestroyed.
1 parent c720dd4 commit 4866a25

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

base/shell/explorer/taskswnd.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1957,20 +1957,18 @@ class CTaskSwitchWnd :
19571957
Data.pTray = m_Tray;
19581958
::EnumDisplayMonitors(NULL, NULL, FullScreenEnumProc, (LPARAM)&Data);
19591959

1960-
// Make the taskbar bottom or top
1961-
UINT uFlags = SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOOWNERZORDER;
1962-
HWND hwndTray = m_Tray->GetHWND();
1963-
::SetWindowPos(hwndTray, (hwndRude ? HWND_BOTTOM : HWND_TOP), 0, 0, 0, 0, uFlags);
1964-
19651960
if (hwndRude)
19661961
{
1962+
// Make the taskbar bottom
1963+
UINT uFlags = SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOOWNERZORDER;
1964+
HWND hwndTray = m_Tray->GetHWND();
1965+
::SetWindowPos(hwndTray, HWND_BOTTOM, 0, 0, 0, 0, uFlags);
1966+
1967+
// Switch to the rude app if necessary
19671968
DWORD exstyle = (DWORD)::GetWindowLongPtrW(hwndRude, GWL_EXSTYLE);
19681969
if (!(exstyle & WS_EX_TOPMOST) && !SHELL_IsRudeWindowActive(hwndRude))
19691970
::SwitchToThisWindow(hwndRude, TRUE);
19701971
}
1971-
1972-
// FIXME: NIN_BALLOONHIDE
1973-
// FIXME: NIN_POPUPCLOSE
19741972
}
19751973

19761974
HWND FindRudeApp(_In_opt_ HWND hwndFirstCheck)
@@ -2001,6 +1999,8 @@ class CTaskSwitchWnd :
20011999
// HSHELL_WINDOWACTIVATED, HSHELL_RUDEAPPACTIVATED
20022000
void OnWindowActivated(_In_ HWND hwndTarget)
20032001
{
2002+
if (!FindTaskItem(hwndTarget))
2003+
return;
20042004
// Re-start rude app validation
20052005
KillTimer(TIMER_ID_VALIDATE_RUDE_APP);
20062006
SetTimer(TIMER_ID_VALIDATE_RUDE_APP, VALIDATE_RUDE_INTERVAL, NULL);
@@ -2010,6 +2010,8 @@ class CTaskSwitchWnd :
20102010
// HSHELL_WINDOWDESTROYED
20112011
void OnWindowDestroyed(_In_ HWND hwndTarget)
20122012
{
2013+
if (!FindTaskItem(hwndTarget))
2014+
return;
20132015
HWND hwndRude = FindRudeApp(hwndTarget);
20142016
HandleFullScreenApp(hwndRude);
20152017
}

0 commit comments

Comments
 (0)