simplify function to generate the window id from a CGEvent

This commit is contained in:
Felix Kratz 2023-07-04 18:25:46 +02:00
parent 464b5f25cb
commit 61eacaeb45

View file

@ -549,19 +549,5 @@ static inline void error(const char *format, ...) {
}
static inline int get_wid_from_cg_event(CGEventRef event) {
switch (CGEventGetType(event)) {
case kCGEventLeftMouseUp:
case kCGEventRightMouseUp:
case kCGEventOtherMouseUp:
case kCGEventLeftMouseDragged:
case kCGEventRightMouseDragged:
case kCGEventOtherMouseDragged:
return CGEventGetIntegerValueField(event, 0x5b);
case 0x8:
case 0x9:
case kCGEventScrollWheel:
return CGEventGetIntegerValueField(event, 0x33);
default:
return 0;
}
return CGEventGetIntegerValueField(event, 0x33);
}