? fvwm-2.5.27.tar.gz
? fvwm-pages-info.patch
? per-screen-ewmhbasestruts.patch
? theoretical-xinerama-snapattraction-fix.patch
? fvwm/.ewmh_names.c.swp
? fvwm/.fvwm.c.swp
? fvwm/.modconf.c.swp
? fvwm/.screen.h.swp
? fvwm/.virtual.c.swp
? fvwm/Session.vim
? modules/FvwmWindowNav
? modules/mods
Index: fvwm/commands.h
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/commands.h,v
retrieving revision 1.47
diff -u -r1.47 commands.h
--- fvwm/commands.h	5 Aug 2007 21:59:10 -0000	1.47
+++ fvwm/commands.h	23 May 2009 00:03:28 -0000
@@ -92,7 +92,8 @@
 	F_NEXT,
 	F_NONE,
 	F_OPAQUE,
-	F_PICK,
+	F_PAGE_NAME,
+    F_PICK,
 	F_PIXMAP_PATH,
 	F_POINTERKEY,
 	F_POINTERWINDOW,
@@ -318,6 +319,7 @@
 P(Nop);
 P(NoWindow);
 P(OpaqueMoveSize);
+P(PageName);
 P(Pick);
 P(PipeRead);
 P(PixmapPath);
Index: fvwm/functable.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/functable.c,v
retrieving revision 1.37
diff -u -r1.37 functable.c
--- fvwm/functable.c	23 Aug 2007 07:01:38 -0000	1.37
+++ fvwm/functable.c	23 May 2009 00:03:29 -0000
@@ -413,6 +413,9 @@
 
 	CMD_ENT("opaquemovesize", CMD_OpaqueMoveSize, F_OPAQUE, 0, 0),
 	/* - Set maximum size window fvwm should move opaquely */
+	
+	CMD_ENT("pagename", CMD_PageName, F_PAGE_NAME, 0, 0),
+	/* Allow for pagenames. */
 
 	CMD_ENT("pick", CMD_Pick, F_PICK, FUNC_NEEDS_WINDOW, CRS_SELECT),
 	/* - Prefix to force a window context, prompted if needed */
Index: fvwm/fvwm.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/fvwm.c,v
retrieving revision 1.404
diff -u -r1.404 fvwm.c
--- fvwm/fvwm.c	17 Mar 2009 17:09:15 -0000	1.404
+++ fvwm/fvwm.c	23 May 2009 00:03:30 -0000
@@ -1177,6 +1177,13 @@
 		Scr.Desktops->ewmh_working_area.width = Scr.MyDisplayWidth;
 	Scr.Desktops->ewmh_dyn_working_area.height =
 		Scr.Desktops->ewmh_working_area.height = Scr.MyDisplayHeight;
+
+	/* Pages information */
+	Scr.Desktops->pi = (PagesInfo *)safemalloc(sizeof(PagesInfo));
+	Scr.Desktops->pi->page_x = 0;
+	Scr.Desktops->pi->page_y = 0;
+	Scr.Desktops->pi->pagename = NULL;
+	Scr.Desktops->pi->next = NULL;
 	Scr.Desktops->next = NULL;
 	/* ewmh desktop */
 	Scr.EwmhDesktop = NULL;
Index: fvwm/screen.h
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/screen.h,v
retrieving revision 1.158
diff -u -r1.158 screen.h
--- fvwm/screen.h	17 Nov 2007 11:47:56 -0000	1.158
+++ fvwm/screen.h	23 May 2009 00:03:30 -0000
@@ -303,6 +303,14 @@
 	} flags;
 } FvwmDecor;
 
+typedef struct PagesInfo
+{
+	int page_x;
+	int page_y;
+	char *pagename;
+	struct PagesInfo *next;
+} PagesInfo;
+
 typedef struct DesktopsInfo
 {
 	int desk;
@@ -323,6 +331,7 @@
 		int height;
 	} ewmh_dyn_working_area;
 
+	struct PagesInfo *pi;
 	struct DesktopsInfo *next;
 } DesktopsInfo;
 
Index: fvwm/virtual.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/virtual.c,v
retrieving revision 1.188
diff -u -r1.188 virtual.c
--- fvwm/virtual.c	17 Nov 2007 11:47:57 -0000	1.188
+++ fvwm/virtual.c	23 May 2009 00:03:32 -0000
@@ -265,11 +265,25 @@
 	int desk;
 	int val[4];
 	int min, max;
+	DesktopsInfo *d;
 
 	if (MatchToken(action, "prev"))
 	{
 		return prev_desk;
 	}
+
+	{
+		d = Scr.Desktops;
+
+		while (d != NULL)
+		{
+			if (StrEquals(d->name, action))
+				return d->desk;
+
+			d = d->next;
+		}	
+	}
+
 	n = GetIntegerArguments(action, NULL, &(val[0]), 4);
 	if (n <= 0)
 	{
@@ -1261,6 +1275,9 @@
 	Scr.Vx = newx;
 	Scr.Vy = newy;
 
+	fprintf (stderr, "Trying to move to:  x = %d | y = %d\n",
+			newx, newy);
+
 	if (deltax || deltay)
 	{
 		BroadcastPacket(
@@ -2268,9 +2285,40 @@
 {
 	int x;
 	int y;
+	DesktopsInfo *d;
+	PagesInfo *pi;
 
 	x = Scr.Vx;
 	y = Scr.Vy;
+	d = Scr.Desktops;
+	while (d != NULL && d->name != NULL && d->desk != Scr.CurrentDesk)
+	{
+		d = d->next;
+	}
+
+	if (d != NULL)
+	{
+		pi = d->pi;
+
+		while (pi != NULL)
+		{
+			if (StrEquals(action, pi->pagename))
+			{
+				char *token;
+				action = SkipNTokens(action, 1);
+				token = PeekToken(action, NULL);
+
+				if (token == NULL)
+					sprintf(action, "%d %d", pi->page_x,
+						pi->page_y);
+
+				break;
+			}
+
+			pi = pi->next;
+		}
+	}
+	
 	if (!get_page_arguments(action, &x, &y))
 	{
 		fvwm_msg(
@@ -2507,3 +2555,100 @@
 
 	return;
 }
+
+void CMD_PageName(F_CMD_ARGS)
+{
+	DesktopsInfo *d;
+	PagesInfo *pi, *t, *new, **prev;
+	int deskandpages[3];
+
+	if ((GetIntegerArguments(action, &action, deskandpages, 3) != 3) &&
+		(deskandpages[0] < 0 || deskandpages[1] < 0 || deskandpages[2] < 0))
+	{
+		fvwm_msg(ERR,"CMD_PageName",
+				"PageName requires three integer arguments.");
+		return;
+	} 
+	else if ((deskandpages[1] > Scr.VxMax || deskandpages[2] > Scr.VyMax)) 
+	{
+		fvwm_msg(ERR,"CMD_PageName",
+				"Page number cannot exceed:  %d %d",
+				Scr.VxMax, Scr.VyMax);
+		return;
+	}
+
+	if (action == NULL || *action == '\n' || strlen(action) == 0)
+	{
+		fvwm_msg(ERR, "CMD_PageName", "Invalid page name:  %s", action);
+		return;
+	}
+
+	d = Scr.Desktops->next;
+	while (d != NULL && d->desk != deskandpages[0])
+	{
+		d = d->next;
+	}
+
+	if( d == NULL )
+	{
+		fvwm_msg(ERR, "CMD_PageName",
+				"DesktopName %d <somename> must happen before using PageName",
+				deskandpages[0]);
+		return;
+	}
+
+	pi = d->pi;
+	
+	if (pi != NULL)
+	{
+		PagesInfo *pitemp = pi->next;
+		while( pitemp != NULL )
+		{
+			if (pitemp->page_x == deskandpages[1] &&
+					pitemp->page_y == deskandpages[2])
+			{
+				free(pitemp->pagename);
+				pitemp->pagename = NULL;
+				CopyString(&pitemp->pagename, action);
+
+				pi = pitemp;
+			}
+			pitemp = pitemp->next;
+		}
+	}
+	else
+	{
+		/* New page entries: add it in order. */
+		pi = Scr.Desktops->pi->next;
+		t = Scr.Desktops->pi;
+		prev = &(Scr.Desktops->pi->next);
+		while (pi != NULL && (pi->page_x <= deskandpages[1] 
+					&& pi->page_y <= deskandpages[2]) )
+		{
+			t = t->next;
+			prev = &(pi->next);
+			pi = pi->next;
+		}
+		if (pi == NULL)
+		{
+			/* Add it at the end. */
+			*prev = (PagesInfo *)safemalloc(
+				sizeof(PagesInfo));
+			memset(*prev, 0, sizeof(PagesInfo));
+			(*prev)->page_x = deskandpages[1];
+			(*prev)->page_y = deskandpages[2];
+			CopyString(&((*prev)->pagename), action);
+		}
+		else
+		{
+			/* Insert it */
+			new = (PagesInfo *)safemalloc(sizeof(PagesInfo));
+			memset(new, 0, sizeof(PagesInfo));
+			new->page_x = deskandpages[1];
+			new->page_y = deskandpages[2];
+			CopyString(&(new->pagename), action);
+			t->next = new;
+			new->next = pi;
+		}
+	}
+}
