active CGeventsTap on kCGEventMouseMoved breaks hot corners and dock hiding

Originator:valexa
Number:rdar://10185068 Date Originated:06 Sep 2011
Status:Open Resolved:
Product:Mac OS X Product Version:10.7.1
Classification: Reproducible:Always
 
Summary:

When a active (kCGEventTapOptionDefault) CGEventTap is created for kCGEventMouseMoved the "Hot Corners" Mission Control and the Dock hide/show features no longer work WHILE Finder is the active application (typically clicking on the desktop) AND the mouse movement is a slow one (really fast movements sometimes bypass this issue) 


Steps to Reproduce:

Compile and run a application with this code

CGEventRef tapCallBack(CGEventTapProxy proxy, CGEventType type, CGEventRef event, void* refcon)
{
    return event;
}    

CGEventMask mask = CGEventMaskBit(kCGEventMouseMoved);    
CFMachPortRef eventTap = CGEventTapCreate(kCGAnnotatedSessionEventTap, kCGHeadInsertEventTap, kCGEventTapOptionDefault, mask, tapCallBack, self);
CFRunLoopSourceRef runLoopSource = CFMachPortCreateRunLoopSource(kCFAllocatorDefault, eventTap, 0);
CFRunLoopAddSource([[NSRunLoop currentRunLoop] getCFRunLoop],runLoopSource, kCFRunLoopCommonModes);		
CGEventTapEnable(eventTap, true);
CFRelease(eventTap);		
CFRelease(runLoopSource);  

Click on desktop, move cursor to a corner to trigger a hot corner action or to the edge with the dock to show the dock. 

Expected Results:

The dock is shown/action is triggered.

Actual Results:

The dock is not shown/action is not triggered. 

Regression:

Moving the mouse/pointer pretty fast sometimes sidesteps the issue, also cycling/changing the active application either sidesteps or is a requisite for the issue to happen with no discern-able pattern.

Notes:

Example project attached.

changing kCGAnnotatedSessionEventTap to kCGSessionEventTap or kCGHIDEventTap fixes the bug

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!