emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: x-create-frame is sluggish


From: Jan D.
Subject: Re: x-create-frame is sluggish
Date: Mon, 11 Oct 2004 09:54:00 +0200


*** diff-old/src/xfns.c 2004-10-11 00:24:05.000000000 +0200
--- diff-new/src/xfns.c 2004-10-11 00:18:09.000000000 +0200
***************
*** 1953,1959 ****
--- 1953,1970 ----
    char **missing_list;
    int missing_count;
    char *def_string;
+   Lisp_Object rest, frame;

+   /* See if there is another frame already using same fontset. */
+   FOR_EACH_FRAME (rest, frame)
+     {
+       struct frame *cf = XFRAME (frame);
+       if (cf != f && FRAME_LIVE_P (f) && FRAME_X_P (cf)
+           && !strcmp (FRAME_XIC_BASE_FONTNAME (cf), base_fontname))
+         return FRAME_XIC_FONTSET (cf);
+     }

You must check that the frames sharing the fontset is on the same display.



+ /* Free the X fontset of frame F if it is the last frame using it. */
+
+ void
+ xic_delete_xfontset (f)
+      struct frame *f;
+ {
+   Lisp_Object rest, frame;
+
+   if (!FRAME_XIC_FONTSET (f))
+     return;
+
+   /* See if there is another frame sharing the same fontset. */
+   FOR_EACH_FRAME (rest, frame)
+     {
+       struct frame *cf = XFRAME (frame);
+       if (cf != f && FRAME_LIVE_P (f) && FRAME_X_P (cf)
+           && FRAME_XIC_FONTSET (cf) == FRAME_XIC_FONTSET (f))
+         return;
+     }
+   /* The fontset is not used anymore.  It is safe to free it. */
+   XFreeFontSet (FRAME_X_DISPLAY (f), FRAME_XIC_FONTSET (f));
+ }

And here also.

You did not include diffs for xterm.c and xterm.h.

        Jan D.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]