summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <Sam@XPS-SUSE.site>2009-03-12 22:27:51 +0900
committerSam Spilsbury <Sam@XPS-SUSE.site>2009-03-12 22:27:51 +0900
commit917c5f45da26fa1a7d57d18a8c98629e704000ff (patch)
tree41a59bd8b7fbdbf6875200166feb47ab1b5261d1
parent3479d686a75d4c54e74f3d02631a2a5121fa5ff4 (diff)
downloadmousepoll-917c5f45da26fa1a7d57d18a8c98629e704000ff.tar.gz
mousepoll-917c5f45da26fa1a7d57d18a8c98629e704000ff.tar.bz2
Check to see if we are active before setting the callback and stop and start if we are
-rw-r--r--mousepoll.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/mousepoll.cpp b/mousepoll.cpp
index 159066f..c09d7c7 100644
--- a/mousepoll.cpp
+++ b/mousepoll.cpp
@@ -112,7 +112,13 @@ MousepollScreen::removeTimer (MousePoller *poller)
void
MousePoller::setCallback (MousePoller::CallBack callback)
{
+ bool wasActive = mActive;
+ if (mActive)
+ stop ();
mCallback = callback;
+
+ if (wasActive)
+ start ();
}
void