diff options
| author | YAMAMOTO Mitsuharu | 2007-02-13 08:28:31 +0000 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2007-02-13 08:28:31 +0000 |
| commit | 4f78f0f9bc0054ef0d996362f22468967d2b3962 (patch) | |
| tree | 4ed8a1f2a6758eef2ba37ab5a83341db96130956 /src | |
| parent | 5cfe63ffe33828c857fbc54031f5622bf3c84726 (diff) | |
| download | emacs-4f78f0f9bc0054ef0d996362f22468967d2b3962.tar.gz emacs-4f78f0f9bc0054ef0d996362f22468967d2b3962.zip | |
(Fx_focus_frame): Move current process to foreground if
it is not.
[TARGET_API_MAC_CARBON] (Fx_file_dialog): Replace #if MAC_OSX with
#ifdef MAC_OSX.
(Fmac_set_font_panel_visible_p) [USE_MAC_FONT_PANEL]: Rename from
Fmac_set_font_panel_visibility. All uses changed. Rename argument
VISIBLE to FLAG.
Diffstat (limited to 'src')
| -rw-r--r-- | src/macfns.c | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/src/macfns.c b/src/macfns.c index f24e8c881fa..013b145f6de 100644 --- a/src/macfns.c +++ b/src/macfns.c | |||
| @@ -2863,9 +2863,31 @@ FRAME nil means use the selected frame. */) | |||
| 2863 | (frame) | 2863 | (frame) |
| 2864 | Lisp_Object frame; | 2864 | Lisp_Object frame; |
| 2865 | { | 2865 | { |
| 2866 | OSErr err; | ||
| 2867 | ProcessSerialNumber front_psn; | ||
| 2868 | static const ProcessSerialNumber current_psn = {0, kCurrentProcess}; | ||
| 2869 | Boolean front_p; | ||
| 2866 | struct frame *f = check_x_frame (frame); | 2870 | struct frame *f = check_x_frame (frame); |
| 2867 | 2871 | ||
| 2868 | BLOCK_INPUT; | 2872 | BLOCK_INPUT; |
| 2873 | /* Move the current process to the foreground if it is not. Don't | ||
| 2874 | call SetFrontProcess if the current process is already running in | ||
| 2875 | the foreground so as not to change the z-order of windows. */ | ||
| 2876 | err = GetFrontProcess (&front_psn); | ||
| 2877 | if (err == noErr) | ||
| 2878 | err = SameProcess (&front_psn, ¤t_psn, &front_p); | ||
| 2879 | if (err == noErr) | ||
| 2880 | if (!front_p) | ||
| 2881 | { | ||
| 2882 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 | ||
| 2883 | if (FrontNonFloatingWindow () == FRAME_MAC_WINDOW (f)) | ||
| 2884 | SetFrontProcessWithOptions (¤t_psn, | ||
| 2885 | kSetFrontProcessFrontWindowOnly); | ||
| 2886 | else | ||
| 2887 | #endif | ||
| 2888 | SetFrontProcess (¤t_psn); | ||
| 2889 | } | ||
| 2890 | |||
| 2869 | #ifdef MAC_OSX | 2891 | #ifdef MAC_OSX |
| 2870 | ActivateWindow (ActiveNonFloatingWindow (), false); | 2892 | ActivateWindow (ActiveNonFloatingWindow (), false); |
| 2871 | ActivateWindow (FRAME_MAC_WINDOW (f), true); | 2893 | ActivateWindow (FRAME_MAC_WINDOW (f), true); |
| @@ -4513,7 +4535,7 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */) | |||
| 4513 | filename[len++] = '/'; | 4535 | filename[len++] = '/'; |
| 4514 | CFStringGetCString(reply.saveFileName, filename+len, | 4536 | CFStringGetCString(reply.saveFileName, filename+len, |
| 4515 | sizeof (filename) - len, | 4537 | sizeof (filename) - len, |
| 4516 | #if MAC_OSX | 4538 | #ifdef MAC_OSX |
| 4517 | kCFStringEncodingUTF8 | 4539 | kCFStringEncodingUTF8 |
| 4518 | #else | 4540 | #else |
| 4519 | CFStringGetSystemEncoding () | 4541 | CFStringGetSystemEncoding () |
| @@ -4575,22 +4597,22 @@ DEFUN ("mac-clear-font-name-table", Fmac_clear_font_name_table, | |||
| 4575 | } | 4597 | } |
| 4576 | 4598 | ||
| 4577 | #if USE_MAC_FONT_PANEL | 4599 | #if USE_MAC_FONT_PANEL |
| 4578 | DEFUN ("mac-set-font-panel-visibility", Fmac_set_font_panel_visibility, | 4600 | DEFUN ("mac-set-font-panel-visible-p", Fmac_set_font_panel_visible_p, |
| 4579 | Smac_set_font_panel_visibility, 1, 1, 0, | 4601 | Smac_set_font_panel_visible_p, 1, 1, 0, |
| 4580 | doc: /* Make the font panel visible if and only if VISIBLE is non-nil. | 4602 | doc: /* Make the font panel visible if and only if FLAG is non-nil. |
| 4581 | This is for internal use only. Use `mac-font-panel-mode' instead. */) | 4603 | This is for internal use only. Use `mac-font-panel-mode' instead. */) |
| 4582 | (visible) | 4604 | (flag) |
| 4583 | Lisp_Object visible; | 4605 | Lisp_Object flag; |
| 4584 | { | 4606 | { |
| 4585 | OSStatus err = noErr; | 4607 | OSStatus err = noErr; |
| 4586 | 4608 | ||
| 4587 | check_mac (); | 4609 | check_mac (); |
| 4588 | 4610 | ||
| 4589 | BLOCK_INPUT; | 4611 | BLOCK_INPUT; |
| 4590 | if (NILP (visible) != !mac_font_panel_visible_p ()) | 4612 | if (NILP (flag) != !mac_font_panel_visible_p ()) |
| 4591 | { | 4613 | { |
| 4592 | err = mac_show_hide_font_panel (); | 4614 | err = mac_show_hide_font_panel (); |
| 4593 | if (err == noErr && !NILP (visible)) | 4615 | if (err == noErr && !NILP (flag)) |
| 4594 | { | 4616 | { |
| 4595 | Lisp_Object focus_frame = x_get_focus_frame (SELECTED_FRAME ()); | 4617 | Lisp_Object focus_frame = x_get_focus_frame (SELECTED_FRAME ()); |
| 4596 | struct frame *f = (NILP (focus_frame) ? SELECTED_FRAME () | 4618 | struct frame *f = (NILP (focus_frame) ? SELECTED_FRAME () |
| @@ -4860,7 +4882,7 @@ Chinese, Japanese, and Korean. */); | |||
| 4860 | #endif | 4882 | #endif |
| 4861 | defsubr (&Smac_clear_font_name_table); | 4883 | defsubr (&Smac_clear_font_name_table); |
| 4862 | #if USE_MAC_FONT_PANEL | 4884 | #if USE_MAC_FONT_PANEL |
| 4863 | defsubr (&Smac_set_font_panel_visibility); | 4885 | defsubr (&Smac_set_font_panel_visible_p); |
| 4864 | #endif | 4886 | #endif |
| 4865 | #if USE_ATSUI | 4887 | #if USE_ATSUI |
| 4866 | defsubr (&Smac_atsu_font_face_attributes); | 4888 | defsubr (&Smac_atsu_font_face_attributes); |