Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Periodically run

SetThreadExecutionState(ES_DISPLAY_REQUIRED|ES_SYSTEM_REQUIRED);

to reset the input timer.

Note that this does not use g_application.m_AppFocused, due to a bug: if
the application doesn't have focus to begin with, m_AppFocused is true
until we gain focus and lose it again, because no WM_KILLFOCUS is ever
received.  I'm not fixing that here to keep the scope of this change
small.
  • Loading branch information...
commit 204ee143e3f738418b93688efb631295a76233a3 1 parent 67ee34f
zewt authored
13 xbmc/windowing/windows/WinEventsWin32.cpp
View
@@ -719,6 +719,19 @@ LRESULT CALLBACK CWinEventsWin32::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
//some other app has painted over our window, mark everything as dirty
g_windowManager.MarkDirty();
break;
+ case WM_TIMER:
+ {
+ bool hasFocus = GetForegroundWindow() == hWnd;
+ CLog::Log(LOGDEBUG,"WM_TIMER has focus: %i", hasFocus);
+
+ // Reset the input idle timer.
+ if(hasFocus)
+ SetThreadExecutionState(ES_DISPLAY_REQUIRED|ES_SYSTEM_REQUIRED);
+
+ // Schedule the next timer.
+ SetTimer(hWnd, 0, 1000, NULL);
+ break;
+ }
case BONJOUR_EVENT:
CZeroconf::GetInstance()->ProcessResults();
break;
3  xbmc/windowing/windows/WinSystemWin32.cpp
View
@@ -126,6 +126,9 @@ bool CWinSystemWin32::CreateNewWindow(const CStdString& name, bool fullScreen, R
ResizeInternal(true);
+ // Start WM_TIMER.
+ SetTimer(hWnd, 0, 1000, NULL);
+
// Show the window
ShowWindow( m_hWnd, SW_SHOWDEFAULT );
UpdateWindow( m_hWnd );
Please sign in to comment.
Something went wrong with that request. Please try again.