mirror of
https://github.com/TermiT/Flycut.git
synced 2025-10-01 01:14:26 +08:00
Move pollPBTimer to a run loop and mode that allows it to keep firing while the menu is open.
This commit is contained in:
parent
c125b4de17
commit
5a81af5942
1 changed files with 10 additions and 6 deletions
|
@ -150,11 +150,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build our listener timer
|
// Build our listener timer
|
||||||
pollPBTimer = [[NSTimer scheduledTimerWithTimeInterval:(1.0)
|
NSDate *oneSecondFromNow = [NSDate dateWithTimeIntervalSinceNow:1.0];
|
||||||
target:self
|
pollPBTimer = [[NSTimer alloc] initWithFireDate:oneSecondFromNow
|
||||||
selector:@selector(pollPB:)
|
interval:(1.0)
|
||||||
userInfo:nil
|
target:self
|
||||||
repeats:YES] retain];
|
selector:@selector(pollPB:)
|
||||||
|
userInfo:nil
|
||||||
|
repeats:YES];
|
||||||
|
// Assign it to NSRunLoopCommonModes so that it will still poll while the menu is open. Using a simple NSTimer scheduledTimerWithTimeInterval: would result in polling that stops while the menu is active. In the past this was okay but with Universal Clipboard a new clipping an arrive while the user has the menu open.
|
||||||
|
[[NSRunLoop currentRunLoop] addTimer:pollPBTimer forMode:NSRunLoopCommonModes];
|
||||||
|
|
||||||
// Finish up
|
// Finish up
|
||||||
srTransformer = [[[SRKeyCodeTransformer alloc] init] retain];
|
srTransformer = [[[SRKeyCodeTransformer alloc] init] retain];
|
||||||
|
|
Loading…
Add table
Reference in a new issue