}
#ifdef NS_IMPL_COCOA
else
- /* Under NS, there is no system mechanism for choosing a new
- window to get focus -- it is left to application code.
- So the portion of THIS application interfacing with NS
- needs to know about it. We call Fraise_frame, but the
- purpose is really to transfer focus. */
- Fraise_frame (frame1);
+ {
+ /* Under NS, there is no system mechanism for choosing a new
+ window to get focus -- it is left to application code.
+ So the portion of THIS application interfacing with NS
+ needs to make the frame we switch to the key window. */
+ struct frame *f1 = XFRAME (frame1);
+ if (FRAME_NS_P (f1))
+ ns_make_frame_key_window (f1);
+ }
#endif
do_switch_frame (frame1, 0, 1, Qnil);
extern void frame_size_history_plain (struct frame *, Lisp_Object);
extern void frame_size_history_extra (struct frame *, Lisp_Object,
int, int, int, int, int, int);
+#ifdef NS_IMPL_COCOA
+/* Implemented in nsfns.m. */
+extern void ns_make_frame_key_window (struct frame *);
+#endif
extern Lisp_Object Vframe_list;
/* Value is a pointer to the selected frame. If the selected frame
SET_FRAME_GARBAGED (f);
}
+void
+ns_make_frame_key_window (struct frame *f)
+{
+ [[FRAME_NS_VIEW (f) window] makeKeyWindow];
+}
+
/* tabbar support */
static void
ns_set_tab_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)