Skip to content

Commit

Permalink
[WIN] make the application inactive when losing the focus in D3D full…
Browse files Browse the repository at this point in the history
…screen mode. Helps reduce CPU usage spikes.
  • Loading branch information
CrystalP authored and CrystalP committed Aug 23, 2011
1 parent e391fde commit b51cb8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion xbmc/rendering/dx/RenderSystemDX.h
Expand Up @@ -81,7 +81,7 @@ class CRenderSystemDX : public CRenderSystemBase
DWORD DefaultD3DUsage() { return m_defaultD3DUsage; }
D3DPOOL DefaultD3DPool() { return m_defaultD3DPool; }
D3DADAPTER_IDENTIFIER9 GetAIdentifier() { return m_AIdentifier; }

bool WindowedMode() { return m_useWindowedDX; }
bool Interlaced() { return m_interlaced; }

/*!
Expand Down
9 changes: 7 additions & 2 deletions xbmc/windowing/windows/WinEventsWin32.cpp
Expand Up @@ -404,9 +404,14 @@ LRESULT CALLBACK CWinEventsWin32::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
{
WINDOWPLACEMENT lpwndpl;
lpwndpl.length = sizeof(lpwndpl);
if (LOWORD(wParam) != WA_INACTIVE && GetWindowPlacement(hWnd, &lpwndpl))
if (LOWORD(wParam) != WA_INACTIVE)
{
g_application.m_AppActive = lpwndpl.showCmd != SW_HIDE;
if (GetWindowPlacement(hWnd, &lpwndpl))
g_application.m_AppActive = lpwndpl.showCmd != SW_HIDE;
}
else
{
g_application.m_AppActive = g_Windowing.WindowedMode();
}
}
if (g_application.m_AppActive != active)
Expand Down

0 comments on commit b51cb8e

Please sign in to comment.