Index: /trunk/Cocoa/AntiRSI/AntiRSI.h
===================================================================
--- /trunk/Cocoa/AntiRSI/AntiRSI.h	(revision 332)
+++ /trunk/Cocoa/AntiRSI/AntiRSI.h	(revision 333)
@@ -87,5 +87,5 @@
     bool reset_session_timer_daily;
     bool reset_session_timer_after;
-    NSDate *reset_session_timer_time;
+    NSCalendarDate *reset_session_timer_time;
     int reset_session_timer_after_hours;
 	
Index: /trunk/Cocoa/AntiRSI/AntiRSI.m
===================================================================
--- /trunk/Cocoa/AntiRSI/AntiRSI.m	(revision 332)
+++ /trunk/Cocoa/AntiRSI/AntiRSI.m	(revision 333)
@@ -26,5 +26,23 @@
 extern CFTimeInterval CGSSecondsSinceLastInputEvent(unsigned long eventType);
 
+static int badge_session_minutes = -1;
+
 @implementation AntiRSI
+
+- (void)computeResetSessionDate;
+{
+    NSCalendarDate *now = [NSCalendarDate calendarDate];
+    NSCalendarDate *reset =
+        [NSCalendarDate dateWithYear:[now yearOfCommonEra]
+                               month:[now monthOfYear]
+                                 day:[now dayOfMonth]
+                                hour:[reset_session_timer_time hourOfDay]
+                              minute:[reset_session_timer_time minuteOfHour]
+                              second:0
+                            timeZone:[NSTimeZone systemTimeZone]];
+    if ([now compare:reset] != NSOrderedAscending)
+        reset = [reset dateByAddingYears:0 months:0 days:1 hours:0 minutes:0 seconds:0];
+    reset_session_date = [reset timeIntervalSinceReferenceDate];
+}
 
 // bindings methods
@@ -53,4 +71,13 @@
 {	work_break_period = 60 * round(f); }
 
+- (void)setReset_session_timer_time:(NSDate *)d;
+{
+    if (reset_session_timer_time != nil)
+        [reset_session_timer_time autorelease];
+    reset_session_timer_time = [[NSCalendarDate alloc] initWithTimeIntervalSinceReferenceDate:[d timeIntervalSinceReferenceDate]];
+    [reset_session_timer_time setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
+    [self computeResetSessionDate];
+}
+
 - (void)installTimer:(double)interval
 {
@@ -103,4 +130,5 @@
 	elapsed=[c retain];
     [dock_badge setBadgeColor:elapsed];
+    badge_session_minutes = -1;
 	[self drawDockImage];
 }
@@ -225,7 +253,4 @@
 	[self bind:@"background" toObject:dc withKeyPath:@"values.background" options:unarchive];
     
-    // watch for timer changes
-    [dc addObserver:self forKeyPath:@"values.reset_session_timer_time" options:0 context:NULL];
-    
 	// alert every binding
 	[dc revert:self];
@@ -236,28 +261,4 @@
 	// about dialog
 	[version setStringValue:[NSString stringWithFormat:@"Version %@", sVersion]]; 
-}
-
-- (void)computeResetSessionDate;
-{
-    NSTimeZone *systemZone = [NSTimeZone systemTimeZone];
-    NSCalendarDate *today = [NSCalendarDate calendarDate];
-    NSCalendarDate *reset = [NSCalendarDate dateWithTimeIntervalSinceReferenceDate:[reset_session_timer_time timeIntervalSinceReferenceDate]];
-    [reset setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
-    reset = [NSCalendarDate dateWithYear:[today yearOfCommonEra]
-                                   month:[today monthOfYear]
-                                     day:[today dayOfMonth]
-                                    hour:[reset hourOfDay]
-                                  minute:[reset minuteOfHour]
-                                  second:0
-                                timeZone:systemZone];
-    if ([today compare:reset] != NSOrderedAscending)
-        reset = [reset dateByAddingYears:0 months:0 days:1 hours:0 minutes:0 seconds:0];
-    reset_session_date = [reset timeIntervalSinceReferenceDate];
-}
-
-- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context;
-{
-    if ([keyPath isEqualToString:@"values.reset_session_timer_time"])
-        [self computeResetSessionDate];
 }
 
@@ -534,5 +535,4 @@
     if (draw_dock_badge) {
         static NSImage *badge = nil;
-        static int badge_session_minutes = -1;
         int session_minutes = (int)session_t / 60;
         if (badge_session_minutes != session_minutes) {
