diff options
author | David Reitter <david.reitter@gmail.com> | 2009-05-26 18:14:14 +0000 |
---|---|---|
committer | David Reitter <david.reitter@gmail.com> | 2009-05-26 18:14:14 +0000 |
commit | 15891144c8d701999997dedfc6c843ebcd145c3d (patch) | |
tree | 533114cb8ae41127045f662b2b487d71ebefefce /src/nsterm.m | |
parent | f2872f04a46404e026afce21904248cbb664bc8c (diff) | |
download | emacs-15891144c8d701999997dedfc6c843ebcd145c3d.tar.gz |
Ensure NS frames remain hidden when invisible
* nsterm.m (ns_raise_frame): only raise frame if visible.
(x_make_frame_visible): move frame to front rather than calling
ns_raise_frame().
(keyDown:) do not swallow events that aren't re-sent if frame
isn't key window.
(drawRect:) do not set visibility/iconified flags because
drawRect may be called by NSView even if the frame is hidden.
* nsfns.m (Fx_create_frame): follow other ports in
determining visibility; default to t. Ensure async_visible is set.
Diffstat (limited to 'src/nsterm.m')
-rw-r--r-- | src/nsterm.m | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/nsterm.m b/src/nsterm.m index 9ca74e8baf9..4a9a1928359 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -896,7 +896,11 @@ ns_raise_frame (struct frame *f) 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; } @@ -983,7 +987,10 @@ x_make_frame_visible (struct frame *f) 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); + } } @@ -4461,7 +4468,8 @@ extern void update_window_cursor (struct window *w, int on); 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 @@ -4469,8 +4477,7 @@ extern void update_window_cursor (struct window *w, int on); (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; } @@ -5466,8 +5473,15 @@ extern void update_window_cursor (struct window *w, int on); 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; + */ } |