--- WPrefs.app/KeyboardShortcuts.c.orig 2005-07-13 10:08:34.482171159 +0100
+++ WPrefs.app/KeyboardShortcuts.c      2005-07-13 10:10:54.486799654 +0100
@@ -87,6 +87,8 @@
     "SelectKey",
     "FocusNextKey",
     "FocusPrevKey",
+    "GroupNextKey",
+    "GroupPrevKey",
     "NextWorkspaceKey",
     "PrevWorkspaceKey",
     "NextWorkspaceLayerKey",
@@ -515,6 +517,8 @@
     WMAddListItem(panel->actLs, _("Select active window"));
     WMAddListItem(panel->actLs, _("Focus next window"));
     WMAddListItem(panel->actLs, _("Focus previous window"));
+    WMAddListItem(panel->actLs, _("Focus next group window"));
+    WMAddListItem(panel->actLs, _("Focus previous group window"));
     WMAddListItem(panel->actLs, _("Switch to next workspace"));
     WMAddListItem(panel->actLs, _("Switch to previous workspace"));
     WMAddListItem(panel->actLs, _("Switch to next ten workspaces"));
--- src/defaults.c.orig 2005-07-13 09:37:48.603435640 +0100
+++ src/defaults.c      2005-07-13 10:09:18.403466038 +0100
@@ -728,6 +728,12 @@
     {"FocusPrevKey", "None",			(void*)WKBD_FOCUSPREV,
     NULL,				getKeybind,	setKeyGrab
     },
+    {"GroupNextKey", "None",			(void*)WKBD_GROUPNEXT,
+    NULL,				getKeybind,	setKeyGrab
+    },
+    {"GroupPrevKey", "None",			(void*)WKBD_GROUPPREV,
+    NULL,				getKeybind,	setKeyGrab
+    },
     {"NextWorkspaceKey", "None",		(void*)WKBD_NEXTWORKSPACE,
     NULL,				getKeybind,	setKeyGrab
     },
--- src/switchpanel.c.orig      2005-07-13 09:37:09.832328104 +0100
+++ src/switchpanel.c 2007-08-29 12:21:22.000000000 +0100
@@ -399,7 +399,7 @@
 
 
 static WMArray *makeWindowListArray(WScreen *scr, WWindow *curwin, int workspace,
-                                    int include_unmapped)
+                                    int include_unmapped, Bool osx)
 {
     WMArray *windows= WMCreateArray(10);
     int fl;
@@ -410,6 +410,12 @@
             if (((!fl && canReceiveFocus(wwin) > 0) || (fl && canReceiveFocus(wwin) < 0)) &&
                 (!WFLAGP(wwin, skip_window_list) || wwin->flags.internal_window) &&
                 (wwin->flags.mapped || include_unmapped)) {
+                if (osx) {
+                    if (!wwin->wm_class || !curwin->wm_class)
+                        continue;
+                    if (strcmp(wwin->wm_class, curwin->wm_class))
+                        continue;
+                }
                 WMAddToArray(windows, wwin);
             }
         }
@@ -422,6 +428,12 @@
             if (((!fl && canReceiveFocus(wwin) > 0) || (fl && canReceiveFocus(wwin) < 0)) &&
                 (!WFLAGP(wwin, skip_window_list) || wwin->flags.internal_window) &&
                 (wwin->flags.mapped || include_unmapped)) {
+                if (osx) {
+                    if (!wwin->wm_class || !curwin->wm_class)
+                        continue;
+                    if (strcmp(wwin->wm_class, curwin->wm_class))
+                        continue;
+                }
                 WMAddToArray(windows, wwin);
             }
         }
@@ -434,7 +446,7 @@
 
 
 
-WSwitchPanel *wInitSwitchPanel(WScreen *scr, WWindow *curwin, int workspace)
+WSwitchPanel *wInitSwitchPanel(WScreen *scr, WWindow *curwin, int workspace, Bool osx)
 {
     WWindow *wwin;
     WSwitchPanel *panel= wmalloc(sizeof(WSwitchPanel));
@@ -451,7 +463,7 @@ WSwitchPanel *wInitSwitchPanel(WScreen *scr, WWindow *curwin, int workspace)
     panel->scr= scr;
 
     panel->windows= makeWindowListArray(scr, curwin, workspace,
-                                        wPreferences.swtileImage!=0);
+                                        wPreferences.swtileImage!=0, osx);
     count= WMGetArrayItemCount(panel->windows);
     
     if (count == 0) {
--- src/event.c.orig    2005-07-13 09:42:03.770659904 +0100
+++ src/event.c 2005-07-13 09:42:40.767038529 +0100
@@ -1531,11 +1531,19 @@
         }
         break;
     case WKBD_FOCUSNEXT:
-        StartWindozeCycle(wwin, event, True);
+        StartWindozeCycle(wwin, event, True, False);
         break;
 
     case WKBD_FOCUSPREV:
-        StartWindozeCycle(wwin, event, False);
+        StartWindozeCycle(wwin, event, False, False);
+        break;
+
+    case WKBD_GROUPNEXT:
+        StartWindozeCycle(wwin, event, True, True);
+        break;
+
+    case WKBD_GROUPPREV:
+        StartWindozeCycle(wwin, event, False, True);
         break;
 
 #if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)
--- src/funcs.h.orig    2005-07-13 09:42:53.480106894 +0100
+++ src/funcs.h 2005-07-13 09:43:11.791324706 +0100
@@ -92,7 +92,7 @@
                  unsigned int width, unsigned int height);
 
 
-void StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next);
+void StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next, Bool osx);
 
 #ifdef USECPP
 char *MakeCPPArgs(char *path);
--- src/switchpanel.h.orig      2005-07-13 09:44:52.848970813 +0100
+++ src/switchpanel.h   2005-07-13 09:45:09.319468536 +0100
@@ -24,7 +24,7 @@
 
 typedef struct SwitchPanel WSwitchPanel;
 
-WSwitchPanel *wInitSwitchPanel(WScreen *scr, WWindow *curwin, int workspace);
+WSwitchPanel *wInitSwitchPanel(WScreen *scr, WWindow *curwin, int workspace, Bool osx);
 
 void wSwitchPanelDestroy(WSwitchPanel *panel);
 
--- src/keybind.h.orig  2005-07-13 09:37:59.355801520 +0100
+++ src/keybind.h       2005-07-13 09:39:37.026958373 +0100
@@ -48,41 +48,43 @@
 /* window */
 #define WKBD_FOCUSNEXT		19
 #define WKBD_FOCUSPREV          20
+#define WKBD_GROUPNEXT		21
+#define WKBD_GROUPPREV		22
 
-#define WKBD_WORKSPACE1		21
-#define WKBD_WORKSPACE2		22
-#define WKBD_WORKSPACE3		23
-#define WKBD_WORKSPACE4		24
-#define WKBD_WORKSPACE5		25
-#define WKBD_WORKSPACE6		26
-#define WKBD_WORKSPACE7		27
-#define WKBD_WORKSPACE8		28
-#define WKBD_WORKSPACE9		29
-#define WKBD_WORKSPACE10	30
-#define WKBD_NEXTWORKSPACE	31
-#define WKBD_PREVWORKSPACE	32
-#define WKBD_NEXTWSLAYER	33
-#define WKBD_PREVWSLAYER	34
+#define WKBD_WORKSPACE1		23
+#define WKBD_WORKSPACE2		24
+#define WKBD_WORKSPACE3		25
+#define WKBD_WORKSPACE4		26
+#define WKBD_WORKSPACE5		27
+#define WKBD_WORKSPACE6		28
+#define WKBD_WORKSPACE7		29
+#define WKBD_WORKSPACE8		30
+#define WKBD_WORKSPACE9		31
+#define WKBD_WORKSPACE10	32
+#define WKBD_NEXTWORKSPACE	33
+#define WKBD_PREVWORKSPACE	34
+#define WKBD_NEXTWSLAYER	35
+#define WKBD_PREVWSLAYER	36
 
 /* window shortcuts */
-#define WKBD_WINDOW1		35
-#define WKBD_WINDOW2		36
-#define WKBD_WINDOW3		37
-#define WKBD_WINDOW4		38
-#define WKBD_WINDOW5		39
-#define WKBD_WINDOW6		40
-#define WKBD_WINDOW7		41
-#define WKBD_WINDOW8		42
-#define WKBD_WINDOW9		43
-#define WKBD_WINDOW10		44
+#define WKBD_WINDOW1		37
+#define WKBD_WINDOW2		38
+#define WKBD_WINDOW3		39
+#define WKBD_WINDOW4		40
+#define WKBD_WINDOW5		41
+#define WKBD_WINDOW6		42
+#define WKBD_WINDOW7		43
+#define WKBD_WINDOW8		44
+#define WKBD_WINDOW9		45
+#define WKBD_WINDOW10		46
 
-#define WKBD_SWITCH_SCREEN      45
+#define WKBD_SWITCH_SCREEN      47
 
 #ifdef KEEP_XKB_LOCK_STATUS
-# define WKBD_TOGGLE		46
-# define WKBD_TMP		47
+# define WKBD_TOGGLE		48
+# define WKBD_TMP		49
 #else
-# define WKBD_TMP		46
+# define WKBD_TMP		48
 #endif
 
 #ifdef VIRTUAL_DESKTOP
--- src/cycling.c.orig  2005-07-13 10:42:01.642717054 +0100
+++ src/cycling.c       2005-07-13 10:55:32.866899159 +0100
@@ -65,7 +65,7 @@
 
 
 void
-StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
+StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next, Bool osx)
 {
     WScreen *scr = wScreenForRootWindow(event->xkey.root);
     Bool done = False;
@@ -106,7 +106,7 @@
 
     scr->flags.doing_alt_tab = 1;
 
-    swpanel =  wInitSwitchPanel(scr, wwin, scr->current_workspace);
+    swpanel =  wInitSwitchPanel(scr, wwin, scr->current_workspace, osx);
     oldFocused = wwin;
   
     if (swpanel) {
@@ -143,6 +143,8 @@
 #endif
             if ((wKeyBindings[WKBD_FOCUSNEXT].keycode == ev.xkey.keycode
                  && wKeyBindings[WKBD_FOCUSNEXT].modifier == modifiers)
+                 || (wKeyBindings[WKBD_GROUPNEXT].keycode == ev.xkey.keycode
+                 && wKeyBindings[WKBD_GROUPNEXT].modifier == modifiers)
                 || ev.xkey.keycode == rightKey) {
 
                 if (swpanel) {
@@ -159,6 +161,8 @@
                 }
             } else if ((wKeyBindings[WKBD_FOCUSPREV].keycode == ev.xkey.keycode
                         && wKeyBindings[WKBD_FOCUSPREV].modifier == modifiers)
+                        || (wKeyBindings[WKBD_GROUPPREV].keycode == ev.xkey.keycode
+                        && wKeyBindings[WKBD_GROUPPREV].modifier == modifiers)
                        || ev.xkey.keycode == leftKey) {
 
                 if (swpanel) {
@@ -201,6 +205,7 @@
             for (i = 0; i < 8 * keymap->max_keypermod; i++) {
                 if (keymap->modifiermap[i] == ev.xkey.keycode &&
                     wKeyBindings[WKBD_FOCUSNEXT].modifier
+                    | wKeyBindings[WKBD_GROUPNEXT].modifier
                     & 1<<(i/keymap->max_keypermod)) {
                     done = True;
                     break;
