diff options
author | Sam Spilsbury <smspillaz@gmail.com> | 2011-01-04 17:03:16 +0800 |
---|---|---|
committer | Sam Spilsbury <smspillaz@gmail.com> | 2011-01-04 17:03:16 +0800 |
commit | 742e14cd0890edfd56d928668245eba82c7270c8 (patch) | |
tree | 0c0e788c3e7ae57aa6476ce6f16a36887b78afb4 | |
parent | b8010d03619080508dddfc8eaa33f86f6ab6cbbe (diff) | |
download | compiz-with-glib-mainloop-742e14cd0890edfd56d928668245eba82c7270c8.tar.gz compiz-with-glib-mainloop-742e14cd0890edfd56d928668245eba82c7270c8.tar.bz2 |
We can have a brief spin-wait system in place for CompTimeoutSource since
there isn't any case where we don't have timers running
-rw-r--r-- | src/privatescreen.h | 1 | ||||
-rw-r--r-- | src/screen.cpp | 17 | ||||
-rw-r--r-- | src/timer.cpp | 12 |
3 files changed, 9 insertions, 21 deletions
diff --git a/src/privatescreen.h b/src/privatescreen.h index 44d0b04..237fe03 100644 --- a/src/privatescreen.h +++ b/src/privatescreen.h @@ -91,7 +91,6 @@ class CompTimeoutSource : private: struct timeval mLastTimeout; - Glib::PollFD pfd; friend class CompTimer; friend class PrivateScreen; diff --git a/src/screen.cpp b/src/screen.cpp index 5c74795..72aa1dc 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -250,9 +250,6 @@ CompTimeoutSource::CompTimeoutSource () : gettimeofday (&tv, 0); mLastTimeout = tv; - pfd.set_fd (ConnectionNumber (screen->dpy ())); - pfd.set_events (Glib::IO_IN); - set_priority (G_PRIORITY_HIGH); attach (screen->priv->ctx); connect (sigc::mem_fun <bool, CompTimeoutSource> (this, &CompTimeoutSource::callback)); @@ -285,12 +282,16 @@ CompTimeoutSource::prepare (int &timeout) if (screen->priv->timers.empty ()) { - add_poll (pfd); - timeout = -1; - return false; + /* This kind of sucks, but we have to do it, considering + * that glib provides us no safe way to remove the source - + * thankfully we shouldn't ever be hitting this case since + * we create the source after we start pingTimer + * and that doesn't stop until compiz does + */ + + timeout = 0; + return true; } - else - remove_poll (pfd); if (screen->priv->timers.front ()->mMinLeft > 0) { diff --git a/src/timer.cpp b/src/timer.cpp index 4a05c27..4f7c2a3 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -139,15 +139,3 @@ CompTimer::active () { return mActive; } - -void -CompTimer::tick () -{ - gettimeofday (&tickStart, 0); -} - -const struct timeval & -CompTimer::tickInfo () const -{ - return tickStart; -} |