remember last foreground window when switching desktops

svn path=/branches/lean-explorer/; revision=8437
This commit is contained in:
Martin Fuchs
2004-02-28 13:45:32 +00:00
parent 3b06f79ff4
commit 91554083e0
2 changed files with 6 additions and 0 deletions
@@ -35,6 +35,7 @@
#include "../externals.h"
#include "../taskbar/desktopbar.h"
#include "../taskbar/taskbar.h" // for PM_GET_LAST_ACTIVE
#include "../explorer_intres.h"
@@ -85,6 +86,7 @@ void Desktops::SwitchToDesktop(int idx)
windows.clear();
EnumWindows(SwitchDesktopEnumFct, (LPARAM)&windows);
old_desktop._hwndForeground = (HWND)SendMessage(g_Globals._hwndDesktopBar, PM_GET_LAST_ACTIVE, 0, 0);
// hide all windows we found
for(WindowSet::iterator it=windows.begin(); it!=windows.end(); ++it)
@@ -94,6 +96,9 @@ void Desktops::SwitchToDesktop(int idx)
for(WindowSet::iterator it=desktop._windows.begin(); it!=desktop._windows.end(); ++it)
ShowWindowAsync(*it, SW_SHOW);
if (desktop._hwndForeground)
SetForegroundWindow(desktop._hwndForeground);
desktop._windows.clear();
_current_desktop = idx;
+1
View File
@@ -149,6 +149,7 @@ typedef pair<HWND, DWORD> MinimizeStruct;
struct Desktop
{
set<HWND> _windows;
WindowHandle _hwndForeground;
list<MinimizeStruct> _minimized;
};
typedef Desktop DesktopRef;