Index: trunk/Cocoa/AntiRSI/AntiRSI.h
===================================================================
--- trunk/Cocoa/AntiRSI/AntiRSI.h	(revision 345)
+++ trunk/Cocoa/AntiRSI/AntiRSI.h	(revision 346)
@@ -25,23 +25,23 @@
 #define sLatestVersionURL @"http://web.sabi.net/nriley/software/AntiRSI-version.txt"
 #define sURL @"http://web.sabi.net/nriley/software/#antirsi"
-#define sVersion @"1.4njr2"
+#define sVersion @"1.4njr3"
 
 typedef enum _AntiRSIState {
-	s_normal = 0,
-	s_taking_micro_pause,
-	s_taking_work_break,
+    s_normal = 0,
+    s_taking_micro_pause,
+    s_taking_work_break,
 } AntiRSIState;
 
 @interface AntiRSI : NSObject
 {
-	// views to display current status in
-	IBOutlet AntiRSIView *view;
-	IBOutlet NSLevelIndicator *progress;
-	IBOutlet NSButton *postpone;
-	IBOutlet NSTextField *time;
-	IBOutlet NSTextField *next_break;
+    // views to display current status in
+    IBOutlet AntiRSIView *view;
+    IBOutlet NSLevelIndicator *progress;
+    IBOutlet NSButton *postpone;
+    IBOutlet NSTextField *time;
+    IBOutlet NSTextField *next_break;
     IBOutlet NSTextField *session_time;
     IBOutlet NSTextField *status;
-	IBOutlet NSTextField *version; // XXX unused?
+    IBOutlet NSTextField *version; // XXX unused?
     IBOutlet NSDatePicker *reset_session_time;
     
@@ -50,39 +50,39 @@
     IBOutlet NSMenuItem *session_time_item;
     
-	// dock icon image
-	NSImage* dock_image;
-	NSImage* original_dock_image;
+    // dock icon image
+    NSImage* dock_image;
+    NSImage* original_dock_image;
     CTBadge* dock_badge;
 	
-	// window to display the views in
-	NSWindow *main_window;
-	
-	// timer that ticks every second to update
-	NSTimer *mtimer;
-	
-	// various timers
-	double micro_pause_t;
-	double work_break_t;
-	double micro_pause_taking_t;
-	double work_break_taking_t;
-	double work_break_taking_cached_t;
-	double work_break_taking_cached_date;
+    // window to display the views in
+    NSWindow *main_window;
+    
+    // timer that ticks every second to update
+    NSTimer *mtimer;
+    
+    // various timers
+    double micro_pause_t;
+    double work_break_t;
+    double micro_pause_taking_t;
+    double work_break_taking_t;
+    double work_break_taking_cached_t;
+    double work_break_taking_cached_date;
     double session_t;
-	double date;
+    double date;
     double reset_session_date;
 		
-	// various timing lengths
-	int micro_pause_period;
-	int micro_pause_duration;
-	int work_break_period;
-	int work_break_duration;
-	
-	double sample_interval;
-	
-	// verious other options
-	bool lock_focus;
-	bool draw_dock_image;
-	bool draw_dock_badge;
-	bool draw_dock_image_q;
+    // various timing lengths
+    int micro_pause_period;
+    int micro_pause_duration;
+    int work_break_period;
+    int work_break_duration;
+    
+    double sample_interval;
+    
+    // verious other options
+    bool lock_focus;
+    bool draw_dock_image;
+    bool draw_dock_badge;
+    bool draw_dock_image_q;
     bool reset_session_timer_daily;
     bool reset_session_timer_after;
@@ -90,17 +90,17 @@
     int reset_session_timer_after_hours;
 	
-	// various colors
-	NSColor* taking;
-	NSColor* elapsed;
-	NSColor* background;
-	NSColor* darkbackground;
-	
-	// state we are in
-	AntiRSIState state;
-	
-	// history filter
-	double h0;
-	double h1;
-	double h2;
+    // various colors
+    NSColor* taking;
+    NSColor* elapsed;
+    NSColor* background;
+    NSColor* darkbackground;
+    
+    // state we are in
+    AntiRSIState state;
+    
+    // history filter
+    double h0;
+    double h1;
+    double h2;
 }
 
@@ -154,5 +154,2 @@
 
 @end
-
-
-
Index: trunk/Cocoa/AntiRSI/AntiRSI.m
===================================================================
--- trunk/Cocoa/AntiRSI/AntiRSI.m	(revision 345)
+++ trunk/Cocoa/AntiRSI/AntiRSI.m	(revision 346)
@@ -34,11 +34,11 @@
     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]];
+    [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];
@@ -49,9 +49,9 @@
 - (void)setMicro_pause_duration:(float)f
 {
-	micro_pause_duration = round(f);
-	if (s_taking_micro_pause == state) {
-		[progress setMaxValue:micro_pause_duration];
-		[progress setDoubleValue:micro_pause_taking_t];
-	}
+    micro_pause_duration = round(f);
+    if (s_taking_micro_pause == state) {
+	[progress setMaxValue:micro_pause_duration];
+	[progress setDoubleValue:micro_pause_taking_t];
+    }
 }
 
@@ -61,9 +61,9 @@
 - (void)setWork_break_duration:(float)f
 {   
-	work_break_duration = 60 * round(f); 
-	if (s_taking_work_break == state) {
-		[progress setMaxValue:work_break_duration / 60];
-		[progress setDoubleValue:work_break_taking_t / 60 - 0.5];
-	}
+    work_break_duration = 60 * round(f); 
+    if (s_taking_work_break == state) {
+	[progress setMaxValue:work_break_duration / 60];
+	[progress setDoubleValue:work_break_taking_t / 60 - 0.5];
+    }
 }
 
@@ -82,9 +82,9 @@
 - (void)installTimer:(double)interval
 {
-	if (mtimer != nil) {
-		[mtimer invalidate];
-		[mtimer autorelease];
-	}
-	mtimer = [[NSTimer scheduledTimerWithTimeInterval:interval target:self selector:@selector(tick:)
+    if (mtimer != nil) {
+	[mtimer invalidate];
+	[mtimer autorelease];
+    }
+    mtimer = [[NSTimer scheduledTimerWithTimeInterval:interval target:self selector:@selector(tick:)
                                              userInfo:nil repeats:YES] retain];
 }
@@ -92,51 +92,51 @@
 - (void)setSample_interval:(NSString *)s
 {
-	sample_interval = 1;
-	if ([s isEqualToString:@"Super Smooth"]) sample_interval = 0.1;
-	if ([s isEqualToString:@"Smooth"]) sample_interval = 0.33;
-	if ([s isEqualToString:@"Normal"]) sample_interval = 1;
-	if ([s isEqualToString:@"Low"]) sample_interval = 2;
-	
-	[self installTimer:sample_interval];
+    sample_interval = 1;
+    if ([s isEqualToString:@"Super Smooth"]) sample_interval = 0.1;
+    if ([s isEqualToString:@"Smooth"]) sample_interval = 0.33;
+    if ([s isEqualToString:@"Normal"]) sample_interval = 1;
+    if ([s isEqualToString:@"Low"]) sample_interval = 2;
+    
+    [self installTimer:sample_interval];
 }
 
 - (void)setDraw_dock_image:(BOOL)b 
 {
-	draw_dock_image=b;
-	if (!b) {
-		[NSApp setApplicationIconImage:[NSImage imageNamed:@"AntiRSI"]];
-	} else {
-		[self drawDockImage];
-	}
+    draw_dock_image=b;
+    if (!b) {
+	[NSApp setApplicationIconImage:[NSImage imageNamed:@"AntiRSI"]];
+    } else {
+	[self drawDockImage];
+    }
 }
 
 - (void)setBackground:(NSColor *)c
 {
-	[background autorelease];
-	background=[c retain];
-	
-	// make new darkbackground color
-	float r,g,b,a;
-	[background getRed:&r green:&g blue:&b alpha:&a];
-	[darkbackground autorelease];
-	darkbackground=[[NSColor colorWithCalibratedRed:r*0.35 green:g*0.35 blue:b*0.35 alpha:a+0.2] retain];
-	
-	[self drawDockImage];
+    [background autorelease];
+    background=[c retain];
+    
+    // make new darkbackground color
+    float r,g,b,a;
+    [background getRed:&r green:&g blue:&b alpha:&a];
+    [darkbackground autorelease];
+    darkbackground=[[NSColor colorWithCalibratedRed:r*0.35 green:g*0.35 blue:b*0.35 alpha:a+0.2] retain];
+    
+    [self drawDockImage];
 }
 
 - (void)setElapsed:(NSColor *)c
 {
-	[elapsed autorelease];
-	elapsed=[c retain];
+    [elapsed autorelease];
+    elapsed=[c retain];
     [dock_badge setBadgeColor:elapsed];
     badge_session_minutes = -1;
-	[self drawDockImage];
+    [self drawDockImage];
 }
 
 - (void)setTaking:(NSColor *)c
 {
-	[taking autorelease];
-	taking=[c retain];
-	[self drawDockImage];
+    [taking autorelease];
+    taking=[c retain];
+    [self drawDockImage];
 }
 
@@ -145,11 +145,11 @@
 - (void)resetTimers;
 {
-	// set timers to 0
-	micro_pause_t = 0;
-	work_break_t = 0;
-	micro_pause_taking_t = 0;
-	work_break_taking_t = 0;
-	work_break_taking_cached_t = 0;
-	work_break_taking_cached_date = 0;
+    // set timers to 0
+    micro_pause_t = 0;
+    work_break_t = 0;
+    micro_pause_taking_t = 0;
+    work_break_taking_t = 0;
+    work_break_taking_cached_t = 0;
+    work_break_taking_cached_date = 0;
     session_t = 0;
 }
@@ -157,43 +157,43 @@
 - (void)awakeFromNib
 {
-	// want transparancy
-	[NSColor setIgnoresAlpha:NO];
-	
-	// initial colors
-	elapsed = [[NSColor colorWithCalibratedRed:0.3 green:0.3 blue:0.9 alpha:0.95] retain];
-	taking = [[NSColor colorWithCalibratedRed:0.3 green:0.9 blue:0.3 alpha:0.90] retain];
-	background = [NSColor colorWithCalibratedRed:0.9 green:0.9 blue:0.9 alpha:0.7];
-	
-	//initial values
-	micro_pause_period = 4*60;
-	micro_pause_duration = 13;
-	work_break_period = 50*60;
-	work_break_duration = 8*60;
-	sample_interval = 1;
-	
-	// set current state
-	state = s_normal;
+    // want transparancy
+    [NSColor setIgnoresAlpha:NO];
+    
+    // initial colors
+    elapsed = [[NSColor colorWithCalibratedRed:0.3 green:0.3 blue:0.9 alpha:0.95] retain];
+    taking = [[NSColor colorWithCalibratedRed:0.3 green:0.9 blue:0.3 alpha:0.90] retain];
+    background = [NSColor colorWithCalibratedRed:0.9 green:0.9 blue:0.9 alpha:0.7];
+    
+    //initial values
+    micro_pause_period = 4*60;
+    micro_pause_duration = 13;
+    work_break_period = 50*60;
+    work_break_duration = 8*60;
+    sample_interval = 1;
+    
+    // set current state
+    state = s_normal;
     [self resetTimers];
-	
-	// initialize dock image
-	dock_image = [[NSImage alloc] initWithSize:NSMakeSize(128,128)];
-	[dock_image setCacheMode:NSImageCacheNever];
-	original_dock_image = [NSImage imageNamed:@"AntiRSI"];
-	draw_dock_image_q = YES;
+    
+    // initialize dock image
+    dock_image = [[NSImage alloc] initWithSize:NSMakeSize(128,128)];
+    [dock_image setCacheMode:NSImageCacheNever];
+    original_dock_image = [NSImage imageNamed:@"AntiRSI"];
+    draw_dock_image_q = YES;
     dock_badge = [[CTBadge systemBadge] retain];
     [dock_badge setBadgeColor:elapsed];
-	
-	// setup main window that will show either micropause or workbreak
-	main_window = [[NSWindow alloc] initWithContentRect:[view frame]
-											  styleMask:NSBorderlessWindowMask
-												backing:NSBackingStoreBuffered defer:YES];
-	[main_window setBackgroundColor:[NSColor clearColor]];
-	[main_window setLevel:NSStatusWindowLevel];
-	[main_window setAlphaValue:0.85];
-	[main_window setOpaque:NO];
-	[main_window setHasShadow:NO];
-	[main_window setMovableByWindowBackground:YES];
-	[main_window center];
-	[main_window setContentView:view];
+    
+    // setup main window that will show either micropause or workbreak
+    main_window = [[NSWindow alloc] initWithContentRect:[view frame]
+					      styleMask:NSBorderlessWindowMask
+						backing:NSBackingStoreBuffered defer:YES];
+    [main_window setBackgroundColor:[NSColor clearColor]];
+    [main_window setLevel:NSStatusWindowLevel];
+    [main_window setAlphaValue:0.85];
+    [main_window setOpaque:NO];
+    [main_window setHasShadow:NO];
+    [main_window setMovableByWindowBackground:YES];
+    [main_window center];
+    [main_window setContentView:view];
     NSTimeZone *utcZone = [NSTimeZone timeZoneForSecondsFromGMT:0];
     [reset_session_time setTimeZone:utcZone];
@@ -201,64 +201,64 @@
     NSFont *myriad = [NSFont fontWithName: @"Myriad" size: 40];
     if (myriad) [status setFont: myriad];
-	
-	// initialze history filter
-	h0 = 0;
-	h1 = 0;
-	h2 = 0;
-	
-	// initialize ticks
-	date = [NSDate timeIntervalSinceReferenceDate];
-	
-	// set background now
-	[self setBackground:background];
-	
-	// create initial values
-	NSUserDefaultsController *dc = [NSUserDefaultsController sharedUserDefaultsController];
-	NSMutableDictionary* initial = [NSMutableDictionary dictionaryWithObjectsAndKeys:
-        [NSNumber numberWithFloat:4], @"micro_pause_period",
-        [NSNumber numberWithFloat:13], @"micro_pause_duration",
-        [NSNumber numberWithFloat:50], @"work_break_period",
-        [NSNumber numberWithFloat:8], @"work_break_duration",
-        @"Smooth", @"sample_interval",
-        [NSNumber numberWithBool:YES], @"draw_dock_image",
-        [NSNumber numberWithBool:YES], @"draw_dock_badge",
-        [NSNumber numberWithBool:NO], @"lock_focus",
-        [NSNumber numberWithBool:NO], @"reset_session_timer_daily",
-        [NSNumber numberWithBool:NO], @"reset_session_timer_after",
-        [NSCalendarDate dateWithYear:2000 month:1 day:1 hour:6 minute:0 second:0 timeZone:utcZone], @"reset_session_timer_time",
-        [NSNumber numberWithInt:8], @"reset_session_timer_after_hours",
-        [NSArchiver archivedDataWithRootObject:elapsed], @"elapsed",
-        [NSArchiver archivedDataWithRootObject:taking], @"taking",
-        [NSArchiver archivedDataWithRootObject:background], @"background",
-        nil];
+    
+    // initialze history filter
+    h0 = 0;
+    h1 = 0;
+    h2 = 0;
+    
+    // initialize ticks
+    date = [NSDate timeIntervalSinceReferenceDate];
+    
+    // set background now
+    [self setBackground:background];
+    
+    // create initial values
+    NSUserDefaultsController *dc = [NSUserDefaultsController sharedUserDefaultsController];
+    NSMutableDictionary* initial = [NSMutableDictionary dictionaryWithObjectsAndKeys:
+				    [NSNumber numberWithFloat:4], @"micro_pause_period",
+				    [NSNumber numberWithFloat:13], @"micro_pause_duration",
+				    [NSNumber numberWithFloat:50], @"work_break_period",
+				    [NSNumber numberWithFloat:8], @"work_break_duration",
+				    @"Smooth", @"sample_interval",
+				    [NSNumber numberWithBool:YES], @"draw_dock_image",
+				    [NSNumber numberWithBool:YES], @"draw_dock_badge",
+				    [NSNumber numberWithBool:NO], @"lock_focus",
+				    [NSNumber numberWithBool:NO], @"reset_session_timer_daily",
+				    [NSNumber numberWithBool:NO], @"reset_session_timer_after",
+				    [NSCalendarDate dateWithYear:2000 month:1 day:1 hour:6 minute:0 second:0 timeZone:utcZone], @"reset_session_timer_time",
+				    [NSNumber numberWithInt:8], @"reset_session_timer_after_hours",
+				    [NSArchiver archivedDataWithRootObject:elapsed], @"elapsed",
+				    [NSArchiver archivedDataWithRootObject:taking], @"taking",
+				    [NSArchiver archivedDataWithRootObject:background], @"background",
+				    nil];
     [[NSUserDefaults standardUserDefaults] registerDefaults:initial];
-	[dc setInitialValues:initial];
-
-	// bind to defauls controller
-	[self bind:@"micro_pause_period" toObject:dc withKeyPath:@"values.micro_pause_period" options:nil];
-	[self bind:@"micro_pause_duration" toObject:dc withKeyPath:@"values.micro_pause_duration" options:nil];
-	[self bind:@"work_break_period" toObject:dc withKeyPath:@"values.work_break_period" options:nil];
-	[self bind:@"work_break_duration" toObject:dc withKeyPath:@"values.work_break_duration" options:nil];
-	[self bind:@"sample_interval" toObject:dc withKeyPath:@"values.sample_interval" options:nil];
-	[self bind:@"draw_dock_image" toObject:dc withKeyPath:@"values.draw_dock_image" options:nil];
+    [dc setInitialValues:initial];
+    
+    // bind to defauls controller
+    [self bind:@"micro_pause_period" toObject:dc withKeyPath:@"values.micro_pause_period" options:nil];
+    [self bind:@"micro_pause_duration" toObject:dc withKeyPath:@"values.micro_pause_duration" options:nil];
+    [self bind:@"work_break_period" toObject:dc withKeyPath:@"values.work_break_period" options:nil];
+    [self bind:@"work_break_duration" toObject:dc withKeyPath:@"values.work_break_duration" options:nil];
+    [self bind:@"sample_interval" toObject:dc withKeyPath:@"values.sample_interval" options:nil];
+    [self bind:@"draw_dock_image" toObject:dc withKeyPath:@"values.draw_dock_image" options:nil];
     [self bind:@"draw_dock_badge" toObject:dc withKeyPath:@"values.draw_dock_badge" options:nil];
-	[self bind:@"lock_focus" toObject:dc withKeyPath:@"values.lock_focus" options:nil];
+    [self bind:@"lock_focus" toObject:dc withKeyPath:@"values.lock_focus" options:nil];
     [self bind:@"reset_session_timer_daily" toObject:dc withKeyPath:@"values.reset_session_timer_daily" options:nil];
     [self bind:@"reset_session_timer_after" toObject:dc withKeyPath:@"values.reset_session_timer_after" options:nil];
     [self bind:@"reset_session_timer_time" toObject:dc withKeyPath:@"values.reset_session_timer_time" options:nil];
     [self bind:@"reset_session_timer_after_hours" toObject:dc withKeyPath:@"values.reset_session_timer_after_hours" options:nil];
-	NSDictionary* unarchive = [NSDictionary dictionaryWithObject:NSUnarchiveFromDataTransformerName forKey:@"NSValueTransformerName"];
-	[self bind:@"elapsed" toObject:dc withKeyPath:@"values.elapsed" options:unarchive];
-	[self bind:@"taking" toObject:dc withKeyPath:@"values.taking" options:unarchive];
-	[self bind:@"background" toObject:dc withKeyPath:@"values.background" options:unarchive];
-    
-	// alert every binding
-	[dc revert:self];
-
-	// start the timer
-	[self installTimer:sample_interval];
-	
-	// about dialog
-	[version setStringValue:[NSString stringWithFormat:@"Version %@", sVersion]]; 
+    NSDictionary* unarchive = [NSDictionary dictionaryWithObject:NSUnarchiveFromDataTransformerName forKey:@"NSValueTransformerName"];
+    [self bind:@"elapsed" toObject:dc withKeyPath:@"values.elapsed" options:unarchive];
+    [self bind:@"taking" toObject:dc withKeyPath:@"values.taking" options:unarchive];
+    [self bind:@"background" toObject:dc withKeyPath:@"values.background" options:unarchive];
+    
+    // alert every binding
+    [dc revert:self];
+    
+    // start the timer
+    [self installTimer:sample_interval];
+    
+    // about dialog
+    [version setStringValue:[NSString stringWithFormat:@"Version %@", sVersion]]; 
 }
 
@@ -266,9 +266,9 @@
 - (void)tick:(NSTimer *)timer
 {
-	// calculate time since last tick
-	NSTimeInterval new_date = [NSDate timeIntervalSinceReferenceDate];
-	NSTimeInterval tick_time = new_date - date;
-	date = new_date;
-
+    // calculate time since last tick
+    NSTimeInterval new_date = [NSDate timeIntervalSinceReferenceDate];
+    NSTimeInterval tick_time = new_date - date;
+    date = new_date;
+    
     if (reset_session_timer_daily && date >= reset_session_date) {
         [self resetSession:nil];
@@ -277,32 +277,32 @@
     }
     
-	// check if we are still on track of normal time, otherwise we might have slept or something
-	if (tick_time > work_break_duration) {
-		// set timers to 0
-		micro_pause_t = 0;
-		work_break_t = 0;
-		micro_pause_taking_t = micro_pause_duration;
-		work_break_taking_t = work_break_duration;
-		if (s_normal != state) {
-			[self endBreak];
-		}
-		// and do stuff on next tick
-		return;
+    // check if we are still on track of normal time, otherwise we might have slept or something
+    if (tick_time > work_break_duration) {
+	// set timers to 0
+	micro_pause_t = 0;
+	work_break_t = 0;
+	micro_pause_taking_t = micro_pause_duration;
+	work_break_taking_t = work_break_duration;
+	if (s_normal != state) {
+	    [self endBreak];
 	}
-	
-	// just did a whole micropause beyond normal time
-	if (tick_time > micro_pause_duration && s_taking_work_break != state) {
-		// set micro_pause timers to 0
-		micro_pause_t = 0;
-		micro_pause_taking_t = micro_pause_duration;
-		if (s_normal != state) {
-			[self endBreak];
-		}
-		// and do stuff on next tick
-		return;
+	// and do stuff on next tick
+	return;
+    }
+    
+    // just did a whole micropause beyond normal time
+    if (tick_time > micro_pause_duration && s_taking_work_break != state) {
+	// set micro_pause timers to 0
+	micro_pause_t = 0;
+	micro_pause_taking_t = micro_pause_duration;
+	if (s_normal != state) {
+	    [self endBreak];
 	}
-	
-	// get idle time in seconds
-	CFTimeInterval idle_time = CGSSecondsSinceLastInputEvent(kCGAnyInputEventType);
+	// and do stuff on next tick
+	return;
+    }
+    
+    // get idle time in seconds
+    CFTimeInterval idle_time = CGSSecondsSinceLastInputEvent(kCGAnyInputEventType);
     // CFTimeInterval cgs_idle_time = idle_time;
     // from other people's reverse engineering of this function, on MDD G4s this can return a large positive number when input is in progress
@@ -310,5 +310,5 @@
         idle_time = 0;
     } else if (CGEventSourceSecondsSinceLastEventType != NULL) {
-		CGEventType eventTypes[] = { kCGEventLeftMouseDown, kCGEventLeftMouseUp, kCGEventRightMouseDown, kCGEventRightMouseUp, kCGEventMouseMoved, kCGEventLeftMouseDragged, kCGEventRightMouseDragged, kCGEventKeyDown, kCGEventKeyUp, kCGEventFlagsChanged, kCGEventScrollWheel, kCGEventTabletPointer, kCGEventTabletProximity, kCGEventOtherMouseDown, kCGEventOtherMouseUp, kCGEventOtherMouseDragged, kCGEventNull };
+	CGEventType eventTypes[] = { kCGEventLeftMouseDown, kCGEventLeftMouseUp, kCGEventRightMouseDown, kCGEventRightMouseUp, kCGEventMouseMoved, kCGEventLeftMouseDragged, kCGEventRightMouseDragged, kCGEventKeyDown, kCGEventKeyUp, kCGEventFlagsChanged, kCGEventScrollWheel, kCGEventTabletPointer, kCGEventTabletProximity, kCGEventOtherMouseDown, kCGEventOtherMouseUp, kCGEventOtherMouseDragged, kCGEventNull };
         CFTimeInterval event_idle_time;
         idle_time = DBL_MAX;
@@ -325,138 +325,138 @@
     }
     
-	// calculate slack, this gives a sort of 3 history filtered idea.
-	BOOL slack = (h2 + h1 + h0 > 15);
-	
-	// if new event comes in history bumps up
-	if (h0 >= idle_time || idle_time < sample_interval) {
-		h2 = h1;
-		h1 = h0;
-	}
-	h0 = idle_time;
-	
-	switch (state) {
-		case s_normal:
-			// idle_time needs to be at least 0.3 * micro_pause_duration before kicking in
-			// but we cut the user some slack based on previous idle_times
-			if (idle_time <= micro_pause_duration * 0.3 && !slack) {
-				micro_pause_t += tick_time;
-				work_break_t += tick_time;
+    // calculate slack, this gives a sort of 3 history filtered idea.
+    BOOL slack = (h2 + h1 + h0 > 15);
+    
+    // if new event comes in history bumps up
+    if (h0 >= idle_time || idle_time < sample_interval) {
+	h2 = h1;
+	h1 = h0;
+    }
+    h0 = idle_time;
+    
+    switch (state) {
+	case s_normal:
+	    // idle_time needs to be at least 0.3 * micro_pause_duration before kicking in
+	    // but we cut the user some slack based on previous idle_times
+	    if (idle_time <= micro_pause_duration * 0.3 && !slack) {
+		micro_pause_t += tick_time;
+		work_break_t += tick_time;
                 if (idle_time < 1) {
                     session_t += tick_time;
                 }
-				micro_pause_taking_t = 0;
-				if (work_break_taking_t > 0) {
-					work_break_taking_cached_t = work_break_taking_t;
-					work_break_taking_cached_date = date;
-				}
-				work_break_taking_t = 0;
-			} else if (micro_pause_t > 0) {
-			// oke, leaway is over, increase micro_pause_taking_t unless micro_pause is already over
-				//micro_pause_t stays put
-				work_break_t += tick_time;
-				micro_pause_taking_t += tick_time;
-				work_break_taking_t = 0;
-			}
-			
-			// if micro_pause_taking_t is above micro_pause_duration, then micro pause is over, 
-			// if still idleing workbreak_taking_t kicks in unless it is already over
-			if (micro_pause_taking_t >= micro_pause_duration && work_break_t > 0) {
-				work_break_taking_t += tick_time;
-				micro_pause_t = 0;
-			}
-			
-			// if work_break_taking_t is above work_break_duration, then work break is over
-			if (work_break_taking_t >= work_break_duration) {
-				micro_pause_t = 0;
-				work_break_t = 0;
-				// micro_pause_taking_t stays put
-				// work_break_taking_t stays put
-			}
-		
-			// if user needs to take a micro pause
-			if (micro_pause_t >= micro_pause_period) {
-				// anticipate next workbreak by not issuing this micro_pause ...
-				if (work_break_t > work_break_period - (micro_pause_period / 2)) {
-					work_break_t = work_break_period;
-					[self doWorkBreak];
-				} else {
-					[self doMicroPause];
-				}
-			}
-			
-			// if user needs to take a work break
-			if (work_break_t >= work_break_period) {
-				// stop micro_pause stuff
-				micro_pause_t = 0;
-				micro_pause_taking_t = micro_pause_duration;
-				// and display window
-				[self doWorkBreak];
-			}
-		break;
-
-		// taking a micro pause with window
-		case s_taking_micro_pause:
-			// continue updating timers
-			micro_pause_taking_t += tick_time;
-			work_break_t += tick_time;
-			
-			// if we don't break, or interrupt the break, reset it
-			if (idle_time < 1 && !slack) {
-				micro_pause_taking_t = 0;
+		micro_pause_taking_t = 0;
+		if (work_break_taking_t > 0) {
+		    work_break_taking_cached_t = work_break_taking_t;
+		    work_break_taking_cached_date = date;
+		}
+		work_break_taking_t = 0;
+	    } else if (micro_pause_t > 0) {
+		// oke, leaway is over, increase micro_pause_taking_t unless micro_pause is already over
+		//micro_pause_t stays put
+		work_break_t += tick_time;
+		micro_pause_taking_t += tick_time;
+		work_break_taking_t = 0;
+	    }
+	    
+	    // if micro_pause_taking_t is above micro_pause_duration, then micro pause is over, 
+	    // if still idleing workbreak_taking_t kicks in unless it is already over
+	    if (micro_pause_taking_t >= micro_pause_duration && work_break_t > 0) {
+		work_break_taking_t += tick_time;
+		micro_pause_t = 0;
+	    }
+	    
+	    // if work_break_taking_t is above work_break_duration, then work break is over
+	    if (work_break_taking_t >= work_break_duration) {
+		micro_pause_t = 0;
+		work_break_t = 0;
+		// micro_pause_taking_t stays put
+		// work_break_taking_t stays put
+	    }
+	    
+	    // if user needs to take a micro pause
+	    if (micro_pause_t >= micro_pause_period) {
+		// anticipate next workbreak by not issuing this micro_pause ...
+		if (work_break_t > work_break_period - (micro_pause_period / 2)) {
+		    work_break_t = work_break_period;
+		    [self doWorkBreak];
+		} else {
+		    [self doMicroPause];
+		}
+	    }
+	    
+	    // if user needs to take a work break
+	    if (work_break_t >= work_break_period) {
+		// stop micro_pause stuff
+		micro_pause_t = 0;
+		micro_pause_taking_t = micro_pause_duration;
+		// and display window
+		[self doWorkBreak];
+	    }
+	    break;
+	    
+	    // taking a micro pause with window
+	    case s_taking_micro_pause:
+	    // continue updating timers
+	    micro_pause_taking_t += tick_time;
+	    work_break_t += tick_time;
+	    
+	    // if we don't break, or interrupt the break, reset it
+	    if (idle_time < 1 && !slack) {
+		micro_pause_taking_t = 0;
                 session_t += tick_time;
-			}
-				
-			// update window
+	    }
+	    
+	    // update window
             [self updateBreakWindowDuration:micro_pause_duration progress:micro_pause_taking_t
                                   nextBreak:work_break_period - work_break_t];
-
-			// check if we done enough
-			if (micro_pause_taking_t > micro_pause_duration) {
-				micro_pause_t = 0;
-				[self endBreak];
-			}
-		
-			// if workbreak must be run ...
-			if (work_break_t >= work_break_period) {
-				// stop micro_pause stuff
-				micro_pause_t = 0;
-				micro_pause_taking_t = micro_pause_duration;
-				// and display window
-				[self doWorkBreak];
-			} else {
+	    
+	    // check if we done enough
+	    if (micro_pause_taking_t > micro_pause_duration) {
+		micro_pause_t = 0;
+		[self endBreak];
+	    }
+	    
+	    // if workbreak must be run ...
+	    if (work_break_t >= work_break_period) {
+		// stop micro_pause stuff
+		micro_pause_t = 0;
+		micro_pause_taking_t = micro_pause_duration;
+		// and display window
+		[self doWorkBreak];
+	    } else {
                 double slip = (micro_pause_duration - micro_pause_taking_t) - (int)(micro_pause_duration - micro_pause_taking_t);
                 [self installTimer: slip < 0.1 ? 1 : slip];
             }
-			break;
-		
-		// taking a work break with window
-		case s_taking_work_break:
-			// increase work_break_taking_t
-			if (idle_time >= 2 || work_break_taking_t < 3) {
-				work_break_taking_t += tick_time;
-			} else if (idle_time < 1) {
+	    break;
+	    
+	    // taking a work break with window
+	    case s_taking_work_break:
+	    // increase work_break_taking_t
+	    if (idle_time >= 2 || work_break_taking_t < 3) {
+		work_break_taking_t += tick_time;
+	    } else if (idle_time < 1) {
                 session_t += tick_time;
             }
-			
-			// draw window
+	    
+	    // draw window
             [self updateBreakWindowDuration:work_break_duration progress:work_break_taking_t
                                   nextBreak:work_break_period + work_break_duration - work_break_taking_t];
-
-			// and check if we done enough
-			if (work_break_taking_t > work_break_duration) {
-				micro_pause_t = 0;
-				micro_pause_taking_t = micro_pause_duration;
-				work_break_t = 0;
-				work_break_taking_t = work_break_duration;
-				[self endBreak];
-			} else {
+	    
+	    // and check if we done enough
+	    if (work_break_taking_t > work_break_duration) {
+		micro_pause_t = 0;
+		micro_pause_taking_t = micro_pause_duration;
+		work_break_t = 0;
+		work_break_taking_t = work_break_duration;
+		[self endBreak];
+	    } else {
                 double slip = (work_break_duration - work_break_taking_t) - (int)(work_break_duration - work_break_taking_t);
                 [self installTimer: slip < 0.1 ? 1 : slip];
             }
-			break;
-	}
-	
-	// draw dock image
-	if (draw_dock_image) [self drawDockImage];
+	    break;
+    }
+    
+    // draw dock image
+    if (draw_dock_image) [self drawDockImage];
 }
 
@@ -471,65 +471,65 @@
 - (void)drawDockImage
 {
-	[dock_image lockFocus];
-	
-	// clear all
-	[[NSColor clearColor] set];  
-	NSRectFill(NSMakeRect(0,0,127,127));
-	
-	NSBezierPath* p;
-	float end;
-	
-	//draw background circle
-	[darkbackground set];
-	p =[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(6,6,115,115)];
-	[p setLineWidth:4];
-	[p stroke];
-	
-	//fill
-	[background set];
-	[[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(8,8,111,111)] fill];
-	
-	//put dot in middle
-	[darkbackground set];
-	[[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(59,59,9,9)] fill];
-
-	// reuse this one
-	p = [NSBezierPath bezierPath];
-
-	// draw work_break
-	[elapsed set];
-	end = 360 - (360.0 / work_break_period * work_break_t - 90);
-	if (end <= 90) end=90.1;
-	[p appendBezierPathWithArcWithCenter:NSMakePoint(63.5, 63.5) radius:40 startAngle:90 endAngle:end clockwise:YES];
-	[p setLineWidth:22];
-	[p stroke];
-	
-	// draw work break taking
-	[taking set];
-	[p removeAllPoints];
-	end = 360 - (360.0 / work_break_duration * work_break_taking_t - 90);
-	if (end <= 90) end=90.1;
-	[p appendBezierPathWithArcWithCenter:NSMakePoint(63.5, 63.5) radius:40 startAngle:90 endAngle:end clockwise:YES];
-	[p setLineWidth:18];
-	[p stroke];
-	
-	// draw micro pause
-	[elapsed set];
-	[p removeAllPoints];
-	end = 360 - (360.0 / micro_pause_period * micro_pause_t - 90);
-	if (end <= 90) end = 90.1;
-	[p appendBezierPathWithArcWithCenter:NSMakePoint(63.5, 63.5) radius:17 startAngle:90 endAngle:end clockwise:YES];
-	[p setLineWidth:22];
-	[p stroke];
-	
-	// draw micro pause taking
-	[taking set];
-	[p removeAllPoints];
-	end = 360 - (360.0 / micro_pause_duration * micro_pause_taking_t - 90);
-	if (end <= 90) end = 90.1;
-	[p appendBezierPathWithArcWithCenter:NSMakePoint(63.5, 63.5) radius:17 startAngle:90 endAngle:end clockwise:YES];
-	[p setLineWidth:18];
-	[p stroke];
-	
+    [dock_image lockFocus];
+    
+    // clear all
+    [[NSColor clearColor] set];  
+    NSRectFill(NSMakeRect(0,0,127,127));
+    
+    NSBezierPath* p;
+    float end;
+    
+    //draw background circle
+    [darkbackground set];
+    p =[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(6,6,115,115)];
+    [p setLineWidth:4];
+    [p stroke];
+    
+    //fill
+    [background set];
+    [[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(8,8,111,111)] fill];
+    
+    //put dot in middle
+    [darkbackground set];
+    [[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(59,59,9,9)] fill];
+    
+    // reuse this one
+    p = [NSBezierPath bezierPath];
+    
+    // draw work_break
+    [elapsed set];
+    end = 360 - (360.0 / work_break_period * work_break_t - 90);
+    if (end <= 90) end=90.1;
+    [p appendBezierPathWithArcWithCenter:NSMakePoint(63.5, 63.5) radius:40 startAngle:90 endAngle:end clockwise:YES];
+    [p setLineWidth:22];
+    [p stroke];
+    
+    // draw work break taking
+    [taking set];
+    [p removeAllPoints];
+    end = 360 - (360.0 / work_break_duration * work_break_taking_t - 90);
+    if (end <= 90) end=90.1;
+    [p appendBezierPathWithArcWithCenter:NSMakePoint(63.5, 63.5) radius:40 startAngle:90 endAngle:end clockwise:YES];
+    [p setLineWidth:18];
+    [p stroke];
+    
+    // draw micro pause
+    [elapsed set];
+    [p removeAllPoints];
+    end = 360 - (360.0 / micro_pause_period * micro_pause_t - 90);
+    if (end <= 90) end = 90.1;
+    [p appendBezierPathWithArcWithCenter:NSMakePoint(63.5, 63.5) radius:17 startAngle:90 endAngle:end clockwise:YES];
+    [p setLineWidth:22];
+    [p stroke];
+    
+    // draw micro pause taking
+    [taking set];
+    [p removeAllPoints];
+    end = 360 - (360.0 / micro_pause_duration * micro_pause_taking_t - 90);
+    if (end <= 90) end = 90.1;
+    [p appendBezierPathWithArcWithCenter:NSMakePoint(63.5, 63.5) radius:17 startAngle:90 endAngle:end clockwise:YES];
+    [p setLineWidth:18];
+    [p stroke];
+    
     // draw session time
     if (draw_dock_badge) {
@@ -544,8 +544,8 @@
     }
     
-	[dock_image unlockFocus];
-
-	// and set it in the dock check draw_dock_image one last time ...
-	if (draw_dock_image_q) [NSApp setApplicationIconImage:dock_image];
+    [dock_image unlockFocus];
+    
+    // and set it in the dock check draw_dock_image one last time ...
+    if (draw_dock_image_q) [NSApp setApplicationIconImage:dock_image];
 }
 
@@ -553,8 +553,8 @@
 - (void)endBreak
 {
-	[main_window orderOut:NULL];
-	state = s_normal;
-	// reset time interval to user's choice
-	[self installTimer:sample_interval];
+    [main_window orderOut:NULL];
+    state = s_normal;
+    // reset time interval to user's choice
+    [self installTimer:sample_interval];
 }
 
@@ -562,15 +562,15 @@
 - (void)doMicroPause
 {
-	micro_pause_taking_t = 0;
-	[status setStringValue:@"Micro Pause"];
-	[progress setMaxValue:micro_pause_duration];
-	[progress setDoubleValue:micro_pause_taking_t];
+    micro_pause_taking_t = 0;
+    [status setStringValue:@"Micro Pause"];
+    [progress setMaxValue:micro_pause_duration];
+    [progress setDoubleValue:micro_pause_taking_t];
     [progress setWarningValue: 1];
     [progress setCriticalValue: micro_pause_duration];
-	[postpone setHidden:YES];
-	state = s_taking_micro_pause;
-	[self tick: nil];
-	[main_window center];
-	[main_window orderFrontRegardless];
+    [postpone setHidden:YES];
+    state = s_taking_micro_pause;
+    [self tick: nil];
+    [main_window center];
+    [main_window orderFrontRegardless];
 }
 
@@ -578,20 +578,20 @@
 - (void)doWorkBreak
 {
-	work_break_taking_t = 0;
-	// incase you were already having an implicit work break and clicked the take work break now button
-	// not more then 20 seconds ago we took a natural break longer then 0.2 * normal work break duration 
-	if (date - work_break_taking_cached_date < 20 && work_break_taking_cached_t > work_break_duration * 0.2) {
-		work_break_taking_t = work_break_taking_cached_t;
-	} 
-	[status setStringValue:@"Work Break"];
-	[progress setMaxValue:work_break_duration / 60];
-	[progress setDoubleValue:work_break_taking_t / 60 - 0.5];
+    work_break_taking_t = 0;
+    // incase you were already having an implicit work break and clicked the take work break now button
+    // not more then 20 seconds ago we took a natural break longer then 0.2 * normal work break duration 
+    if (date - work_break_taking_cached_date < 20 && work_break_taking_cached_t > work_break_duration * 0.2) {
+	work_break_taking_t = work_break_taking_cached_t;
+    } 
+    [status setStringValue:@"Work Break"];
+    [progress setMaxValue:work_break_duration / 60];
+    [progress setDoubleValue:work_break_taking_t / 60 - 0.5];
     [progress setWarningValue: 0];
     [progress setCriticalValue: 0.4];
-	[postpone setHidden:NO];
-	state = s_taking_work_break;
+    [postpone setHidden:NO];
+    state = s_taking_work_break;
     [self tick: nil];
-	[main_window center];
-	[main_window orderFrontRegardless];
+    [main_window center];
+    [main_window orderFrontRegardless];
 }
 
@@ -599,5 +599,5 @@
 {
     return [NSString stringWithFormat:@"Session: %d:%02d:%02d", (int)session_t / 3600,
-        ((int)session_t / 60) % 60, lrint(session_t) % 60];
+	    ((int)session_t / 60) % 60, lrint(session_t) % 60];
 }
 
@@ -609,5 +609,5 @@
     // time left
     double timeLeft = duration - progress_t;
-	[time setStringValue:[NSString stringWithFormat:@"%d:%02d", (int)timeLeft / 60, lrint(timeLeft) % 60]];
+    [time setStringValue:[NSString stringWithFormat:@"%d:%02d", (int)timeLeft / 60, lrint(timeLeft) % 60]];
     
     // cumulative typing time in this session (e.g. today)
@@ -615,14 +615,14 @@
     
     // next break
-	int minutes = round(nextBreak / 60.0);
-	
-	// nice hours, minutes ... 
-	if (minutes > 60) {
-		[next_break setStringValue:[NSString stringWithFormat:@"next break in %d:%02d hours", 
-			minutes / 60, minutes % 60]];
-	} else {
-		[next_break setStringValue:[NSString stringWithFormat:@"next break in %d minutes", minutes]];
-	}
-
+    int minutes = round(nextBreak / 60.0);
+    
+    // nice hours, minutes ... 
+    if (minutes > 60) {
+	[next_break setStringValue:[NSString stringWithFormat:@"next break in %d:%02d hours", 
+				    minutes / 60, minutes % 60]];
+    } else {
+	[next_break setStringValue:[NSString stringWithFormat:@"next break in %d minutes", minutes]];
+    }
+    
     // if user likes to be interrupted
     if (lock_focus) {
@@ -635,5 +635,5 @@
 - (IBAction)gotoWebsite:(id)sender
 {
-	[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:sURL]];
+    [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:sURL]];
 }
 
@@ -641,28 +641,28 @@
 - (IBAction)checkForUpdate:(id)sender
 {
-	NSString *latest_version =
-	[NSString stringWithContentsOfURL: [NSURL URLWithString:sLatestVersionURL]];
-	
-	if (latest_version == Nil) latest_version = @"";
-	latest_version = [latest_version stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
-	
-	if ([latest_version length] == 0) {
-		NSRunInformationalAlertPanel(
-			@"Unable to Determine",
-			@"Unable to determine the latest AntiRSI version number.",
-			@"Ok", nil, nil);
-	} else if ([latest_version compare:sVersion] == NSOrderedDescending) {
-		int r = NSRunInformationalAlertPanel(
-			@"New Version",
-			[NSString stringWithFormat:@"A new version (%@) of AntiRSI is available; would you like to go to the website now?", latest_version],
-			@"Goto Website", @"Cancel", nil);
-		if (r == NSOKButton) {
-			[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:sURL]];
-		}
+    NSString *latest_version =
+    [NSString stringWithContentsOfURL: [NSURL URLWithString:sLatestVersionURL]];
+    
+    if (latest_version == Nil) latest_version = @"";
+    latest_version = [latest_version stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
+    
+    if ([latest_version length] == 0) {
+	NSRunInformationalAlertPanel(
+	     @"Unable to Determine",
+	     @"Unable to determine the latest AntiRSI version number.",
+	     @"Ok", nil, nil);
+    } else if ([latest_version compare:sVersion] == NSOrderedDescending) {
+	int r = NSRunInformationalAlertPanel(
+	     @"New Version",
+	     [NSString stringWithFormat:@"A new version (%@) of AntiRSI is available; would you like to go to the website now?", latest_version],
+	     @"Goto Website", @"Cancel", nil);
+	if (r == NSOKButton) {
+	    [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:sURL]];
+	}
     } else {
     	NSRunInformationalAlertPanel(
-			@"No Update Available", 
-			@"This is the latest version of AntiRSI.", 
-			@"OK", nil, nil);
+	     @"No Update Available", 
+	     @"This is the latest version of AntiRSI.", 
+	     @"OK", nil, nil);
     }
 }
@@ -671,18 +671,18 @@
 - (IBAction)postpone:(id)sender
 {
-	if (s_taking_work_break == state) {
-		micro_pause_t = 0;
-		micro_pause_taking_t = 0;
-		work_break_taking_t = 0;
-		work_break_taking_cached_t = 0;
-		work_break_t -= 10*60; // decrease with 10 minutes
-		if (work_break_t < 0) work_break_t = 0;
-		[self endBreak];
-	}
+    if (s_taking_work_break == state) {
+	micro_pause_t = 0;
+	micro_pause_taking_t = 0;
+	work_break_taking_t = 0;
+	work_break_taking_cached_t = 0;
+	work_break_t -= 10*60; // decrease with 10 minutes
+	if (work_break_t < 0) work_break_t = 0;
+	[self endBreak];
+    }
 }
 
 - (IBAction)breakNow:(id)sender
 {
-	[self doWorkBreak];
+    [self doWorkBreak];
 }
 
@@ -698,20 +698,20 @@
 - (BOOL)validateMenuItem:(NSMenuItem *)anItem
 {
-	if ([anItem action] == @selector(breakNow:) && state == s_normal)
-		return YES;
-	
-	if ([anItem action] == @selector(postpone:) && state == s_taking_work_break)
-		return YES;
-
+    if ([anItem action] == @selector(breakNow:) && state == s_normal)
+	return YES;
+    
+    if ([anItem action] == @selector(postpone:) && state == s_taking_work_break)
+	return YES;
+    
     if ([anItem action] == @selector(resetSession:))
-		return YES;
-
-	if ([anItem action] == @selector(gotoWebsite:))
-		return YES;
-
+	return YES;
+    
+    if ([anItem action] == @selector(gotoWebsite:))
+	return YES;
+    
     if ([anItem action] == @selector(checkForUpdate:))
-		return YES;
-
-	return NO;
+	return YES;
+    
+    return NO;
 }
 
@@ -719,17 +719,17 @@
 - (void)applicationWillTerminate:(NSNotification *)aNotification
 {
-	// make sure timer doesn't tick once more ...
-	draw_dock_image_q = NO;
-	[mtimer invalidate];
-	[mtimer autorelease];
-	mtimer = nil;
-	[dock_image release];
-	// stupid fix for icon beeing restored ... it is not my fault,
-	// the dock or NSImage or setApplicationIconImage seem to be caching or taking
-	// snapshot or something ... !
-	[NSApp setApplicationIconImage:original_dock_image];
-	[NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
-	[NSApp setApplicationIconImage:original_dock_image];
-
+    // make sure timer doesn't tick once more ...
+    draw_dock_image_q = NO;
+    [mtimer invalidate];
+    [mtimer autorelease];
+    mtimer = nil;
+    [dock_image release];
+    // stupid fix for icon beeing restored ... it is not my fault,
+    // the dock or NSImage or setApplicationIconImage seem to be caching or taking
+    // snapshot or something ... !
+    [NSApp setApplicationIconImage:original_dock_image];
+    [NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
+    [NSApp setApplicationIconImage:original_dock_image];
+    
 }
 
Index: trunk/Cocoa/AntiRSI/AntiRSI.xcodeproj/project.pbxproj
===================================================================
--- trunk/Cocoa/AntiRSI/AntiRSI.xcodeproj/project.pbxproj	(revision 345)
+++ trunk/Cocoa/AntiRSI/AntiRSI.xcodeproj/project.pbxproj	(revision 346)
@@ -48,5 +48,5 @@
 		464D9B780C6A760B005A0582 /* CTBadge_5.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = CTBadge_5.pdf; sourceTree = "<group>"; };
 		4DB6164C061B59EA002EF355 /* AntiRSI.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AntiRSI.h; sourceTree = "<group>"; };
-		4DB6164D061B59EA002EF355 /* AntiRSI.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = AntiRSI.m; sourceTree = "<group>"; wrapsLines = 1; };
+		4DB6164D061B59EA002EF355 /* AntiRSI.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = AntiRSI.m; sourceTree = "<group>"; tabWidth = 8; wrapsLines = 1; };
 		4DF73F65061E136200B0D9C9 /* AntiRSIView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = AntiRSIView.m; sourceTree = "<group>"; };
 		4DF73F66061E136200B0D9C9 /* AntiRSIView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AntiRSIView.h; sourceTree = "<group>"; };
@@ -221,4 +221,5 @@
 			isa = PBXProject;
 			buildConfigurationList = E1203B7F0894152100759E75 /* Build configuration list for PBXProject "AntiRSI" */;
+			compatibilityVersion = "Xcode 2.4";
 			hasScannedForEncodings = 1;
 			knownRegions = (
@@ -231,4 +232,5 @@
 			mainGroup = 29B97314FDCFA39411CA2CEA /* AntiRSI */;
 			projectDirPath = "";
+			projectRoot = "";
 			targets = (
 				8D1107260486CEB800E47090 /* AntiRSI */,
Index: trunk/Cocoa/AntiRSI/AntiRSIView.m
===================================================================
--- trunk/Cocoa/AntiRSI/AntiRSIView.m	(revision 345)
+++ trunk/Cocoa/AntiRSI/AntiRSIView.m	(revision 346)
@@ -35,7 +35,7 @@
     float radius = 25.0; // correct value to duplicate Panther's App Switcher
     NSBezierPath *bgPath = [NSBezierPath bezierPath];
-
+    
     /* XXX from Casey Marshall's version; does it help with the hole-in-window problem? */
-	[[NSColor clearColor] set];
+    [[NSColor clearColor] set];
     NSRectFill(bgRect);
     /* XXX end */
Index: trunk/Cocoa/AntiRSI/Info.plist
===================================================================
--- trunk/Cocoa/AntiRSI/Info.plist	(revision 345)
+++ trunk/Cocoa/AntiRSI/Info.plist	(revision 346)
@@ -18,5 +18,5 @@
 	<string>ONNE</string>
 	<key>CFBundleVersion</key>
-	<string>1.4njr2</string>
+	<string>1.4njr3</string>
 	<key>NSMainNibFile</key>
 	<string>MainMenu</string>
