Subject: FvwmProxy Beta

From: [email-masked]
Date: Tue, 15 Oct 2002 09:55:35 -0700

http://freshmeat.net/projects/fvwmproxy

-- 
  _
 ( \      _  \    /_ /  _ _  Jason Weber                  (503) 380-7424
  \|(\/)()))  \/\/(-/_)(-/(  Infinite Monkeys Inc.        Aloha, Oregon
  //                         http://www.imonk.com/baboon  [email-masked]
 (/     [email-masked]        [email-masked]

     "Canister contains at least 50% recycled material; 15%
      post-consumer content."
   -- Pringles Fat-Free (side of can)
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 15 Oct 2002 19:07:11 +0200

> http://freshmeat.net/projects/fvwmproxy

Cool idea, I like that.  That would definitely be a wirthwhile
addition to the distribution.  I've got to try it out myself.
Does it work with 2.5.x?

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, mail: [email-masked], phone: 0721/91374-382
Schlund + Partner AG, Erbprinzenstr. 4-12, D-76133 Karlsruhe
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 15 Oct 2002 19:27:45 +0200

> addition to the distribution.  I've got to try it out myself.

The more I think about it, the more I like the idea.  There are
infinite ways to develop it further.  For example, it would make
an excellent Alt-Tab replacement:

 * Make the triggered actions and the keys configurable.
 * Add keyboard support.
 * Add remote control functionality ("show proxies",
   "select proxy", "hide proxies")

For example, when pressing Alt-Tab the first time, fvwm would send
a "show proxies" message to the module.  Pressing Tab repeatedly
would cycle through the windows with any built-in command, e.g.
"Next", optionally selecting each window would trigger an action.
Then, after releasing the Alt key, fvwm would send a
"hide proxies" message and probably trigger another action.

Bye

Dominik ^_^  ^_^

---

From: Olivier Chapuis <[email-masked]>
Date: Tue, 15 Oct 2002 22:31:15 +0200

> 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)

---

From: [email-masked]
Date: Tue, 22 Oct 2002 22:09:12 -0700

> "hide proxies" message and probably trigger another action.

Ok, I got "Next" working using:
	Key Tab     A   M   SendToModule    FvwmProxy   Next

I can get a "Show" on the Alt press using:
	Key Alt_L   A   N   SendToModule    FvwmProxy   Show

But, I've yet to figure out how to config for the Alt release.
There's that windowlist menustyle of SelectOnRelease,
but I'm not sure that can apply.

For now, I still stuck with Alt polling for the release.

---

From: Dominik Vogt <[email-masked]>
Date: Wed, 23 Oct 2002 11:10:49 +0200

> For now, I still stuck with Alt polling for the release.

Uh, I didn't want to suggest that you have to do all the things I
listed yourself.  

Would you like to add your module to the fvwm source tree?  Of
course you would have full access to the sources.  You might want
to consider:

 + Reduces future maintenance work.
 + We would automatically add some nifty features like colorset
   support, i18n support etc.
 + More people can help you implementing some nifty stuff.
 + It would be maintained in the future, even if you ever lose
   interest in continuing the work.
 + It will automatically be adapted to all module interface
   changes.
 + Your module would be distributed with each and every copy of
   fvwm.

 - It would only be added to the 2.5.x development branch.
 - You would have to respect code and feature freezes when fvwm is
   getting close to the next stable release.
 - We would appreciate if the module was formatted with the new
   indentation style used in the core, but this is not a must.
   (indentation with tabs = 8 spaces).
 - It must use the Gnu Public License.

It's your decision, but I hope you can tolerate the drawbacks for
the benefits.

Bye

Dominik ^_^  ^_^

---

From: [email-masked]
Date: Wed, 23 Oct 2002 20:58:41 -0700

> It's your decision, but I hope you can tolerate the drawbacks for

It is very much my intent to add this module to the primary source tree.
However,  I want to get it in my core features and give it some
reasonable cleanup and testing before letting it loose.

The terms are perfectly acceptable.  You might want to talk to some of the
other people about 2-space indentation.  I am willing to switch my tab
formatting from 4 to 8, but I'm not necessarily willing to be happy about it.

---

From: Dominik Vogt <[email-masked]>
Date: Sat, 26 Oct 2002 12:38:11 +0200

> reasonable cleanup and testing before letting it loose.

I understand, but I think it wouldn't hurt to include it earlier.
It is easy to just include it in the tarbell and make it build
the executable without installing anything.  Just say a word and
I will add the necessary logic.

> The terms are perfectly acceptable.

> You might want to talk to some of the

We have switched to 8 spaces per tab only recently.  The 2 space
indentation will go away gradually in the libs/ and fvwm/
directories.  It's all not critical in the modules, though.

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]