]> Dogcows Code - chaz/openbox/blobdiff - src/Timer.cc
make a new autoRaiseDelay value take effect without having to restart
[chaz/openbox] / src / Timer.cc
index 917bc3375a7e22d368d039eed79a0780c670cd9a..8cd4714eb00b14bfaeec07ebd06e1d0fe2a673b1 100644 (file)
@@ -46,6 +46,10 @@ void BTimer::setTimeout(long t) {
   _timeout.tv_usec = t;
   _timeout.tv_usec -= (_timeout.tv_sec * 1000);
   _timeout.tv_usec *= 1000;
+  if (timing) {
+    display.removeTimer(this);
+    display.addTimer(this);     // reorder the display
+  }
 }
 
 void BTimer::setTimeout(timeval t) {
@@ -63,9 +67,11 @@ void BTimer::start(void) {
 }
 
 void BTimer::stop(void) {
-  timing = False;
+  if (timing) {
+    timing = False;
 
-  display.removeTimer(this);
+    display.removeTimer(this);
+  }
 }
 
 void BTimer::fireTimeout(void) {
This page took 0.020981 seconds and 4 git commands to generate.