From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Karoly.Lorentey@cern.ch (=?iso-8859-2?Q?L=F5rentey_K=E1roly?=) Newsgroups: gmane.emacs.devel Subject: Re: x-create-frame is sluggish Date: Mon, 25 Oct 2004 15:07:18 +0200 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: References: <200409250239.LAA15347@etlken.m17n.org> <200410010126.KAA01376@etlken.m17n.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1478458524==" X-Trace: sea.gmane.org 1098709767 10071 80.91.229.6 (25 Oct 2004 13:09:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 25 Oct 2004 13:09:27 +0000 (UTC) Cc: "Jan D." , Richard Stallman , Kenichi Handa Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 25 15:09:11 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CM4b1-0002fd-00 for ; Mon, 25 Oct 2004 15:09:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CM4if-0008Az-1z for ged-emacs-devel@m.gmane.org; Mon, 25 Oct 2004 09:17:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CM4iB-00081y-9H for emacs-devel@gnu.org; Mon, 25 Oct 2004 09:16:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CM4iA-00081M-2W for emacs-devel@gnu.org; Mon, 25 Oct 2004 09:16:34 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CM4i9-000813-Sa for emacs-devel@gnu.org; Mon, 25 Oct 2004 09:16:33 -0400 Original-Received: from [157.181.1.137] (helo=mx1.elte.hu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CM4Zq-0008Eq-KT; Mon, 25 Oct 2004 09:07:59 -0400 Original-Received: from mailbox1.caesar.elte.hu (mailbox1.caesar.elte.hu [157.181.151.157]) by mx1.elte.hu (Postfix) with ESMTP id ECD55283B2E; Mon, 25 Oct 2004 15:05:09 +0200 (CEST) Original-Received: from eris.fnord.hu (pcitislory.cern.ch [137.138.41.46]) by mailbox1.caesar.elte.hu (Postfix) with ESMTP id 44977A079701; Mon, 25 Oct 2004 15:07:26 +0200 (CEST) Original-Received: by eris.fnord.hu (Postfix, from userid 1000) id 1D3DB313; Mon, 25 Oct 2004 15:07:23 +0200 (CEST) Original-To: emacs-devel@gnu.org In-Reply-To: =?iso-8859-2?Q?=28K=E1roly=09L=F5rentey's?= message of "Mon, 11 Oct 2004 16:53:32 +0200") User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) X-ELTE-SpamVersion: MailScanner 4.31.6-itk1 (ELTE 1.2) SpamAssassin 2.63 ClamAV 0.73 X-ELTE-VirusStatus: clean X-ELTE-SpamCheck: no X-ELTE-SpamCheck-Details: score=-4.9, required 5.9, BAYES_00 -4.90, UPPERCASE_25_50 0.00 X-ELTE-SpamLevel: X-ELTE-SpamScore: -4 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:28904 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:28904 --===============1478458524== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: quoted-printable Does the new patch look all right to you? If there are no objections, I will proceed with installing it. I've been using it for a few weeks without problems. L=F5rentey K=E1roly writes: > 2004-10-11 K=E1roly L=F5rentey > > * src/xterm.h (x_output): New member `xic_base_fontname'. > (FRAME_XIC_BASE_FONTNAME): New macro. > (xic_delete_xfontset): Declare. > > * src/xfns.c (xic_create_xfontset): Share fontsets between frames > based on base_fontname. > (create_frame_xic): Set the frame's xic_base_fontname. > (xic_delete_xfontset): New function. > (free_frame_xic): Use it. Free xic_base_fontname. > (xic_set_xfontset): Ditto. > > * src/xterm.c (xim_destroy_callback): Ditto. > > *** orig/src/xfns.c > --- mod/src/xfns.c > *************** > *** 1953,1959 **** > --- 1953,1971 ---- > char **missing_list; > int missing_count; > char *def_string; > + Lisp_Object rest, frame; >=20=20=20 > + /* See if there is another frame already using same fontset. */ > + FOR_EACH_FRAME (rest, frame) > + { > + struct frame *cf =3D XFRAME (frame); > + if (cf !=3D f && FRAME_LIVE_P (f) && FRAME_X_P (cf) > + && FRAME_X_DISPLAY_INFO (cf) =3D=3D FRAME_X_DISPLAY_INFO (f) > + && !strcmp (FRAME_XIC_BASE_FONTNAME (cf), base_fontname)) > + return FRAME_XIC_FONTSET (cf); > + } > +=20 > + /* New fontset. */ > xfs =3D XCreateFontSet (FRAME_X_DISPLAY (f), > base_fontname, &missing_list, > &missing_count, &def_string); > *************** > *** 1964,1969 **** > --- 1976,2005 ---- > return xfs; > } >=20=20=20 > + /* Free the X fontset of frame F if it is the last frame using it. */ > +=20 > + void > + xic_delete_xfontset (f) > + struct frame *f; > + { > + Lisp_Object rest, frame; > +=20 > + if (!FRAME_XIC_FONTSET (f)) > + return; > +=20 > + /* See if there is another frame sharing the same fontset. */ > + FOR_EACH_FRAME (rest, frame) > + { > + struct frame *cf =3D XFRAME (frame); > + if (cf !=3D f && FRAME_LIVE_P (f) && FRAME_X_P (cf) > + && FRAME_X_DISPLAY_INFO (cf) =3D=3D FRAME_X_DISPLAY_INFO (f) > + && FRAME_XIC_FONTSET (cf) =3D=3D 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)); > + } > +=20 >=20=20=20 > /* Value is the best input style, given user preferences USER (already > checked to be supported by Emacs), and styles supported by the > *************** > *** 1996,2001 **** > --- 2032,2038 ---- > XIM xim; > XIC xic =3D NULL; > XFontSet xfs =3D NULL; > + char *base_fontname =3D NULL; >=20=20=20 > if (FRAME_XIC (f)) > return; > *************** > *** 2007,2013 **** > XPoint spot; > XVaNestedList preedit_attr; > XVaNestedList status_attr; > - char *base_fontname; > int fontset; >=20=20=20 > s_area.x =3D 0; s_area.y =3D 0; s_area.width =3D 1; s_area.height= =3D 1; > --- 2044,2049 ---- > *************** > *** 2101,2106 **** > --- 2137,2143 ---- > FRAME_XIC (f) =3D xic; > FRAME_XIC_STYLE (f) =3D xic_style; > FRAME_XIC_FONTSET (f) =3D xfs; > + FRAME_XIC_BASE_FONTNAME (f) =3D xstrdup (base_fontname); > } >=20=20=20 >=20=20=20 > *************** > *** 2114,2124 **** > return; >=20=20=20 > XDestroyIC (FRAME_XIC (f)); > ! if (FRAME_XIC_FONTSET (f)) > ! XFreeFontSet (FRAME_X_DISPLAY (f), FRAME_XIC_FONTSET (f)); >=20=20=20 > FRAME_XIC (f) =3D NULL; > FRAME_XIC_FONTSET (f) =3D NULL; > } >=20=20=20 >=20=20=20 > --- 2151,2163 ---- > return; >=20=20=20 > XDestroyIC (FRAME_XIC (f)); > ! xic_delete_xfontset (f); > ! if (FRAME_XIC_BASE_FONTNAME (f)) > ! xfree (FRAME_XIC_BASE_FONTNAME (f)); >=20=20=20 > FRAME_XIC (f) =3D NULL; > FRAME_XIC_FONTSET (f) =3D NULL; > + FRAME_XIC_BASE_FONTNAME (f) =3D NULL; > } >=20=20=20 >=20=20=20 > *************** > *** 2207,2214 **** > XFree (attr); >=20=20=20 > if (FRAME_XIC_FONTSET (f)) > ! XFreeFontSet (FRAME_X_DISPLAY (f), FRAME_XIC_FONTSET (f)); > FRAME_XIC_FONTSET (f) =3D xfs; > } >=20=20=20 > #endif /* HAVE_X_I18N */ > --- 2246,2258 ---- > XFree (attr); >=20=20=20 > if (FRAME_XIC_FONTSET (f)) > ! xic_delete_xfontset (f); > !=20 > ! if (FRAME_XIC_BASE_FONTNAME (f)) > ! xfree (FRAME_XIC_BASE_FONTNAME (f)); > !=20 > FRAME_XIC_FONTSET (f) =3D xfs; > + FRAME_XIC_BASE_FONTNAME (f) =3D xstrdup (base_fontname); > } >=20=20=20 > #endif /* HAVE_X_I18N */ > *** orig/src/xterm.c > --- mod/src/xterm.c > *************** > *** 8024,8031 **** > FRAME_XIC (f) =3D NULL; > if (FRAME_XIC_FONTSET (f)) > { > ! XFreeFontSet (FRAME_X_DISPLAY (f), FRAME_XIC_FONTSET (f)); > FRAME_XIC_FONTSET (f) =3D NULL; > } > } > } > --- 8024,8033 ---- > FRAME_XIC (f) =3D NULL; > if (FRAME_XIC_FONTSET (f)) > { > ! xic_delete_xfontset (f); > ! xfree (FRAME_XIC_BASE_FONTNAME (f)); > FRAME_XIC_FONTSET (f) =3D NULL; > + FRAME_XIC_BASE_FONTNAME (f) =3D NULL; > } > } > } > *** orig/src/xterm.h > --- mod/src/xterm.h > *************** > *** 593,598 **** > --- 593,599 ---- > XIC xic; > XIMStyle xic_style; > XFontSet xic_xfs; > + char *xic_base_fontname; > #endif >=20=20=20 > /* Relief GCs, colors etc. */ > *************** > *** 727,732 **** > --- 728,734 ---- > #define FRAME_X_XIM_STYLES(f) (FRAME_X_DISPLAY_INFO (f)->xim_styles) > #define FRAME_XIC_STYLE(f) ((f)->output_data.x->xic_style) > #define FRAME_XIC_FONTSET(f) ((f)->output_data.x->xic_xfs) > + #define FRAME_XIC_BASE_FONTNAME(f) ((f)->output_data.x->xic_base_fontna= me) >=20=20=20 > /* Value is the smallest width of any character in any font on frame F.= */ >=20=20=20 > *************** > *** 1036,1041 **** > --- 1038,1044 ---- > extern unsigned char * x_encode_text P_ ((Lisp_Object, Lisp_Object, int, > int *, int *)); > extern void x_implicitly_set_name P_ ((struct frame *, Lisp_Object, Lis= p_Object)); > + extern void xic_delete_xfontset P_ ((struct frame *)); > extern void create_frame_xic P_ ((struct frame *)); > extern void destroy_frame_xic P_ ((struct frame *)); > extern void xic_set_preeditarea P_ ((struct window *, int, int)); =2D-=20 K=E1roly --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD4DBQBBfPqK6eoyqA+yej8RAkNPAJsGMeoOlWQilLnea0eowtJQBcASsACY2eAQ 2eiHg2TrrLA/lftiTRiXwA== =r3Du -----END PGP SIGNATURE----- --=-=-=-- --===============1478458524== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --===============1478458524==--