mirror of
https://github.com/reactos/reactos.git
synced 2024-08-08 04:08:29 +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
|
@ -201,19 +201,22 @@ int TaskBar::Notify(int id, NMHDR* pnmh)
|
||||||
void TaskBar::ActivateApp(TaskBarMap::iterator it, bool can_minimize)
|
void TaskBar::ActivateApp(TaskBarMap::iterator it, bool can_minimize)
|
||||||
{
|
{
|
||||||
HWND hwnd = it->first;
|
HWND hwnd = it->first;
|
||||||
|
bool minimize_it = can_minimize && (hwnd==GetForegroundWindow() || hwnd==_last_foreground_wnd);
|
||||||
|
|
||||||
if (can_minimize && (hwnd==GetForegroundWindow() || hwnd==_last_foreground_wnd)) {
|
// switch to selected application window
|
||||||
PostMessage(hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
|
if (!minimize_it)
|
||||||
_last_foreground_wnd = 0;
|
|
||||||
} else {
|
|
||||||
// switch to selected application window
|
|
||||||
if (IsIconic(hwnd))
|
if (IsIconic(hwnd))
|
||||||
PostMessage(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);
|
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;
|
_last_foreground_wnd = hwnd;
|
||||||
}
|
|
||||||
|
|
||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue