w32font_list_family (struct frame *f)
{
Lisp_Object list = Qnil;
+ Lisp_Object prev_quit = Vinhibit_quit;
LOGFONT font_match_pattern;
HDC dc;
memset (&font_match_pattern, 0, sizeof (font_match_pattern));
font_match_pattern.lfCharSet = DEFAULT_CHARSET;
+ /* Prevent quitting while EnumFontFamiliesEx runs and conses the
+ list it will return. That's because get_frame_dc acquires the
+ critical section, so we cannot quit before we release it in
+ release_frame_dc. */
+ Vinhibit_quit = Qt;
dc = get_frame_dc (f);
EnumFontFamiliesEx (dc, &font_match_pattern,
(FONTENUMPROC) add_font_name_to_list,
(LPARAM) &list, 0);
release_frame_dc (f, dc);
+ Vinhibit_quit = prev_quit;
return list;
}
WORD *wcode;
SIZE size;
bool first;
+ Lisp_Object prev_quit = Vinhibit_quit;
struct w32font_info *w32_font = (struct w32font_info *) font;
is updated to pass in a frame. */
f = XFRAME (selected_frame);
+ /* Prevent quitting while EnumFontFamiliesEx runs and
+ conses the list it will return. That's because
+ get_frame_dc acquires the critical section, so we
+ cannot quit before we release it in release_frame_dc. */
+ prev_quit = Vinhibit_quit;
+ Vinhibit_quit = Qt;
dc = get_frame_dc (f);
old_font = SelectObject (dc, w32_font->hfont);
}
/* Restore state and release DC. */
SelectObject (dc, old_font);
release_frame_dc (f, dc);
+ Vinhibit_quit = prev_quit;
}
return;
}
frame. */
f = XFRAME (selected_frame);
+ /* Prevent quitting while EnumFontFamiliesEx runs and conses the
+ list it will return. That's because get_frame_dc acquires
+ the critical section, so we cannot quit before we release it
+ in release_frame_dc. */
+ prev_quit = Vinhibit_quit;
+ Vinhibit_quit = Qt;
dc = get_frame_dc (f);
old_font = SelectObject (dc, w32_font->hfont);
}
/* Restore state and release DC. */
SelectObject (dc, old_font);
release_frame_dc (f, dc);
+ Vinhibit_quit = prev_quit;
}
/* w32 implementation of draw for font backend.
}
else
{
+ Lisp_Object prev_quit = Vinhibit_quit;
+
+ /* Prevent quitting while EnumFontFamiliesEx runs and conses the
+ list it will return. That's because get_frame_dc acquires
+ the critical section, so we cannot quit before we release it
+ in release_frame_dc. */
+ Vinhibit_quit = Qt;
dc = get_frame_dc (f);
EnumFontFamiliesEx (dc, &match_data.pattern,
(FONTENUMPROC) add_font_entity_to_list,
(LPARAM) &match_data, 0);
release_frame_dc (f, dc);
+ Vinhibit_quit = prev_quit;
}
return match_data.list;
if (opentype_only)
match_data.pattern.lfOutPrecision = OUT_OUTLINE_PRECIS;
+ /* Prevent quitting while EnumFontFamiliesEx runs and conses the
+ list it will return. That's because get_frame_dc acquires the
+ critical section, so we cannot quit before we release it in
+ release_frame_dc. */
+ Lisp_Object prev_quit = Vinhibit_quit;
+ Vinhibit_quit = Qt;
dc = get_frame_dc (f);
EnumFontFamiliesEx (dc, &match_data.pattern,
(FONTENUMPROC) add_one_font_entity_to_list,
(LPARAM) &match_data, 0);
release_frame_dc (f, dc);
+ Vinhibit_quit = prev_quit;
return NILP (match_data.list) ? Qnil : XCAR (match_data.list);
}
Lisp_Object families = w32font_list_family (XFRAME (match_data->frame));
struct frame *f = XFRAME (match_data->frame);
+ /* Prevent quitting while EnumFontFamiliesEx runs and conses the
+ list it will return. That's because get_frame_dc acquires the
+ critical section, so we cannot quit before we release it in
+ release_frame_dc. */
+ Lisp_Object prev_quit = Vinhibit_quit;
+ Vinhibit_quit = Qt;
dc = get_frame_dc (f);
while (!NILP (families))
}
release_frame_dc (f, dc);
+ Vinhibit_quit = prev_quit;
}
static Lisp_Object