small fix in spinner handling...
authorghost <andreas.monzner@multimedia-labs.de>
Sat, 9 Jan 2010 19:42:14 +0000 (20:42 +0100)
committerghost <andreas.monzner@multimedia-labs.de>
Sat, 9 Jan 2010 19:43:06 +0000 (20:43 +0100)
fixes bug #378

lib/base/ebase.cpp
lib/base/ebase.h
lib/gdi/grc.cpp
lib/gdi/grc.h

index 313732abd221fc27c30292b602ff1591b5ae5230..5bafe7323e86781527239265408f27de56323d16 100644 (file)
@@ -225,6 +225,7 @@ int eMainloop::processOneEvent(unsigned int twisted_timeout, PyObject **res, ePy
        }
 
        m_is_idle = 1;
+       ++m_idle_count;
 
        if (this == eApp)
        {
index 524052bda4f9b723ec4208b342d98b29ae0f6605..c69133f621239a431b1bc74254df93979044f5cf 100644 (file)
@@ -195,6 +195,7 @@ class eMainloop
        int processOneEvent(unsigned int user_timeout, PyObject **res=0, ePyObject additional=ePyObject());
        int retval;
        int m_is_idle;
+       int m_idle_count;
        eSocketNotifier *m_inActivate;
 
        int m_interrupt_requested;
@@ -210,7 +211,7 @@ public:
 #endif
 
        eMainloop()
-               :app_quit_now(0),loop_level(0),retval(0), m_is_idle(0), m_inActivate(0), m_interrupt_requested(0)
+               :app_quit_now(0),loop_level(0),retval(0), m_is_idle(0), m_idle_count(0), m_inActivate(0), m_interrupt_requested(0)
        {
                existing_loops.push_back(this);
        }
@@ -240,6 +241,7 @@ public:
 
                /* m_is_idle needs to be atomic, but it doesn't really matter much, as it's read-only from outside */
        int isIdle() { return m_is_idle; }
+       int idleCount() { return m_idle_count; }
 };
 
 /**
index 1f1b06a059cc6e7e4d4b416cbb1698d0c2622c80..dff6b059a0f9351ac80f9420b6aa8027721f67b4 100644 (file)
@@ -164,7 +164,13 @@ void *gRC::thread()
                                if (pthread_cond_timedwait(&cond, &mutex, &timeout) == ETIMEDOUT)
                                {
                                        if (eApp && !eApp->isIdle())
-                                               idle = 0;
+                                       {
+                                               int idle_count = eApp->idleCount();
+                                               if (idle_count == m_prev_idle_count)
+                                                       idle = 0;
+                                               else
+                                                       m_prev_idle_count = idle_count;
+                                       }
                                }
 
                                if (!idle)
index 5d0106b3b98102ec36f198fe18797eaf7d3504b4..3b8201add99ab4e7de9d4ecffb262c60e8e8f394 100644 (file)
@@ -176,6 +176,7 @@ class gRC: public iObject, public Object
        
        ePtr<gCompositingData> m_compositing;
 
+       int m_prev_idle_count;
 public:
        gRC();
        virtual ~gRC();