Cleaned up unneeded codes.

This commit is contained in:
spx 2011-04-17 12:19:47 +00:00
parent fb8abf3750
commit 5246ca94c6
2 changed files with 2 additions and 84 deletions

View File

@ -29,14 +29,12 @@
enum TIMER enum TIMER
{ {
TIMER_SHOWDESKTOP = 1, TIMER_SHOWDESKTOP = 1,
// TIMER_COMPOSITION = 2, TIMER_NETSTATS = 2,
TIMER_NETSTATS = 3, TIMER_DELETELATER = 3
TIMER_DELETELATER = 4
}; };
enum INTERVAL enum INTERVAL
{ {
INTERVAL_SHOWDESKTOP = 250, INTERVAL_SHOWDESKTOP = 250,
// INTERVAL_COMPOSITION = 250,
INTERVAL_NETSTATS = 60000, INTERVAL_NETSTATS = 60000,
INTERVAL_DELETELATER = 1000 INTERVAL_DELETELATER = 1000
}; };
@ -48,7 +46,6 @@ HWND CSystem::c_HelperWindow = NULL;
HWINEVENTHOOK CSystem::c_WinEventHook = NULL; HWINEVENTHOOK CSystem::c_WinEventHook = NULL;
//bool CSystem::c_DwmCompositionEnabled = false;
bool CSystem::c_ShowDesktop = false; bool CSystem::c_ShowDesktop = false;
OSPLATFORM CSystem::c_Platform = OSPLATFORM_UNKNOWN; OSPLATFORM CSystem::c_Platform = OSPLATFORM_UNKNOWN;
@ -109,8 +106,6 @@ void CSystem::Initialize(HINSTANCE instance)
c_Monitors.monitors.reserve(8); c_Monitors.monitors.reserve(8);
SetMultiMonitorInfo(); SetMultiMonitorInfo();
// c_DwmCompositionEnabled = (DwmIsCompositionEnabled() == TRUE);
c_WinEventHook = SetWinEventHook( c_WinEventHook = SetWinEventHook(
EVENT_SYSTEM_FOREGROUND, EVENT_SYSTEM_FOREGROUND,
EVENT_SYSTEM_FOREGROUND, EVENT_SYSTEM_FOREGROUND,
@ -134,7 +129,6 @@ void CSystem::Initialize(HINSTANCE instance)
void CSystem::Finalize() void CSystem::Finalize()
{ {
KillTimer(c_Window, TIMER_SHOWDESKTOP); KillTimer(c_Window, TIMER_SHOWDESKTOP);
// KillTimer(c_Window, TIMER_COMPOSITION);
KillTimer(c_Window, TIMER_NETSTATS); KillTimer(c_Window, TIMER_NETSTATS);
KillTimer(c_Window, TIMER_DELETELATER); KillTimer(c_Window, TIMER_DELETELATER);
@ -905,30 +899,6 @@ LRESULT CALLBACK CSystem::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
CheckDesktopState(GetWorkerW()); CheckDesktopState(GetWorkerW());
return 0; return 0;
//case TIMER_COMPOSITION:
// {
// if (GetShellDesktopWindow() || DesktopCompositionCheckCount >= 10) // 250ms * 10 = 2.5s
// {
// KillTimer(c_Window, TIMER_COMPOSITION);
// c_WinEventHook = SetWinEventHook(
// EVENT_SYSTEM_FOREGROUND,
// EVENT_SYSTEM_FOREGROUND,
// NULL,
// MyWinEventProc,
// 0,
// 0,
// WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS);
// SetTimer(c_Window, TIMER_SHOWDESKTOP, INTERVAL_SHOWDESKTOP, NULL);
// }
// else
// {
// ++DesktopCompositionCheckCount;
// }
// }
// return 0;
case TIMER_NETSTATS: case TIMER_NETSTATS:
CMeasureNet::UpdateIFTable(); CMeasureNet::UpdateIFTable();
@ -944,25 +914,6 @@ LRESULT CALLBACK CSystem::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
} }
break; break;
//case WM_DWMCOMPOSITIONCHANGED:
// Log(LOG_NOTICE, L"System: DWM desktop composition has been changed.");
// KillTimer(c_Window, TIMER_SHOWDESKTOP);
// KillTimer(c_Window, TIMER_COMPOSITION);
// if (c_WinEventHook)
// {
// UnhookWinEvent(c_WinEventHook);
// c_WinEventHook = NULL;
// }
// c_DwmCompositionEnabled = (DwmIsCompositionEnabled() == TRUE);
// DesktopCompositionCheckCount = 0;
// SetTimer(c_Window, TIMER_COMPOSITION, INTERVAL_COMPOSITION, NULL);
// return 0;
case WM_DISPLAYCHANGE: case WM_DISPLAYCHANGE:
Log(LOG_NOTICE, L"System: Display setting has been changed."); Log(LOG_NOTICE, L"System: Display setting has been changed.");
ClearMultiMonitorInfo(); ClearMultiMonitorInfo();
@ -1087,37 +1038,6 @@ HMODULE CSystem::RmLoadLibrary(LPCWSTR lpLibFileName, DWORD* dwError, bool ignor
return hLib; return hLib;
} }
/*
** DwmIsCompositionEnabled
**
** Returns TRUE if the DWM desktop composition is enabled.
**
*/
//BOOL CSystem::DwmIsCompositionEnabled()
//{
// BOOL fEnabled = FALSE;
//
// typedef HRESULT (WINAPI * FPDWMISCOMPOSITIONENABLED)(BOOL* pfEnabled);
//
// if (CSystem::GetOSPlatform() >= OSPLATFORM_VISTA)
// {
// HINSTANCE h = RmLoadLibrary(L"dwmapi.dll");
// if (h)
// {
// FPDWMISCOMPOSITIONENABLED DwmIsCompositionEnabled = (FPDWMISCOMPOSITIONENABLED)GetProcAddress(h, "DwmIsCompositionEnabled");
// if (DwmIsCompositionEnabled)
// {
// if (DwmIsCompositionEnabled(&fEnabled) != S_OK)
// {
// fEnabled = FALSE;
// }
// }
// FreeLibrary(h);
// }
// }
// return fEnabled;
//}
/* /*
** CopyFiles ** CopyFiles
** **

View File

@ -64,7 +64,6 @@ public:
static const MULTIMONITOR_INFO& GetMultiMonitorInfo() { return c_Monitors; } static const MULTIMONITOR_INFO& GetMultiMonitorInfo() { return c_Monitors; }
static size_t GetMonitorCount(); static size_t GetMonitorCount();
// static bool GetDwmCompositionEnabled() { return c_DwmCompositionEnabled; }
static bool GetShowDesktop() { return c_ShowDesktop; } static bool GetShowDesktop() { return c_ShowDesktop; }
static HWND GetShellDesktopWindow(bool findWorkerW = false); static HWND GetShellDesktopWindow(bool findWorkerW = false);
@ -105,7 +104,6 @@ private:
static MULTIMONITOR_INFO c_Monitors; // Multi-Monitor info static MULTIMONITOR_INFO c_Monitors; // Multi-Monitor info
// static bool c_DwmCompositionEnabled;
static bool c_ShowDesktop; static bool c_ShowDesktop;
static OSPLATFORM c_Platform; static OSPLATFORM c_Platform;