Skip to content

Commit

Permalink
[WIN32] removed m_AppActive and use SetRenderGui instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
wsoltys committed Apr 10, 2013
1 parent c469434 commit 8c48567
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 33 deletions.
10 changes: 1 addition & 9 deletions xbmc/Application.cpp
Expand Up @@ -2358,13 +2358,6 @@ void CApplication::Render()
if (m_bStop || m_bInBackground)
return;

if (!m_AppActive && !m_bStop && (!IsPlayingVideo() || IsPaused()))
{
Sleep(1);
ResetScreenSaver();
return;
}

MEASURE_FUNCTION;

int vsync_mode = g_guiSettings.GetInt("videoscreen.vsync");
Expand Down Expand Up @@ -3081,8 +3074,8 @@ void CApplication::FrameMove(bool processEvents, bool processGUI)
}
}
g_graphicsContext.Unlock();
CWinEvents::MessagePump();
}
CWinEvents::MessagePump();

#if defined(HAS_LIRC) || defined(HAS_IRSERVERSUITE)
// Read the input from a remote
Expand Down Expand Up @@ -3672,7 +3665,6 @@ void CApplication::Stop(int exitCode)
CLog::Log(LOGNOTICE, "Not saving settings (settings.xml is not present)");

m_bStop = true;
m_AppActive = false;
m_AppFocused = false;
m_ExitCode = exitCode;
CLog::Log(LOGNOTICE, "stop all");
Expand Down
1 change: 1 addition & 0 deletions xbmc/Application.h
Expand Up @@ -376,6 +376,7 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs

CSplash* GetSplash() { return m_splash; }
void SetRenderGUI(bool renderGUI);
bool GetRenderGUI() const { return m_renderGUI; };

bool SetLanguage(const CStdString &strLanguage);
protected:
Expand Down
2 changes: 0 additions & 2 deletions xbmc/XBApplicationEx.cpp
Expand Up @@ -38,7 +38,6 @@ CXBApplicationEx::CXBApplicationEx()
{
// Variables to perform app timing
m_bStop = false;
m_AppActive = true;
m_AppFocused = true;
m_ExitCode = EXITCODE_QUIT;
m_renderGUI = false;
Expand All @@ -53,7 +52,6 @@ bool CXBApplicationEx::Create()
{
// Variables to perform app timing
m_bStop = false;
m_AppActive = true;
m_AppFocused = true;
m_ExitCode = EXITCODE_QUIT;

Expand Down
1 change: 0 additions & 1 deletion xbmc/XBApplicationEx.h
Expand Up @@ -40,7 +40,6 @@ class CXBApplicationEx : public IWindowManagerCallback
// Variables for timing
bool m_bStop;
int m_ExitCode;
bool m_AppActive;
bool m_AppFocused;
bool m_renderGUI;

Expand Down
2 changes: 0 additions & 2 deletions xbmc/android/activity/XBMCApp.cpp
Expand Up @@ -306,8 +306,6 @@ void CXBMCApp::XBMC_Pause(bool pause)
// Only send the PAUSE action if we are pausing XBMC and something is currently playing
if (pause && g_application.IsPlaying() && !g_application.IsPaused())
CApplicationMessenger::Get().SendAction(CAction(ACTION_PAUSE), WINDOW_INVALID, true);

g_application.m_AppActive = g_application.m_AppFocused = !pause;
}

void CXBMCApp::XBMC_Stop()
Expand Down
7 changes: 2 additions & 5 deletions xbmc/guilib/GUIWindowManager.cpp
Expand Up @@ -511,11 +511,8 @@ void CGUIWindowManager::Process(unsigned int currentTime)
pWindow->DoProcess(currentTime, dirtyregions);
}

if (g_application.m_AppActive)
{
for (CDirtyRegionList::iterator itr = dirtyregions.begin(); itr != dirtyregions.end(); itr++)
m_tracker.MarkDirtyRegion(*itr);
}
for (CDirtyRegionList::iterator itr = dirtyregions.begin(); itr != dirtyregions.end(); itr++)
m_tracker.MarkDirtyRegion(*itr);
}

void CGUIWindowManager::MarkDirty()
Expand Down
4 changes: 2 additions & 2 deletions xbmc/windowing/WinEventsSDL.cpp
Expand Up @@ -240,8 +240,8 @@ bool CWinEventsSDL::MessagePump()
//If the window was inconified or restored
if( event.active.state & SDL_APPACTIVE )
{
g_application.m_AppActive = event.active.gain != 0;
g_Windowing.NotifyAppActiveChange(g_application.m_AppActive);
g_application.SetRenderGUI(event.active.gain != 0);
g_Windowing.NotifyAppActiveChange(g_application.GetRenderGUI());
}
else if (event.active.state & SDL_APPINPUTFOCUS)
{
Expand Down
24 changes: 12 additions & 12 deletions xbmc/windowing/windows/WinEventsWin32.cpp
Expand Up @@ -432,22 +432,22 @@ LRESULT CALLBACK CWinEventsWin32::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
break;
case WM_SHOWWINDOW:
{
bool active = g_application.m_AppActive;
g_application.m_AppActive = wParam != 0;
if (g_application.m_AppActive != active)
g_Windowing.NotifyAppActiveChange(g_application.m_AppActive);
CLog::Log(LOGDEBUG, __FUNCTION__"Window is %s", g_application.m_AppActive ? "shown" : "hidden");
bool active = g_application.GetRenderGUI();
g_application.SetRenderGUI(wParam != 0);
if (g_application.GetRenderGUI() != active)
g_Windowing.NotifyAppActiveChange(g_application.GetRenderGUI());
CLog::Log(LOGDEBUG, __FUNCTION__"Window is %s", g_application.GetRenderGUI() ? "shown" : "hidden");
}
break;
case WM_ACTIVATE:
{
if( WA_INACTIVE != wParam )
g_Joystick.Reinitialize();

bool active = g_application.m_AppActive;
bool active = g_application.GetRenderGUI();
if (HIWORD(wParam))
{
g_application.m_AppActive = false;
g_application.SetRenderGUI(false);
}
else
{
Expand All @@ -456,16 +456,16 @@ LRESULT CALLBACK CWinEventsWin32::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
if (LOWORD(wParam) != WA_INACTIVE)
{
if (GetWindowPlacement(hWnd, &lpwndpl))
g_application.m_AppActive = lpwndpl.showCmd != SW_HIDE;
g_application.SetRenderGUI(lpwndpl.showCmd != SW_HIDE);
}
else
{
g_application.m_AppActive = g_Windowing.WindowedMode();
g_application.SetRenderGUI(g_Windowing.WindowedMode());
}
}
if (g_application.m_AppActive != active)
g_Windowing.NotifyAppActiveChange(g_application.m_AppActive);
CLog::Log(LOGDEBUG, __FUNCTION__"Window is %s", g_application.m_AppActive ? "active" : "inactive");
if (g_application.GetRenderGUI() != active)
g_Windowing.NotifyAppActiveChange(g_application.GetRenderGUI());
CLog::Log(LOGDEBUG, __FUNCTION__"Window is %s", g_application.GetRenderGUI() ? "active" : "inactive");
}
break;
case WM_SETFOCUS:
Expand Down

0 comments on commit 8c48567

Please sign in to comment.