Skip to content

Commit

Permalink
Use an Event to wake up main loop to redisplay clock
Browse files Browse the repository at this point in the history
  • Loading branch information
mszoek committed Jul 3, 2022
1 parent 6add883 commit 722edcc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CoreServices/WindowServer/SystemUIServer/MenuBarWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ @implementation MenuBarWindow
- (void)notifyTick:(id)arg {
NSString *value = [clockView currentDateValue];
[clockView setStringValue:value];
[clockView display];
[clockView setNeedsDisplay:YES];
NSEvent *event =[[NSEvent alloc] initWithType:NSAppKitSystem location:NSMakePoint(0,0) modifierFlags:0 window:nil];
[NSApp postEvent:event atStart:YES];
}

- (mach_port_t)activePort {
Expand Down

0 comments on commit 722edcc

Please sign in to comment.