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

Fixing 2 Bugs. jitouch now works on Ventura. #51

Merged
merged 3 commits into from
Nov 22, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 34 additions & 19 deletions jitouch/Jitouch/Gesture.m
Original file line number Diff line number Diff line change
Expand Up @@ -1199,9 +1199,11 @@ static int gestureTrackpadMoveResize(const Finger *data, int nFingers, double ti
if (step2 == 0) {
if (firstTime) {
getMousePosition(&baseX, &baseY);
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[cursorWindow orderOut:nil];
[pool release];
dispatch_async(dispatch_get_main_queue(), ^{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[cursorWindow orderOut:nil];
[pool release];
supasorn marked this conversation as resolved.
Show resolved Hide resolved
});
if (cWindow == nil)
cWindow = activateWindowAtPosition(baseX, baseY);

Expand All @@ -1211,12 +1213,15 @@ static int gestureTrackpadMoveResize(const Finger *data, int nFingers, double ti
getWindowPos(cWindow, &appX, &appY);

cursorImageType = type - 1;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[cursorWindow display];
setCursorWindowAtMouse();
[cursorWindow setLevel:NSScreenSaverWindowLevel];
[cursorWindow makeKeyAndOrderFront:nil];
[pool release];
dispatch_async(dispatch_get_main_queue(), ^{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[cursorWindow display];
[[cursorWindow contentView] setNeedsDisplay:YES];
setCursorWindowAtMouse();
[cursorWindow setLevel:NSScreenSaverWindowLevel];
[cursorWindow makeKeyAndOrderFront:nil];
[pool release];
aaronkollasch marked this conversation as resolved.
Show resolved Hide resolved
});

moveResizeFlag = 1;
}
Expand All @@ -1230,15 +1235,21 @@ static int gestureTrackpadMoveResize(const Finger *data, int nFingers, double ti
if (nFingers == 1 && !shouldExitMoveResize) {
CGFloat x, y;
getMousePosition(&x, &y);
setCursorWindowAtMouse();
dispatch_async(dispatch_get_main_queue(), ^{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
setCursorWindowAtMouse();
[pool release];
aaronkollasch marked this conversation as resolved.
Show resolved Hide resolved
});
if (type == 1) {
setWindowPos2(cWindow, x, y, baseX, baseY, appX, appY);
} else if (type == 2) {
if (!setWindowSize2(cWindow, x, y, baseX, baseY)) {
type = 0;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[cursorWindow orderOut:nil];
[pool release];
dispatch_async(dispatch_get_main_queue(), ^{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[cursorWindow orderOut:nil];
[pool release];
aaronkollasch marked this conversation as resolved.
Show resolved Hide resolved
});
CFSafeRelease(cWindow);
cWindow = nil;

Expand Down Expand Up @@ -1279,9 +1290,11 @@ static int gestureTrackpadMoveResize(const Finger *data, int nFingers, double ti
type = 0;
CFSafeRelease(cWindow);
cWindow = nil;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[cursorWindow orderOut:nil];
[pool release];
dispatch_async(dispatch_get_main_queue(), ^{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[cursorWindow orderOut:nil];
[pool release];
aaronkollasch marked this conversation as resolved.
Show resolved Hide resolved
});

moveResizeFlag = 0;
//CGEventTapEnable(eventClick, false);
Expand Down Expand Up @@ -1363,9 +1376,11 @@ static int gestureTrackpadMoveResize(const Finger *data, int nFingers, double ti
type = 0;
CFSafeRelease(cWindow);
cWindow = nil;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[cursorWindow orderOut:nil];
[pool release];
dispatch_async(dispatch_get_main_queue(), ^{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[cursorWindow orderOut:nil];
[pool release];
aaronkollasch marked this conversation as resolved.
Show resolved Hide resolved
});

moveResizeFlag = 0;
} else if (data[!min].py < fing[1][1]) {
Expand Down