1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-03 02:31:03 -08:00

(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.
This commit is contained in:
YAMAMOTO Mitsuharu 2006-05-29 09:43:03 +00:00
parent 54b9479288
commit b71c381c18

View file

@ -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));