From e632ea630d3c46245c8a3da9a17f9af54cea19bf Mon Sep 17 00:00:00 2001 From: IndrekV Date: Mon, 14 May 2018 12:17:07 +0300 Subject: [PATCH] Don't overwrite description when pasting to timer input field (mac), closes #2447 --- src/ui/osx/TogglDesktop/test2/AppDelegate.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ui/osx/TogglDesktop/test2/AppDelegate.m b/src/ui/osx/TogglDesktop/test2/AppDelegate.m index bc6202b478..7c1f34d385 100644 --- a/src/ui/osx/TogglDesktop/test2/AppDelegate.m +++ b/src/ui/osx/TogglDesktop/test2/AppDelegate.m @@ -1277,10 +1277,15 @@ - (id)init { NSString *character = [theEvent charactersIgnoringModifiers]; NSString *windowName = [NSApp orderedWindows][0].frameAutosaveName; + + NSResponder *currentFirstResponder = [self.mainWindowController.window firstResponder]; + BOOL timerFocused = [currentFirstResponder isKindOfClass:[NSTextView class]]; + // Execute only if edit view is not opened and focus is on main window if ([character isEqualToString:@"v"] && ![self.mainWindowController isEditOpened] - && [windowName isEqualToString:@"MainWindow"]) + && [windowName isEqualToString:@"MainWindow"] + && !timerFocused) { if (self.lastKnownRunningTimeEntry == nil || self.lastKnownRunningTimeEntry.duration_in_seconds < 0) {