>>>>> On Wed, 23 Jan 2002 20:53:17 -0500 >>>>> "Dan" == Dan Espen <<[EMAIL PROTECTED]> > wrote: Dan> Dan> Dan> Alexander Kotelnikov <[EMAIL PROTECTED]> writes: >> Hello. >> >> It seems that the trouble was in side effects of setting GC font. If >> someone can explain me, why exactly problem appears, I will >> appreciate. >> >> Second patch is for modules/, first does not affect them. Please not >> that it is for released fvwm 2.4.4 and it is much less tested than >> first one, may be someone should revise it accurately >> >> Also all STRICTLY_FIXED parts of fvwm code would be removed from the >> code (since nobody guarantee us that 'fixed' has character set that >> matches our locale). >> >> Third patch is a small modification to modules also. (substitution >> of XCreateFonSet of GetFonSetOrFixed) >> >> Fourth patch is GetFontSetOrFixed modification, which I emphatically >> ask you to accept. Dan> Dan> The only one I looked at is the last one. Dan> I can tell that you didn't make up your patch against current Dan> CVS since I recently fixed up the messages in GetFontSetOrFixed Dan> and your patch doesn't reflect that. Dan> Dan> Patches should be against current CVS to make it easier on us.
Oh... I realised now that GetFont.c diff against is in the end on 1st patch. To put everything together I place that patch here again
Index: fvwm/builtins.c =================================================================== RCS file: /home/cvs/fvwm/fvwm/fvwm/builtins.c,v retrieving revision 1.331 diff -u -r1.331 builtins.c --- fvwm/builtins.c 2002/01/16 21:21:29 1.331 +++ fvwm/builtins.c 2002/01/23 21:12:47 @@ -1205,7 +1205,11 @@ int cset = Scr.DefaultColorset; /* make GC's */ +# ifdef I18N_MB gcm = GCFunction|GCFont|GCLineWidth|GCForeground|GCBackground; +# else + gcm = GCFunction|GCLineWidth|GCForeground|GCBackground; +# endif gcv.function = GXcopy; gcv.font = Scr.DefaultFont.font->fid; gcv.line_width = 0; Index: fvwm/menus.c =================================================================== RCS file: /home/cvs/fvwm/fvwm/fvwm/menus.c,v retrieving revision 1.286 diff -u -r1.286 menus.c --- fvwm/menus.c 2002/01/23 15:20:00 1.286 +++ fvwm/menus.c 2002/01/23 21:13:20 @@ -6177,7 +6177,11 @@ } /* make GC's */ +# ifdef I18N_MB + gcm = GCFunction|GCLineWidth|GCForeground|GCBackground; +# else gcm = GCFunction|GCFont|GCLineWidth|GCForeground|GCBackground; +# endif gcv.font = ST_PSTDFONT(ms)->font->fid; gcv.function = GXcopy; gcv.line_width = 0; Index: fvwm/misc.c =================================================================== RCS file: /home/cvs/fvwm/fvwm/fvwm/misc.c,v retrieving revision 1.118 diff -u -r1.118 misc.c --- fvwm/misc.c 2002/01/01 19:09:56 1.118 +++ fvwm/misc.c 2002/01/23 21:13:21 @@ -369,10 +369,13 @@ /* some fancy font handling stuff */ void NewFontAndColor(Font newfont, Pixel color, Pixel backcolor) { - Globalgcv.font = newfont; Globalgcv.foreground = color; Globalgcv.background = backcolor; - Globalgcm = GCFont | GCForeground | GCBackground; +# ifdef I18N_MB + Globalgcm = GCForeground | GCBackground; +# else + Globalgcm = GCFont |GCForeground | GCBackground; +# endif XChangeGC(dpy,Scr.TitleGC,Globalgcm,&Globalgcv); } Index: libs/GetFont.c =================================================================== RCS file: /home/cvs/fvwm/fvwm/libs/GetFont.c,v retrieving revision 1.8 diff -u -r1.8 GetFont.c --- libs/GetFont.c 2001/12/30 21:21:23 1.8 +++ libs/GetFont.c 2002/01/23 21:13:22 @@ -51,48 +51,49 @@ } #ifdef I18N_MB -/* -** loads fontset or "fixed" on failure -** Note, STRICTLY_FIXED does not seem to be defined on a standard compile. -** The fallback is to a font that does not use a font alias. -** I'm not sure why this is done for I18N_MB only. dje Dec 2001. -*/ - -#ifdef STRICTLY_FIXED -#define FALLBACK_FONT "fixed" -#else -#define FALLBACK_FONT "-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*" -#endif - XFontSet GetFontSetOrFixed(Display *disp, char *fontname) { XFontSet fontset = NULL; char **ml; int mc; + int i; char *ds; - if (fontname) + if (fontname){ fontset = XCreateFontSet(disp,fontname,&ml,&mc,&ds); - if (!fontset && fontname) - { - fprintf(stderr, + } + else{ + fprintf(stderr, "[FVWM][GetFontSetOrFixed]: " - "WARNING -- can't get fontset %s, trying '%s'\n", - fontname,FALLBACK_FONT); + "WARNING -- fontname is a NULL-string\n"); } if (!fontset) { + fprintf(stderr, + "[FVWM][GetFontSetOrFixed]: " + "WARNING -- can't get fontset '%s', trying '-*-fixed-*'\n", + fontname); /* fixed should always be avail, so try that */ - /* Yes, you say it's not a *FIXED* font, but it helps you. */ if ((fontset = XCreateFontSet(disp, - FALLBACK_FONT, + "-*-fixed-*", &ml, &mc, &ds)) == NULL) { fprintf(stderr,"[FVWM][GetFontSetOrFixed]: " - "ERROR -- can't get fontset '%s'\n",FALLBACK_FONT); + "ERROR -- can't get fontset 'fixed'\n"); + } + } + if (fontset){ + if (mc > 0) { + (void)fprintf(stderr, + "[FVWM][GetFontSetOrFixed]:" + "The following charsets are missing:\n"); + for(i=0; i < mc; i++) + fprintf(stderr, "\t%s\n", ml[i]); + XFreeStringList(ml); } } + return fontset; } #endif @@ -115,6 +116,7 @@ ret_font->font = fs_list[0]; fset_extents = XExtentsOfFontSet(newfontset); ret_font->height = fset_extents->max_logical_extent.height; + } else {
Index: modules//FvwmButtons/FvwmButtons.c =================================================================== RCS file: /home/cvs/fvwm/fvwm/modules/FvwmButtons/FvwmButtons.c,v retrieving revision 1.141 diff -u -r1.141 FvwmButtons.c --- modules//FvwmButtons/FvwmButtons.c 2002/01/17 09:40:51 1.141 +++ modules//FvwmButtons/FvwmButtons.c 2002/01/24 03:05:18 @@ -2092,11 +2092,13 @@ gcm = GCForeground|GCBackground; gcv.foreground = fore_pix; gcv.background = back_pix; +# ifndef I18N_MB if(ub && ub->c && ub->c->font && ub->font) { gcv.font = ub->c->font->fid; gcm |= GCFont; } +# endif NormalGC = fvwmlib_XCreateGC(Dpy, MyWindow, gcm, &gcv); gcv.foreground = shadow_pix; gcv.background = fore_pix; Index: modules//FvwmButtons/draw.c =================================================================== RCS file: /home/cvs/fvwm/fvwm/modules/FvwmButtons/draw.c,v retrieving revision 1.41 diff -u -r1.41 draw.c --- modules//FvwmButtons/draw.c 2002/01/12 14:40:13 1.41 +++ modules//FvwmButtons/draw.c 2002/01/24 03:05:20 @@ -373,8 +373,7 @@ if (fontset) { gcv.foreground = fc; - gcv.font = font->fid; - XChangeGC(Dpy,NormalGC,GCForeground | GCFont,&gcv); + XChangeGC(Dpy,NormalGC,GCForeground,&gcv); DrawTitle(b,MyWindow,NormalGC); } #else Index: modules//FvwmForm/FvwmForm.c =================================================================== RCS file: /home/cvs/fvwm/fvwm/modules/FvwmForm/FvwmForm.c,v retrieving revision 1.77 diff -u -r1.77 FvwmForm.c --- modules//FvwmForm/FvwmForm.c 2002/01/17 09:40:51 1.77 +++ modules//FvwmForm/FvwmForm.c 2002/01/24 03:05:26 @@ -637,7 +637,11 @@ static void CheckAlloc(Item *this_item,DrawTable *dt) { static XGCValues xgcv; +# ifdef I18N_MB + static int xgcv_mask = GCBackground | GCForeground; +# else static int xgcv_mask = GCBackground | GCForeground | GCFont; +# endif if (dt->dt_used == 2) { /* fonts colors shadows */ return; @@ -669,7 +673,11 @@ xgcv.foreground = dt->dt_colors[c_item_fg]; xgcv.background = dt->dt_colors[c_item_bg]; xgcv.font = dt->dt_font; +# ifdef I18N_MB + dt->dt_item_GC = fvwmlib_XCreateGC(dpy, CF.frame, GCForeground, &xgcv); +# else dt->dt_item_GC = fvwmlib_XCreateGC(dpy, CF.frame, GCForeground | GCFont, &xgcv); +# endif if (Pdepth < 2) { dt->dt_colors[c_itemlo] = BlackPixel(dpy, screen); dt->dt_colors[c_itemhi] = WhitePixel(dpy, screen); Index: modules//FvwmIconBox/FvwmIconBox.c =================================================================== RCS file: /home/cvs/fvwm/fvwm/modules/FvwmIconBox/FvwmIconBox.c,v retrieving revision 1.70 diff -u -r1.70 FvwmIconBox.c --- modules//FvwmIconBox/FvwmIconBox.c 2002/01/19 21:33:15 1.70 +++ modules//FvwmIconBox/FvwmIconBox.c 2002/01/24 03:05:31 @@ -1202,7 +1202,11 @@ gcv.foreground = icon_shadow_pix; IconShadowGC = fvwmlib_XCreateGC(dpy, main_win, gcm, &gcv); +# ifdef I18N_MB + gcm = GCForeground|GCBackground; +# else gcm = GCForeground|GCBackground|GCFont; +# endif gcv.foreground = icon_fore_pix; gcv.font = font->fid; NormalGC = fvwmlib_XCreateGC(dpy, main_win, gcm, &gcv); Index: modules//FvwmIdent/FvwmIdent.c =================================================================== RCS file: /home/cvs/fvwm/fvwm/modules/FvwmIdent/FvwmIdent.c,v retrieving revision 1.56 diff -u -r1.56 FvwmIdent.c --- modules//FvwmIdent/FvwmIdent.c 2002/01/17 09:40:51 1.56 +++ modules//FvwmIdent/FvwmIdent.c 2002/01/24 03:05:34 @@ -566,7 +566,11 @@ XSelectInput(dpy, main_win, mw_events); change_window_name(&MyName[1]); +# ifdef I18N_MB + gcm = GCForeground; +# else gcm = GCForeground|GCFont; +# endif gcv.foreground = fore_pix; gcv.font = font->fid; gc = fvwmlib_XCreateGC(dpy, main_win, gcm, &gcv); Index: modules//FvwmPager/x_pager.c =================================================================== RCS file: /home/cvs/fvwm/fvwm/modules/FvwmPager/x_pager.c,v retrieving revision 1.134 diff -u -r1.134 x_pager.c --- modules//FvwmPager/x_pager.c 2002/01/17 09:40:51 1.134 +++ modules//FvwmPager/x_pager.c 2002/01/24 03:05:39 @@ -670,7 +670,11 @@ if (uselabel) { gcv.font = font->fid; Desks[i].NormalGC = +# ifdef I18N_MB + fvwmlib_XCreateGC(dpy, Scr.Pager_w, GCForeground, &gcv); +# else fvwmlib_XCreateGC(dpy, Scr.Pager_w, GCForeground | GCFont, &gcv); +# endif } else { Desks[i].NormalGC = fvwmlib_XCreateGC(dpy, Scr.Pager_w, GCForeground, &gcv); @@ -692,7 +696,11 @@ : Colorset[Desks[i].highcolorset].fg; if (uselabel) { Desks[i].rvGC = +# ifdef I18N_MB + fvwmlib_XCreateGC(dpy, Scr.Pager_w, GCForeground, &gcv); +# else fvwmlib_XCreateGC(dpy, Scr.Pager_w, GCForeground | GCFont, &gcv); +# endif } else { Desks[i].rvGC = fvwmlib_XCreateGC(dpy, Scr.Pager_w, GCForeground, &gcv); @@ -911,7 +919,11 @@ : Colorset[Desks[i].ballooncolorset].fg; Desks[i].BalloonGC = fvwmlib_XCreateGC(dpy, Desks[i].balloon.w, +# ifdef I18N_MB + GCForeground, &gcv); +# else GCFont | GCForeground, &gcv); +# endif /* don't do this yet, wait for map since size will change if (Desks[i].ballooncolorset > -1 && Colorset[Desks[i].ballooncolorset].pixmap) Index: modules//FvwmTaskBar/ButtonArray.c =================================================================== RCS file: /home/cvs/fvwm/fvwm/modules/FvwmTaskBar/ButtonArray.c,v retrieving revision 1.20 diff -u -r1.20 ButtonArray.c --- modules//FvwmTaskBar/ButtonArray.c 2000/11/10 18:09:45 1.20 +++ modules//FvwmTaskBar/ButtonArray.c 2002/01/24 03:05:41 @@ -245,26 +245,22 @@ if (state == BUTTON_BRIGHT || button == StartButton) #ifdef I18N_MB - { - font = SelButtonFont; fontset = SelButtonFontset; - } #else font = SelButtonFont; #endif else #ifdef I18N_MB - { - font = ButtonFont; fontset = ButtonFontset; - } #else font = ButtonFont; #endif +# ifndef I18N_MB gcm = GCFont; gcv.font = font->fid; XChangeGC(dpy, *drawgc, gcm, &gcv); +# endif newx = 4; Index: modules//FvwmTaskBar/FvwmTaskBar.c =================================================================== RCS file: /home/cvs/fvwm/fvwm/modules/FvwmTaskBar/FvwmTaskBar.c,v retrieving revision 1.80 diff -u -r1.80 FvwmTaskBar.c --- modules//FvwmTaskBar/FvwmTaskBar.c 2002/01/19 21:33:15 1.80 +++ modules//FvwmTaskBar/FvwmTaskBar.c 2002/01/24 03:05:45 @@ -1657,7 +1657,11 @@ gcval.font = SelButtonFont->fid; gcval.graphics_exposures = False; +# ifdef I18N_MB + gcmask = GCForeground | GCBackground | GCGraphicsExposures; +# else gcmask = GCForeground | GCBackground | GCFont | GCGraphicsExposures; +# endif /* Normal */ gcval.foreground = pfore; if (graph) Index: modules//FvwmTaskBar/Goodies.c =================================================================== RCS file: /home/cvs/fvwm/fvwm/modules/FvwmTaskBar/Goodies.c,v retrieving revision 1.26 diff -u -r1.26 Goodies.c --- modules//FvwmTaskBar/Goodies.c 2001/11/10 21:19:48 1.26 +++ modules//FvwmTaskBar/Goodies.c 2002/01/24 03:05:47 @@ -116,7 +116,11 @@ pfore = fore; pback = back; } +# ifdef I18N_MB + gcmask = GCForeground | GCBackground | GCGraphicsExposures; +# else gcmask = GCForeground | GCBackground | GCFont | GCGraphicsExposures; +# endif gcval.foreground = pfore; gcval.background = pback; gcval.font = StatusFont->fid; @@ -517,7 +521,11 @@ Tip.win = XCreateWindow(dpy, Root, x, y, w+4, h+4, 0, Pdepth, InputOutput, Pvisual, winattrmask, &winattr); +# ifdef I18N_MB + gcmask = GCForeground | GCBackground | GCGraphicsExposures; +# else gcmask = GCForeground | GCBackground | GCFont | GCGraphicsExposures; +# endif gcval.graphics_exposures = False; gcval.foreground = tip_fore; gcval.background = tip_back; Index: modules//FvwmWharf/stepgfx.c =================================================================== RCS file: /home/cvs/fvwm/fvwm/modules/FvwmWharf/stepgfx.c,v retrieving revision 1.6 diff -u -r1.6 stepgfx.c --- modules//FvwmWharf/stepgfx.c 2000/12/03 15:56:09 1.6 +++ modules//FvwmWharf/stepgfx.c 2002/01/24 03:05:48 @@ -524,7 +524,11 @@ gcv.foreground = 0; gcv.function = GXcopy; gcv.font = font->fid; +# ifdef I18N_MB + gc = fvwmlib_XCreateGC(dpy,mask,GCFunction|GCForeground,&gcv); +# else gc = fvwmlib_XCreateGC(dpy,mask,GCFunction|GCForeground|GCFont,&gcv); +# endif XFillRectangle(dpy,mask,gc,0,0,w,h); XSetForeground(dpy,gc,1); XDrawString(dpy,mask,gc,0,font->ascent,text,chars); Index: modules//FvwmWinList/ButtonArray.c =================================================================== RCS file: /home/cvs/fvwm/fvwm/modules/FvwmWinList/ButtonArray.c,v retrieving revision 1.26 diff -u -r1.26 ButtonArray.c --- modules//FvwmWinList/ButtonArray.c 2000/11/18 23:47:10 1.26 +++ modules//FvwmWinList/ButtonArray.c 2002/01/24 03:05:49 @@ -407,9 +407,11 @@ bottomgc = up ? shadow[set] : hilite[set]; font = ButtonFont; +# ifndef I18N_MB gcm = GCFont; gcv.font = font->fid; XChangeGC(dpy, graph[set], gcm, &gcv); +# endif Fontheight=ButtonFont->ascent+ButtonFont->descent; Index: modules//FvwmWinList/FvwmWinList.c =================================================================== RCS file: /home/cvs/fvwm/fvwm/modules/FvwmWinList/FvwmWinList.c,v retrieving revision 1.92 diff -u -r1.92 FvwmWinList.c --- modules//FvwmWinList/FvwmWinList.c 2002/01/19 21:33:15 1.92 +++ modules//FvwmWinList/FvwmWinList.c 2002/01/24 03:05:53 @@ -1300,7 +1300,11 @@ gcval.foreground=fore[i]; gcval.background=back[i]; gcval.font=ButtonFont->fid; +# ifdef I18N_MB + gcmask=GCForeground|GCBackground; +# else gcmask=GCForeground|GCBackground|GCFont; +# endif graph[i]=fvwmlib_XCreateGC(dpy,win,gcmask,&gcval); if(Pdepth < 2)
I see some I18N_MB changes happend on cvs. Only two (actuaaly three, first is two in one) patches now. Also I ask you for removing idiotic STRICTLY_FIXED either in I18N_MB case or in ASCII/Latin1 (!I18N_MB) -- Alexander Kotelnikov Saint-Petersburg, Russia