Use a timeout for ignoring initial quack access service event

This commit is contained in:
Kovid Goyal 2025-04-25 20:34:54 +05:30
parent 189d78283c
commit 31b74e1c63
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -683,8 +683,8 @@ cocoa_send_notification(PyObject *self UNUSED, PyObject *args, PyObject *kw) {
- (void)quickAccessTerminal:(NSPasteboard *)pboard userData:(NSString *)userData error:(NSString **)error {
// we ignore event during application launch as it will cause the window to be shown and hidden
static bool is_first_event = true;
if (is_first_event) is_first_event = false;
else { call_boss(quick_access_terminal_invoked, NULL) }
if (!is_first_event || monotonic() >= s_double_to_monotonic_t(2.0)) { call_boss(quick_access_terminal_invoked, NULL); }
is_first_event = false;
}
@end