mac: some fixes
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good

This commit is contained in:
IoI_xD 2026-03-12 01:10:45 -07:00
commit db5f0ed40a

View file

@ -372,15 +372,6 @@ static NSPoint pointFlip(NSPoint point) {
} }
switch ([ev type]) { switch ([ev type]) {
case NSLeftMouseDown:
case NSRightMouseDown:
case NSOtherMouseDown:
case NSLeftMouseUp:
case NSRightMouseUp:
case NSOtherMouseUp: {
[self handleMouseEvent:ev ll:h];
break;
}
case NSLeftMouseDragged: case NSLeftMouseDragged:
case NSRightMouseDragged: case NSRightMouseDragged:
case NSOtherMouseDragged: case NSOtherMouseDragged:
@ -390,8 +381,18 @@ static NSPoint pointFlip(NSPoint point) {
pos.x = pos_translated.x; pos.x = pos_translated.x;
pos.y = pos_translated.y; pos.y = pos_translated.y;
MwLLDispatch(h, move, &pos); MwLLDispatch(h, move, &pos);
// break;
}
case NSLeftMouseDown:
case NSRightMouseDown:
case NSOtherMouseDown:
case NSLeftMouseUp:
case NSRightMouseUp:
case NSOtherMouseUp: {
[self handleMouseEvent:ev ll:h];
break; break;
} }
case NSMouseEntered: case NSMouseEntered:
MwLLDispatch(h, focus_in, NULL); MwLLDispatch(h, focus_in, NULL);
[self->cursor push]; [self->cursor push];
@ -412,9 +413,6 @@ static NSPoint pointFlip(NSPoint point) {
break; break;
default: default:
/* mute bizarre "unknown subtype" errors that flood the console */ /* mute bizarre "unknown subtype" errors that flood the console */
if (ev.subtype > 8) {
doSendEvent = false;
}
break; break;
}; };
if (doSendEvent) { if (doSendEvent) {
@ -426,22 +424,27 @@ static NSPoint pointFlip(NSPoint point) {
- (void)handleMouseEvent:(NSEvent *)ev ll:(MwLL)ll { - (void)handleMouseEvent:(NSEvent *)ev ll:(MwLL)ll {
MwLLMouse mouse; MwLLMouse mouse;
MwBool isDown = MwTRUE; MwBool isDown = MwTRUE;
NSPoint mousePoint = pointFlip([ev locationInWindow]); NSPoint mousePoint = [ev locationInWindow];
mousePoint.y = [[ev window] frame].size.height - mousePoint.y;
MwLL this = [self->handle pointer]; MwLL this = [self->handle pointer];
switch ([ev type]) { switch ([ev type]) {
case NSLeftMouseUp: case NSLeftMouseUp:
isDown = MwFALSE; isDown = MwFALSE;
case NSEventTypeLeftMouseDragged:
case NSLeftMouseDown: case NSLeftMouseDown:
mouse.button = MwLLMouseLeft; mouse.button = MwLLMouseLeft;
break; break;
case NSRightMouseUp: case NSRightMouseUp:
isDown = MwFALSE; isDown = MwFALSE;
case NSRightMouseDown: case NSRightMouseDown:
case NSEventTypeRightMouseDragged:
mouse.button = MwLLMouseRight; mouse.button = MwLLMouseRight;
break; break;
case NSOtherMouseUp: case NSOtherMouseUp:
isDown = MwFALSE; isDown = MwFALSE;
case NSOtherMouseDown: case NSOtherMouseDown:
case NSEventTypeOtherMouseDragged:
mouse.button = MwLLMouseMiddle; mouse.button = MwLLMouseMiddle;
break; break;
default: default: