On Tue, Oct 15, 2002 at 09:55:35AM -0700, [EMAIL PROTECTED] wrote: > http://freshmeat.net/projects/fvwmproxy >
Here a patch that allows compilation on my machine with 2.5.4 from cvs. It get pbs with desk switching, I do not know if my fix is really ok. I think some works is needed. I may help with the new 2.5.x font and image rendering API. Regards, Olivier
diff -u FvwmProxy.orig/FvwmProxy.c FvwmProxy/FvwmProxy.c --- FvwmProxy.orig/FvwmProxy.c Mon Oct 14 20:29:19 2002 +++ FvwmProxy/FvwmProxy.c Tue Oct 15 22:11:51 2002 @@ -35,7 +35,7 @@ void RaiseProxys(void); ProxyWindow *FindProxy(Window window); void DrawWindow(Window window,int x,int y,int w,int h); -void DrawPicture(Window window,int x,int y,Picture *picture); +void DrawPicture(Window window,int x,int y,FvwmPicture *picture); /////////////////////////////////////////////////////////////////////////////// //* Globals @@ -177,7 +177,7 @@ fflush(errorFile); } - InitPictureCMap(dpy); + PictureInitCMap(dpy); AllocColorset(0); screen = DefaultScreen(dpy); gcon = DefaultGC(dpy,screen); @@ -281,7 +281,7 @@ int root_x_return, root_y_return; int win_x_return, win_y_return; unsigned int mask_return; - Bool query=XQueryPointer(dpy,rootWindow,&root_return,&child_return, + Bool query=FQueryPointer(dpy,rootWindow,&root_return,&child_return, &root_x_return,&root_y_return, &win_x_return,&win_y_return,&mask_return); @@ -318,9 +318,9 @@ timevalue.tv_usec = 100000; // timeout=NULL; - if(XPending(dpy)) + if(FPending(dpy)) { - XNextEvent(dpy,event); + FNextEvent(dpy,event); return 1; } @@ -332,9 +332,9 @@ { if(FD_ISSET(x_fd, &in_fdset)) { - if(XPending(dpy)) + if(FPending(dpy)) { - XNextEvent(dpy,event); + FNextEvent(dpy,event); return 1; } } @@ -383,11 +383,11 @@ if(!skipWindow) { + ProxyWindow *newwin=new_ProxyWindow(); if(!target) target=rootWindow; fprintf(errorFile,"0x%x\n",target); - ProxyWindow *newwin=new_ProxyWindow(); newwin->window=target; newwin->x=wx; newwin->y=wy; @@ -428,11 +428,13 @@ case M_NEW_DESK: deskNumber=body[0]; fprintf(errorFile,"M_NEW_DESK %d\n",deskNumber); +#if 0 /* cause pb when you switch desk -- olicha */ if(!rebuildList) { EndProxys(); StartProxys(); } +#endif break; case M_MINI_ICON: fprintf(errorFile,"M_MINI_ICON\n"); @@ -448,10 +450,11 @@ case M_RAISE_WINDOW: raise=TRUE; case M_LOWER_WINDOW: - fprintf(errorFile,"M_%s_WINDOW ",raise? "RAISE": "LOWER"); + { struct ConfigWinPacket *cfgpacket=(void*)body; Window target=cfgpacket->w; ProxyWindow *proxy=firstWindow; + fprintf(errorFile,"M_%s_WINDOW ",raise? "RAISE": "LOWER"); while(proxy && proxy->proxy!=target) proxy=proxy->next; fprintf(errorFile,"proxy=0x%x skipRaise=%d raise=%d\n", @@ -472,7 +475,8 @@ RaiseProxys(); } raiseLock=TRUE; - break; + } + break; case M_RES_CLASS: fprintf(errorFile,"M_RES_CLASS\n"); @@ -545,8 +549,9 @@ case LeaveNotify: break; case ButtonPress: - fprintf(errorFile,"ButtonPress %d\n",pEvent->xbutton.button); + { ProxyWindow *proxy=firstWindow; + fprintf(errorFile,"ButtonPress %d\n",pEvent->xbutton.button); while(proxy && proxy->proxy!=window) proxy=proxy->next; if(proxy) @@ -557,7 +562,8 @@ else if(pEvent->xbutton.button==Button3) XLowerWindow(dpy,proxy->window); } - break; + } + break; case ButtonRelease: fprintf(errorFile,"ButtonRelease %d\n",pEvent->xbutton.button); break; @@ -583,9 +589,9 @@ while(collision) { + ProxyWindow *proxy=firstWindow; collision=FALSE; - ProxyWindow *proxy=firstWindow; while(proxy) { ProxyWindow *other=proxy->next; @@ -646,9 +652,10 @@ int border=0; unsigned long valuemask=CWOverrideRedirect; XSetWindowAttributes attributes; + ProxyWindow *proxy=firstWindow; + attributes.override_redirect = True; - ProxyWindow *proxy=firstWindow; while(proxy) { sizehints.x=proxy->proxyx; @@ -718,11 +725,12 @@ int ascent; int descent; XCharStruct overall; - XTextExtents(font,"Xy",2,&direction,&ascent,&descent,&overall); - ProxyWindow *proxy=FindProxy(window); - char *iconname=proxy? proxy->iconname: ""; + int edge, top; + + XTextExtents(font,"Xy",2,&direction,&ascent,&descent,&overall); + if(proxy) { x=0; @@ -731,9 +739,9 @@ h=proxy->proxyh; } - int edge=(w-XTextWidth(font,iconname,strlen(iconname)))/2; -// int top=h-descent-4; - int top=(h+ascent-descent)/2; // center + edge=(w-XTextWidth(font,iconname,strlen(iconname)))/2; +// top=h-descent-4; + top=(h+ascent-descent)/2; // center top+=8; // HACK tweak if(edge<5) @@ -767,7 +775,7 @@ } -void DrawPicture(Window window,int x,int y,Picture *picture) +void DrawPicture(Window window,int x,int y,FvwmPicture *picture) { XGCValues gcv; unsigned long gcm=(GCClipMask|GCClipXOrigin|GCClipYOrigin); diff -u FvwmProxy.orig/FvwmProxy.h FvwmProxy/FvwmProxy.h --- FvwmProxy.orig/FvwmProxy.h Mon Oct 14 20:30:26 2002 +++ FvwmProxy/FvwmProxy.h Tue Oct 15 21:42:01 2002 @@ -49,6 +49,7 @@ #include "libs/fvwmsignal.h" #include "fvwm/fvwm.h" #include "libs/vpacket.h" +#include "libs/PictureBase.h" typedef struct sProxyWindow { @@ -58,7 +59,7 @@ Window proxy; int proxyx,proxyy; int proxyw,proxyh; - Picture picture; + FvwmPicture picture; char *name; char *iconname; struct sProxyWindow *next; diff -u FvwmProxy.orig/Makefile.am FvwmProxy/Makefile.am --- FvwmProxy.orig/Makefile.am Mon Oct 14 20:30:46 2002 +++ FvwmProxy/Makefile.am Tue Oct 15 21:55:58 2002 @@ -16,7 +16,7 @@ ## there are sometimes dependencies through functions in libfvwm ## so we might as well link against libXpm, if present. LDADD = -L$(top_builddir)/libs $(X_LIBS) -lfvwm $(xpm_LIBS) \ - $(X_PRE_LIBS) -lXext -lX11 $(X_EXTRA_LIBS) -lm + $(X_PRE_LIBS) -lXext -lX11 $(X_EXTRA_LIBS) $(Xrender_LIBS) -lm -INCLUDES = -I$(top_srcdir) $(xpm_CFLAGS) $(X_CFLAGS) +INCLUDES = -I$(top_srcdir) $(xpm_CFLAGS) $(X_CFLAGS) $(Xrender_CFLAGS)