diff options
author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 2006-05-29 09:43:03 +0000 |
---|---|---|
committer | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 2006-05-29 09:43:03 +0000 |
commit | b71c381c181bfd856ada810572697f7ec771fe26 (patch) | |
tree | 4b3d51fd68396029ea7dc42ee9d7367d25a71318 /src/macterm.c | |
parent | 54b9479288eebf18fabc23ff17ba7231425a3f55 (diff) | |
download | emacs-b71c381c181bfd856ada810572697f7ec771fe26.tar.gz |
(font_panel_shown_p) [USE_MAC_FONT_PANEL]: New variable.
(mac_font_panel_visible_p, mac_show_hide_font_panel)
[USE_MAC_FONT_PANEL]: New functions.
[USE_MAC_FONT_PANEL] (mac_set_font_info_for_selection): Return
immediately if font panel is not visible.
Diffstat (limited to 'src/macterm.c')
-rw-r--r-- | src/macterm.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/macterm.c b/src/macterm.c index 9a2d6e2a35d..c86ad0ffde3 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -8338,6 +8338,25 @@ x_find_ccl_program (fontp) } #if USE_MAC_FONT_PANEL +/* The first call to font panel functions (FPIsFontPanelVisible, + SetFontInfoForSelection) is slow. This variable is used for + deferring such a call as much as possible. */ +static int font_panel_shown_p = 0; + +int +mac_font_panel_visible_p () +{ + return font_panel_shown_p && FPIsFontPanelVisible (); +} + +OSStatus +mac_show_hide_font_panel () +{ + font_panel_shown_p = 1; + + return FPShowHideFontPanel (); +} + OSStatus mac_set_font_info_for_selection (f, face_id, c) struct frame *f; @@ -8347,6 +8366,9 @@ mac_set_font_info_for_selection (f, face_id, c) EventTargetRef target = NULL; XFontStruct *font = NULL; + if (!mac_font_panel_visible_p ()) + return noErr; + if (f) { target = GetWindowEventTarget (FRAME_MAC_WINDOW (f)); |