NSView *view = FRAME_NS_VIEW (f);
check_ns ();
BLOCK_INPUT;
- [[view window] makeKeyAndOrderFront: NSApp];
+ FRAME_SAMPLE_VISIBILITY (f);
+ if (FRAME_VISIBLE_P (f))
+ {
+ [[view window] makeKeyAndOrderFront: NSApp];
+ }
UNBLOCK_INPUT;
}
called this (frame.c:Fraise_frame ()) also called raise_lower;
if this ends up the case again, comment this out again. */
if (!FRAME_VISIBLE_P (f))
- ns_raise_frame (f);
+ {
+ f->async_visible = 1;
+ ns_raise_frame (f);
+ }
}
if (!emacs_event)
return;
- if (![[self window] isKeyWindow])
+ if (![[self window] isKeyWindow]
+ && [[theEvent window] isKindOfClass: [EmacsWindow class]])
{
/* XXX: There is an occasional condition in which, when Emacs display
updates a different frame from the current one, and temporarily
(dispnew.c:3878), OS will send the event to the correct NSWindow, but
for some reason that window has its first responder set to the NSView
most recently updated (I guess), which is not the correct one. */
- if ([[theEvent window] isKindOfClass: [EmacsWindow class]])
- [(EmacsView *)[[theEvent window] delegate] keyDown: theEvent];
+ [(EmacsView *)[[theEvent window] delegate] keyDown: theEvent];
return;
}
ns_clear_frame_area (emacsframe, x, y, width, height);
expose_frame (emacsframe, x, y, width, height);
- emacsframe->async_visible = 1;
- emacsframe->async_iconified = 0;
+
+ /*
+ drawRect: may be called (at least in OS X 10.5) for invisible
+ views as well for some reason. Thus, do not infer visibility
+ here.
+
+ emacsframe->async_visible = 1;
+ emacsframe->async_iconified = 0;
+ */
}