[NSWindow windowNumberAtPoint:mouseDownCoordinates belowWindowWithWindowNumber:0];
Pass mouseDownCoordinates
in, which you would capture through Quartz Event Services . It will return the number of the window the mouse is over. Take this window and make your transition / resize.
Implementation example (mainly from here ):
#import <ApplicationServices/ApplicationServices.h>
void createEventTap(void)
{
CFRunLoopSourceRef runLoopSource;
CGEventMask eventMask = NSLeftMouseDownMask;
eventTap = CGEventTapCreate(kCGSessionEventTap,
kCGHeadInsertEventTap,
kCGEventTapOptionDefault,
eventMask,
myCGEventCallback,
nil);
runLoopSource =
CFMachPortCreateRunLoopSource(kCFAllocatorDefault, eventTap, 0);
CFRunLoopAddSource(CFRunLoopGetCurrent(),
runLoopSource,
kCFRunLoopCommonModes);
CGEventTapEnable(eventTap, true);
}
CGEventRef myCGEventCallback(CGEventTapProxy proxy, CGEventType type, CGEventRef theEvent, void *refcon)
{
if([NSWindow windowNumberAtPoint:CGEventGetLocation(theEvent)
belowWindowWithWindowNumber:0] == myWindowNumber)
{
}
return theEvent;
}
source
share