Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't restart the app #46

Merged
merged 7 commits into from
Jan 3, 2023
Merged

Don't restart the app #46

merged 7 commits into from
Jan 3, 2023

Conversation

artginzburg
Copy link
Owner

#45

@artginzburg artginzburg added enhancement New feature or request help wanted Extra attention is needed labels Sep 1, 2022

// Enable the event tap.
CGEventTapEnable(eventTap, true);
[self registerMouseCallback:pool];
Copy link

@ris58h ris58h Sep 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do

  NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
  [NSApplication sharedApplication];

and

registerTouchCallback();

above, so could we just call startUnstableListeners instead?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems possible, but I don't want to mess with the autorelease pool. Since I'm not sure how to measure its effect, I won't be aware if it doesn't work correctly.

P.S. Probably broke it already tbh, never seen a pool passed as a method parameter.

@@ -291,18 +348,11 @@ int touchCallback(int device, Finger* data, int nFingers, double timestamp,
}

/// Relaunch the app when devices are connected/invalidated.
static void restartApp()
- (void)restartApp
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we rename it because we don't restart the app anymore?

@artginzburg artginzburg mentioned this pull request Sep 1, 2022
@artginzburg artginzburg linked an issue Sep 4, 2022 that may be closed by this pull request
@artginzburg artginzburg merged commit 2efc2e4 into main Jan 3, 2023
@artginzburg artginzburg deleted the beta branch January 3, 2023 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't restart the app
2 participants