fix spinner handling
[enigma2.git] / lib / base / ebase.cpp
index a79b1d4a8fef51dedd324ee2fbabbdb0abd6771f..62746f4be4ea144618b9ccc1054ea53015e9d103 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <lib/base/eerror.h>
 #include <lib/base/elock.h>
+#include <lib/gdi/grc.h>
 
 eSocketNotifier::eSocketNotifier(eMainloop *context, int fd, int requested, bool startnow): context(*context), fd(fd), state(0), requested(requested)
 {
@@ -147,18 +148,15 @@ int eMainloop::processOneEvent(unsigned int twisted_timeout, PyObject **res, ePy
 
        long poll_timeout = -1; /* infinite in case of empty timer list */
 
-       if (!m_timer_list.empty() || twisted_timeout > 0)
+       if (!m_timer_list.empty())
        {
-               if (!m_timer_list.empty())
-               {
-                       /* process all timers which are ready. first remove them out of the list. */
-                       while (!m_timer_list.empty() && (poll_timeout = timeout_usec( m_timer_list.begin()->getNextActivation() ) ) <= 0 )
-                               m_timer_list.begin()->activate();
-                       if (poll_timeout < 0)
-                               poll_timeout = 0;
-                       else /* convert us to ms */
-                               poll_timeout /= 1000;
-               }
+               /* process all timers which are ready. first remove them out of the list. */
+               while (!m_timer_list.empty() && (poll_timeout = timeout_usec( m_timer_list.begin()->getNextActivation() ) ) <= 0 )
+                       m_timer_list.begin()->activate();
+               if (poll_timeout < 0)
+                       poll_timeout = 0;
+               else /* convert us to ms */
+                       poll_timeout /= 1000;
        }
 
        if ((twisted_timeout > 0) && (poll_timeout > 0) && ((unsigned int)poll_timeout > twisted_timeout))
@@ -204,9 +202,14 @@ int eMainloop::processOneEvent(unsigned int twisted_timeout, PyObject **res, ePy
 
        if (this == eApp)
        {
+               gOpcode op;
+               op.dc = 0;
+               op.opcode = gOpcode::flush;
+               gRC::getInstance()->submit(op);
                Py_BEGIN_ALLOW_THREADS
                ret = ::poll(pfd, fdcount, poll_timeout);
                Py_END_ALLOW_THREADS
+               
        } else
                ret = ::poll(pfd, fdcount, poll_timeout);