return Qnil;
}
+DEFUN ("ns-mouse-absolute-pixel-position",
+ Fns_mouse_absolute_pixel_position,
+ Sns_mouse_absolute_pixel_position, 0, 0, 0,
+ doc: /* Return absolute position of mouse cursor in pixels.
+The position is returned as a cons cell (X . Y) of the
+coordinates of the mouse cursor position in pixels relative to a
+position (0, 0) of the selected frame's terminal. */)
+ (void)
+{
+ struct frame *f = SELECTED_FRAME ();
+ EmacsView *view = FRAME_NS_VIEW (f);
+ NSScreen *screen = [[view window] screen];
+ NSPoint pt = [NSEvent mouseLocation];
+
+ return Fcons(make_number(pt.x - screen.frame.origin.x),
+ make_number(screen.frame.size.height -
+ (pt.y - screen.frame.origin.y)));
+}
+
/* ==========================================================================
Class implementations
defsubr (&Sns_frame_list_z_order);
defsubr (&Sns_frame_restack);
defsubr (&Sns_set_mouse_absolute_pixel_position);
+ defsubr (&Sns_mouse_absolute_pixel_position);
defsubr (&Sx_display_mm_width);
defsubr (&Sx_display_mm_height);
defsubr (&Sx_display_screens);
if (!FRAME_VISIBLE_P (f))
{
EmacsView *view = (EmacsView *)FRAME_NS_VIEW (f);
+ NSWindow *window = [view window];
SET_FRAME_VISIBLE (f, 1);
ns_raise_frame (f, ! FRAME_NO_FOCUS_ON_MAP (f));
[view handleFS];
unblock_input ();
}
+
+ /* Making a frame invisible seems to break the parent->child
+ relationship, so reinstate it. */
+ if ([window parentWindow] == nil && FRAME_PARENT_FRAME (f) != NULL)
+ {
+ NSWindow *parent = [FRAME_NS_VIEW (FRAME_PARENT_FRAME (f)) window];
+
+ block_input ();
+ [parent addChildWindow: window
+ ordered: NSWindowAbove];
+ unblock_input ();
+
+ /* If the parent frame moved while the child frame was
+ invisible, the child frame's position won't have been
+ updated. Make sure it's in the right place now. */
+ x_set_offset(f, f->left_pos, f->top_pos, 0);
+ }
}
}