Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

X11: factor out code that reset device after lost

  • Loading branch information...
commit 5b6caeb3df6cb64cdf893829d7f3fdf5c37b835b 1 parent ad94545
Joakim Plate authored
23  xbmc/windowing/X11/WinSystemX11.cpp
@@ -498,15 +498,7 @@ void CWinSystemX11::CheckDisplayEvents()
498 498
   if (bGotEvent || bTimeout)
499 499
   {
500 500
     CLog::Log(LOGDEBUG, "%s - notify display reset event", __FUNCTION__);
501  
-
502  
-    CSingleLock lock(m_resourceSection);
503  
-
504  
-    // tell any shared resources
505  
-    for (vector<IDispResource *>::iterator i = m_resources.begin(); i != m_resources.end(); i++)
506  
-      (*i)->OnResetDevice();
507  
-
508  
-    // reset fail safe timer
509  
-    m_dpyLostTime = 0;
  501
+    OnResetDevice();
510 502
   }
511 503
 #endif
512 504
 }
@@ -527,6 +519,19 @@ void CWinSystemX11::OnLostDevice()
527 519
   m_dpyLostTime = CurrentHostCounter();
528 520
 }
529 521
 
  522
+
  523
+void CWinSystemX11::OnResetDevice()
  524
+{
  525
+  CSingleLock lock(m_resourceSection);
  526
+
  527
+  // tell any shared resources
  528
+  for (vector<IDispResource *>::iterator i = m_resources.begin(); i != m_resources.end(); i++)
  529
+    (*i)->OnResetDevice();
  530
+
  531
+  // reset fail safe timer
  532
+  m_dpyLostTime = 0;
  533
+}
  534
+
530 535
 void CWinSystemX11::Register(IDispResource *resource)
531 536
 {
532 537
   CSingleLock lock(m_resourceSection);
1  xbmc/windowing/X11/WinSystemX11.h
@@ -68,6 +68,7 @@ class CWinSystemX11 : public CWinSystemBase
68 68
   bool RefreshGlxContext();
69 69
   void CheckDisplayEvents();
70 70
   void OnLostDevice();
  71
+  void OnResetDevice();
71 72
 
72 73
   SDL_Surface* m_SDLSurface;
73 74
   GLXContext   m_glContext;

0 notes on commit 5b6caeb

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