aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2006-05-29 09:43:03 +0000
committerYAMAMOTO Mitsuharu2006-05-29 09:43:03 +0000
commitb71c381c181bfd856ada810572697f7ec771fe26 (patch)
tree4b3d51fd68396029ea7dc42ee9d7367d25a71318
parent54b9479288eebf18fabc23ff17ba7231425a3f55 (diff)
downloademacs-b71c381c181bfd856ada810572697f7ec771fe26.tar.gz
emacs-b71c381c181bfd856ada810572697f7ec771fe26.zip
(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.
-rw-r--r--src/macterm.c22
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)
8338} 8338}
8339 8339
8340#if USE_MAC_FONT_PANEL 8340#if USE_MAC_FONT_PANEL
8341/* The first call to font panel functions (FPIsFontPanelVisible,
8342 SetFontInfoForSelection) is slow. This variable is used for
8343 deferring such a call as much as possible. */
8344static int font_panel_shown_p = 0;
8345
8346int
8347mac_font_panel_visible_p ()
8348{
8349 return font_panel_shown_p && FPIsFontPanelVisible ();
8350}
8351
8352OSStatus
8353mac_show_hide_font_panel ()
8354{
8355 font_panel_shown_p = 1;
8356
8357 return FPShowHideFontPanel ();
8358}
8359
8341OSStatus 8360OSStatus
8342mac_set_font_info_for_selection (f, face_id, c) 8361mac_set_font_info_for_selection (f, face_id, c)
8343 struct frame *f; 8362 struct frame *f;
@@ -8347,6 +8366,9 @@ mac_set_font_info_for_selection (f, face_id, c)
8347 EventTargetRef target = NULL; 8366 EventTargetRef target = NULL;
8348 XFontStruct *font = NULL; 8367 XFontStruct *font = NULL;
8349 8368
8369 if (!mac_font_panel_visible_p ())
8370 return noErr;
8371
8350 if (f) 8372 if (f)
8351 { 8373 {
8352 target = GetWindowEventTarget (FRAME_MAC_WINDOW (f)); 8374 target = GetWindowEventTarget (FRAME_MAC_WINDOW (f));