Skip to content
This repository
Browse code

[WIN32] removed m_AppActive and use SetRenderGui instead.

  • Loading branch information...
commit 8c48567d6fb99f068b290af4f8f3f95be142516a 1 parent c469434
wsoltys authored April 04, 2013
10  xbmc/Application.cpp
@@ -2358,13 +2358,6 @@ void CApplication::Render()
2358 2358
   if (m_bStop || m_bInBackground)
2359 2359
     return;
2360 2360
 
2361  
-  if (!m_AppActive && !m_bStop && (!IsPlayingVideo() || IsPaused()))
2362  
-  {
2363  
-    Sleep(1);
2364  
-    ResetScreenSaver();
2365  
-    return;
2366  
-  }
2367  
-
2368 2361
   MEASURE_FUNCTION;
2369 2362
 
2370 2363
   int vsync_mode = g_guiSettings.GetInt("videoscreen.vsync");
@@ -3081,8 +3074,8 @@ void CApplication::FrameMove(bool processEvents, bool processGUI)
3081 3074
         }
3082 3075
       }
3083 3076
       g_graphicsContext.Unlock();
3084  
-      CWinEvents::MessagePump();
3085 3077
     }
  3078
+    CWinEvents::MessagePump();
3086 3079
 
3087 3080
 #if defined(HAS_LIRC) || defined(HAS_IRSERVERSUITE)
3088 3081
     // Read the input from a remote
@@ -3672,7 +3665,6 @@ void CApplication::Stop(int exitCode)
3672 3665
       CLog::Log(LOGNOTICE, "Not saving settings (settings.xml is not present)");
3673 3666
 
3674 3667
     m_bStop = true;
3675  
-    m_AppActive = false;
3676 3668
     m_AppFocused = false;
3677 3669
     m_ExitCode = exitCode;
3678 3670
     CLog::Log(LOGNOTICE, "stop all");
1  xbmc/Application.h
@@ -376,6 +376,7 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs
376 376
 
377 377
   CSplash* GetSplash() { return m_splash; }
378 378
   void SetRenderGUI(bool renderGUI);
  379
+  bool GetRenderGUI() const { return m_renderGUI; };
379 380
 
380 381
   bool SetLanguage(const CStdString &strLanguage);
381 382
 protected:
2  xbmc/XBApplicationEx.cpp
@@ -38,7 +38,6 @@ CXBApplicationEx::CXBApplicationEx()
38 38
 {
39 39
   // Variables to perform app timing
40 40
   m_bStop = false;
41  
-  m_AppActive = true;
42 41
   m_AppFocused = true;
43 42
   m_ExitCode = EXITCODE_QUIT;
44 43
   m_renderGUI = false;
@@ -53,7 +52,6 @@ bool CXBApplicationEx::Create()
53 52
 {
54 53
   // Variables to perform app timing
55 54
   m_bStop = false;
56  
-  m_AppActive = true;
57 55
   m_AppFocused = true;
58 56
   m_ExitCode = EXITCODE_QUIT;
59 57
 
1  xbmc/XBApplicationEx.h
@@ -40,7 +40,6 @@ class CXBApplicationEx : public IWindowManagerCallback
40 40
   // Variables for timing
41 41
   bool m_bStop;
42 42
   int  m_ExitCode;
43  
-  bool m_AppActive;
44 43
   bool m_AppFocused;
45 44
   bool m_renderGUI;
46 45
 
2  xbmc/android/activity/XBMCApp.cpp
@@ -306,8 +306,6 @@ void CXBMCApp::XBMC_Pause(bool pause)
306 306
   // Only send the PAUSE action if we are pausing XBMC and something is currently playing
307 307
   if (pause && g_application.IsPlaying() && !g_application.IsPaused())
308 308
     CApplicationMessenger::Get().SendAction(CAction(ACTION_PAUSE), WINDOW_INVALID, true);
309  
-
310  
-  g_application.m_AppActive = g_application.m_AppFocused = !pause;
311 309
 }
312 310
 
313 311
 void CXBMCApp::XBMC_Stop()
7  xbmc/guilib/GUIWindowManager.cpp
@@ -511,11 +511,8 @@ void CGUIWindowManager::Process(unsigned int currentTime)
511 511
       pWindow->DoProcess(currentTime, dirtyregions);
512 512
   }
513 513
 
514  
-  if (g_application.m_AppActive)
515  
-  {
516  
-    for (CDirtyRegionList::iterator itr = dirtyregions.begin(); itr != dirtyregions.end(); itr++)
517  
-      m_tracker.MarkDirtyRegion(*itr);
518  
-  }
  514
+  for (CDirtyRegionList::iterator itr = dirtyregions.begin(); itr != dirtyregions.end(); itr++)
  515
+    m_tracker.MarkDirtyRegion(*itr);
519 516
 }
520 517
 
521 518
 void CGUIWindowManager::MarkDirty()
4  xbmc/windowing/WinEventsSDL.cpp
@@ -240,8 +240,8 @@ bool CWinEventsSDL::MessagePump()
240 240
         //If the window was inconified or restored
241 241
         if( event.active.state & SDL_APPACTIVE )
242 242
         {
243  
-          g_application.m_AppActive = event.active.gain != 0;
244  
-          g_Windowing.NotifyAppActiveChange(g_application.m_AppActive);
  243
+          g_application.SetRenderGUI(event.active.gain != 0);
  244
+          g_Windowing.NotifyAppActiveChange(g_application.GetRenderGUI());
245 245
         }
246 246
         else if (event.active.state & SDL_APPINPUTFOCUS)
247 247
       {
24  xbmc/windowing/windows/WinEventsWin32.cpp
@@ -432,11 +432,11 @@ LRESULT CALLBACK CWinEventsWin32::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
432 432
       break;
433 433
     case WM_SHOWWINDOW:
434 434
       {
435  
-        bool active = g_application.m_AppActive;
436  
-        g_application.m_AppActive = wParam != 0;
437  
-        if (g_application.m_AppActive != active)
438  
-          g_Windowing.NotifyAppActiveChange(g_application.m_AppActive);
439  
-        CLog::Log(LOGDEBUG, __FUNCTION__"Window is %s", g_application.m_AppActive ? "shown" : "hidden");
  435
+        bool active = g_application.GetRenderGUI();
  436
+        g_application.SetRenderGUI(wParam != 0);
  437
+        if (g_application.GetRenderGUI() != active)
  438
+          g_Windowing.NotifyAppActiveChange(g_application.GetRenderGUI());
  439
+        CLog::Log(LOGDEBUG, __FUNCTION__"Window is %s", g_application.GetRenderGUI() ? "shown" : "hidden");
440 440
       }
441 441
       break;
442 442
     case WM_ACTIVATE:
@@ -444,10 +444,10 @@ LRESULT CALLBACK CWinEventsWin32::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
444 444
         if( WA_INACTIVE != wParam )
445 445
           g_Joystick.Reinitialize();
446 446
 
447  
-        bool active = g_application.m_AppActive;
  447
+        bool active = g_application.GetRenderGUI();
448 448
         if (HIWORD(wParam))
449 449
         {
450  
-          g_application.m_AppActive = false;
  450
+          g_application.SetRenderGUI(false);
451 451
         }
452 452
         else
453 453
         {
@@ -456,16 +456,16 @@ LRESULT CALLBACK CWinEventsWin32::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
456 456
           if (LOWORD(wParam) != WA_INACTIVE)
457 457
           {
458 458
             if (GetWindowPlacement(hWnd, &lpwndpl))
459  
-              g_application.m_AppActive = lpwndpl.showCmd != SW_HIDE;
  459
+              g_application.SetRenderGUI(lpwndpl.showCmd != SW_HIDE);
460 460
           }
461 461
           else
462 462
           {
463  
-            g_application.m_AppActive = g_Windowing.WindowedMode();
  463
+            g_application.SetRenderGUI(g_Windowing.WindowedMode());
464 464
           }
465 465
         }
466  
-        if (g_application.m_AppActive != active)
467  
-          g_Windowing.NotifyAppActiveChange(g_application.m_AppActive);
468  
-        CLog::Log(LOGDEBUG, __FUNCTION__"Window is %s", g_application.m_AppActive ? "active" : "inactive");
  466
+        if (g_application.GetRenderGUI() != active)
  467
+          g_Windowing.NotifyAppActiveChange(g_application.GetRenderGUI());
  468
+        CLog::Log(LOGDEBUG, __FUNCTION__"Window is %s", g_application.GetRenderGUI() ? "active" : "inactive");
469 469
       }
470 470
       break;
471 471
     case WM_SETFOCUS:

0 notes on commit 8c48567

Please sign in to comment.
Something went wrong with that request. Please try again.