mirror of
https://github.com/FelixKratz/SketchyBar
synced 2025-02-16 12:38:26 +00:00
simplify function to generate the window id from a CGEvent
This commit is contained in:
parent
464b5f25cb
commit
61eacaeb45
1 changed files with 1 additions and 15 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue