compatibility fix for "Sleipnir" web browser: minimizing by clicks on taskbar

svn path=/trunk/; revision=8448
This commit is contained in:
Martin Fuchs 2004-02-28 16:05:33 +00:00
parent a5248aa7bc
commit 6a84f09c2e

View file

@ -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();
}