feedback-assistant / reports

Open collection of Apple Feedback Assistant reports
238 stars 2 forks source link

FB12113281: sometimes event taps created with `CGEvent.tapCreate` stop receiving events #390

Open godbout opened 1 year ago

godbout commented 1 year ago

Description

this is a tricky one. it's been reported by a couple of users of my apps. and it happened to me 3 times over 2.5 years. the last time i was able to confirm that it did not affect only my apps, but any app that is supposed to receive event taps, like Alfred. restarting the computer fixes the issue. but this still seems like a macOS bug overall.

INCHMAN1900 commented 3 months ago

Hi @godbout ! The same thing happened to me this week and it's been annoying.

Here is the pattern in my application:

  1. Register the events with eventsOfInterest: .max on launch
  2. Open another huge application(Affinity Designer 2 in my case)
  3. Keep moving your mouse to trigger the callback

Then there is a chance that the application will never call the callback function registered in CGEvent.tapCreate anymore. Besides this, everything works fine.

godbout commented 3 months ago

@INCHMAN1900 do you mean that you're able to break the event tap whenever you want??? if yes that'd be great to let Apple know because this is a macOS bug. affects any app that use event taps, like Alfred (snippets) etc.

INCHMAN1900 commented 3 months ago

I've create a demo for this issue: CGEventTapCreateBugDemo.zip. It requires a clean launch of Chrome. If you've opened Chrome before, the issue may not appear, while Affinity Designer 2 always breaks the demo.

Things have been really weird these days. When I was creating this demo, I tried to remove the accessibility permission for it while it was running, and suddenly my mac froze, becoming unresponsive to any click/keyboard event. I've to restart the machine to get all back to work again.