mirror of
https://github.com/reactos/reactos.git
synced 2025-01-03 21:09:19 +00:00
compatibility fix for "Sleipnir" web browser: minimizing by clicks on taskbar
svn path=/trunk/; revision=8448
This commit is contained in:
parent
a5248aa7bc
commit
6a84f09c2e
1 changed files with 10 additions and 7 deletions
|
@ -201,19 +201,22 @@ int TaskBar::Notify(int id, NMHDR* pnmh)
|
|||
void TaskBar::ActivateApp(TaskBarMap::iterator it, bool can_minimize)
|
||||
{
|
||||
HWND hwnd = it->first;
|
||||
bool minimize_it = can_minimize && (hwnd==GetForegroundWindow() || hwnd==_last_foreground_wnd);
|
||||
|
||||
if (can_minimize && (hwnd==GetForegroundWindow() || hwnd==_last_foreground_wnd)) {
|
||||
PostMessage(hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
|
||||
_last_foreground_wnd = 0;
|
||||
} else {
|
||||
// switch to selected application window
|
||||
// switch to selected application window
|
||||
if (!minimize_it)
|
||||
if (IsIconic(hwnd))
|
||||
PostMessage(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);
|
||||
|
||||
SetForegroundWindow(hwnd);
|
||||
// In case minimize_it is true, we _have_ to switch to the app before
|
||||
// posting SW_MINIMIZE to be compatible with some applications (e.g. "Sleipnir")
|
||||
SetForegroundWindow(hwnd);
|
||||
|
||||
if (minimize_it) {
|
||||
PostMessage(hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
|
||||
_last_foreground_wnd = 0;
|
||||
} else
|
||||
_last_foreground_wnd = hwnd;
|
||||
}
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue