diff options
| author | David Reitter | 2009-05-26 18:14:14 +0000 |
|---|---|---|
| committer | David Reitter | 2009-05-26 18:14:14 +0000 |
| commit | 15891144c8d701999997dedfc6c843ebcd145c3d (patch) | |
| tree | 533114cb8ae41127045f662b2b487d71ebefefce /src | |
| parent | f2872f04a46404e026afce21904248cbb664bc8c (diff) | |
| download | emacs-15891144c8d701999997dedfc6c843ebcd145c3d.tar.gz emacs-15891144c8d701999997dedfc6c843ebcd145c3d.zip | |
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')
| -rw-r--r-- | src/ChangeLog | 13 | ||||
| -rw-r--r-- | src/nsfns.m | 21 | ||||
| -rw-r--r-- | src/nsterm.m | 28 |
3 files changed, 48 insertions, 14 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index c51bbd52b63..3a44cebd1ab 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,16 @@ | |||
| 1 | 2009-05-25 David Reitter <david.reitter@gmail.com> | ||
| 2 | |||
| 3 | * nsterm.m (ns_raise_frame): only raise frame if visible. | ||
| 4 | (x_make_frame_visible): move frame to front rather than calling | ||
| 5 | ns_raise_frame(). | ||
| 6 | (keyDown:) do not swallow events that aren't re-sent if frame | ||
| 7 | isn't key window. | ||
| 8 | (drawRect:) do not set visibility/iconified flags because | ||
| 9 | drawRect may be called by NSView even if the frame is hidden. | ||
| 10 | |||
| 11 | * nsfns.m (Fx_create_frame): follow other ports in | ||
| 12 | determining visibility; default to t. Ensure async_visible is set. | ||
| 13 | |||
| 1 | 2009-05-23 Eli Zaretskii <eliz@gnu.org> | 14 | 2009-05-23 Eli Zaretskii <eliz@gnu.org> |
| 2 | 15 | ||
| 3 | * dired.c (Ffile_attributes): Doc fix. | 16 | * dired.c (Ffile_attributes): Doc fix. |
diff --git a/src/nsfns.m b/src/nsfns.m index 01ffcf1181c..5d944593f56 100644 --- a/src/nsfns.m +++ b/src/nsfns.m | |||
| @@ -1317,13 +1317,20 @@ be shared by the new frame. */) | |||
| 1317 | 1317 | ||
| 1318 | if (! f->output_data.ns->explicit_parent) | 1318 | if (! f->output_data.ns->explicit_parent) |
| 1319 | { | 1319 | { |
| 1320 | tem = x_get_arg (dpyinfo, parms, Qvisibility, 0, 0, RES_TYPE_BOOLEAN); | 1320 | tem = x_get_arg (dpyinfo, parms, Qvisibility, 0, 0, RES_TYPE_SYMBOL); |
| 1321 | if (EQ (tem, Qunbound)) | 1321 | if (EQ (tem, Qunbound)) |
| 1322 | tem = Qnil; | 1322 | tem = Qt; |
| 1323 | 1323 | x_set_visibility (f, tem, Qnil); | |
| 1324 | x_set_visibility (f, tem, Qnil); | 1324 | if (EQ (tem, Qicon)) |
| 1325 | if (EQ (tem, Qt)) | 1325 | x_iconify_frame (f); |
| 1326 | [[FRAME_NS_VIEW (f) window] makeKeyWindow]; | 1326 | else if (! NILP (tem)) |
| 1327 | { | ||
| 1328 | x_make_frame_visible (f); | ||
| 1329 | f->async_visible = 1; | ||
| 1330 | [[FRAME_NS_VIEW (f) window] makeKeyWindow]; | ||
| 1331 | } | ||
| 1332 | else | ||
| 1333 | f->async_visible = 0; | ||
| 1327 | } | 1334 | } |
| 1328 | 1335 | ||
| 1329 | if (FRAME_HAS_MINIBUF_P (f) | 1336 | if (FRAME_HAS_MINIBUF_P (f) |
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) | |||
| 896 | NSView *view = FRAME_NS_VIEW (f); | 896 | NSView *view = FRAME_NS_VIEW (f); |
| 897 | check_ns (); | 897 | check_ns (); |
| 898 | BLOCK_INPUT; | 898 | BLOCK_INPUT; |
| 899 | [[view window] makeKeyAndOrderFront: NSApp]; | 899 | FRAME_SAMPLE_VISIBILITY (f); |
| 900 | if (FRAME_VISIBLE_P (f)) | ||
| 901 | { | ||
| 902 | [[view window] makeKeyAndOrderFront: NSApp]; | ||
| 903 | } | ||
| 900 | UNBLOCK_INPUT; | 904 | UNBLOCK_INPUT; |
| 901 | } | 905 | } |
| 902 | 906 | ||
| @@ -983,7 +987,10 @@ x_make_frame_visible (struct frame *f) | |||
| 983 | called this (frame.c:Fraise_frame ()) also called raise_lower; | 987 | called this (frame.c:Fraise_frame ()) also called raise_lower; |
| 984 | if this ends up the case again, comment this out again. */ | 988 | if this ends up the case again, comment this out again. */ |
| 985 | if (!FRAME_VISIBLE_P (f)) | 989 | if (!FRAME_VISIBLE_P (f)) |
| 986 | ns_raise_frame (f); | 990 | { |
| 991 | f->async_visible = 1; | ||
| 992 | ns_raise_frame (f); | ||
| 993 | } | ||
| 987 | } | 994 | } |
| 988 | 995 | ||
| 989 | 996 | ||
| @@ -4461,7 +4468,8 @@ extern void update_window_cursor (struct window *w, int on); | |||
| 4461 | if (!emacs_event) | 4468 | if (!emacs_event) |
| 4462 | return; | 4469 | return; |
| 4463 | 4470 | ||
| 4464 | if (![[self window] isKeyWindow]) | 4471 | if (![[self window] isKeyWindow] |
| 4472 | && [[theEvent window] isKindOfClass: [EmacsWindow class]]) | ||
| 4465 | { | 4473 | { |
| 4466 | /* XXX: There is an occasional condition in which, when Emacs display | 4474 | /* XXX: There is an occasional condition in which, when Emacs display |
| 4467 | updates a different frame from the current one, and temporarily | 4475 | updates a different frame from the current one, and temporarily |
| @@ -4469,8 +4477,7 @@ extern void update_window_cursor (struct window *w, int on); | |||
| 4469 | (dispnew.c:3878), OS will send the event to the correct NSWindow, but | 4477 | (dispnew.c:3878), OS will send the event to the correct NSWindow, but |
| 4470 | for some reason that window has its first responder set to the NSView | 4478 | for some reason that window has its first responder set to the NSView |
| 4471 | most recently updated (I guess), which is not the correct one. */ | 4479 | most recently updated (I guess), which is not the correct one. */ |
| 4472 | if ([[theEvent window] isKindOfClass: [EmacsWindow class]]) | 4480 | [(EmacsView *)[[theEvent window] delegate] keyDown: theEvent]; |
| 4473 | [(EmacsView *)[[theEvent window] delegate] keyDown: theEvent]; | ||
| 4474 | return; | 4481 | return; |
| 4475 | } | 4482 | } |
| 4476 | 4483 | ||
| @@ -5466,8 +5473,15 @@ extern void update_window_cursor (struct window *w, int on); | |||
| 5466 | 5473 | ||
| 5467 | ns_clear_frame_area (emacsframe, x, y, width, height); | 5474 | ns_clear_frame_area (emacsframe, x, y, width, height); |
| 5468 | expose_frame (emacsframe, x, y, width, height); | 5475 | expose_frame (emacsframe, x, y, width, height); |
| 5469 | emacsframe->async_visible = 1; | 5476 | |
| 5470 | emacsframe->async_iconified = 0; | 5477 | /* |
| 5478 | drawRect: may be called (at least in OS X 10.5) for invisible | ||
| 5479 | views as well for some reason. Thus, do not infer visibility | ||
| 5480 | here. | ||
| 5481 | |||
| 5482 | emacsframe->async_visible = 1; | ||
| 5483 | emacsframe->async_iconified = 0; | ||
| 5484 | */ | ||
| 5471 | } | 5485 | } |
| 5472 | 5486 | ||
| 5473 | 5487 | ||