struct frame *f = NULL;
struct ns_display_info *dpyinfo;
bool return_no_frame_flag = false;
+#ifdef NS_IMPL_COCOA
+ NSPoint screen_position;
+ NSInteger window_number;
+ NSWindow *w;
+#endif
NSTRACE ("ns_mouse_position");
This doesn't work on GNUstep, although in recent versions there
is compatibility code that makes it a noop. */
- NSPoint screen_position = [NSEvent mouseLocation];
- NSInteger window_number = 0;
+ screen_position = [NSEvent mouseLocation];
+ window_number = 0;
+
do
{
- NSWindow *w;
+ window_number = [NSWindow windowNumberAtPoint: screen_position
+ belowWindowWithWindowNumber: window_number];
+ w = [NSApp windowWithWindowNumber: window_number];
- window_number = [NSWindow windowNumberAtPoint:screen_position
- belowWindowWithWindowNumber:window_number];
- w = [NSApp windowWithWindowNumber:window_number];
-
- if (w && [[w delegate] isKindOfClass:[EmacsView class]])
- f = ((EmacsView *)[w delegate])->emacsframe;
+ if (w && [[w delegate] isKindOfClass: [EmacsView class]])
+ f = ((EmacsView *) [w delegate])->emacsframe;
+ else if (EQ (track_mouse, Qdrag_source))
+ break;
}
while (window_number > 0 && !f);
#endif
#endif
NSPoint position;
int x, y;
+ NSAutoreleasePool *ap;
+ specpdl_ref count;
+
+ ap = [[NSAutoreleasePool alloc] init];
+ count = SPECPDL_INDEX ();
+ record_unwind_protect_ptr (ns_release_autorelease_pool, ap);
#ifdef NS_IMPL_GNUSTEP
EVENT_INIT (ie);
redisplay ();
#endif
+ unbind_to (count, Qnil);
return NSDragOperationGeneric;
}
NSCompositingOperationCopy);
[image unlockFocus];
+ block_input ();
if (last_drag_event)
[self dragImage: image
at: NSMakePoint (0, 0)
pasteboard: pasteboard
source: self
slideBack: NO];
+ unblock_input ();
[image release];