+++ /dev/null
-diff -ruN compiz-20060317./plugins/switcher.c compiz-20060317/plugins/switcher.c
---- compiz-20060317./plugins/switcher.c 2006-03-17 11:06:52.000000000 +0100
-+++ compiz-20060317/plugins/switcher.c 2006-03-17 16:21:17.806835304 +0100
-@@ -63,6 +63,8 @@
-
- #define SWITCH_BRINGTOFRONT_DEFAULT FALSE
-
-+#define SWITCH_ALL_DESKTOPS_DEFAULT TRUE
-+
- #define SWITCH_SATURATION_DEFAULT 100
- #define SWITCH_SATURATION_MIN 0
- #define SWITCH_SATURATION_MAX 100
-@@ -105,7 +107,8 @@
- #define SWITCH_SCREEN_OPTION_BRIGHTNESS 9
- #define SWITCH_SCREEN_OPTION_OPACITY 10
- #define SWITCH_SCREEN_OPTION_BRINGTOFRONT 11
--#define SWITCH_SCREEN_OPTION_NUM 12
-+#define SWITCH_SCREEN_OPTION_ALL_DESKTOPS 12
-+#define SWITCH_SCREEN_OPTION_NUM 13
-
- typedef struct _SwitchScreen {
- PreparePaintScreenProc preparePaintScreen;
-@@ -292,6 +295,10 @@
- ss->bringToFront = o->value.b;
- return TRUE;
- }
-+ break;
-+ case SWITCH_SCREEN_OPTION_ALL_DESKTOPS:
-+ if (compSetBoolOption (o, value))
-+ return TRUE;
- default:
- break;
- }
-@@ -425,6 +432,13 @@
- o->longDesc = "Bring selected window to front";
- o->type = CompOptionTypeBool;
- o->value.b = SWITCH_BRINGTOFRONT_DEFAULT;
-+
-+ o = &ss->opt[SWITCH_SCREEN_OPTION_ALL_DESKTOPS];
-+ o->name = "all_desktops";
-+ o->shortDesc = "All Desktops";
-+ o->longDesc = "Switch between windows on all virtual desktops";
-+ o->type = CompOptionTypeBool;
-+ o->value.b = SWITCH_ALL_DESKTOPS_DEFAULT;
- }
-
- static void
-@@ -441,6 +455,7 @@
- static Bool
- isSwitchWin (CompWindow *w)
- {
-+ int workspaceX, winRealX, winWorkspace;
- SWITCH_SCREEN (w->screen);
-
- if (!w->mapNum || w->attrib.map_state != IsViewable)
-@@ -455,6 +470,17 @@
- if (w->state & CompWindowStateSkipPagerMask)
- return FALSE;
-
-+ if (!ss->opt[SWITCH_SCREEN_OPTION_ALL_DESKTOPS].value.b)
-+ {
-+ /* only switch between windows in the current workspace
-+ Tiago Sousa <mirage@kaotik.org> */
-+ workspaceX = w->screen->width * w->screen->x;
-+ winRealX = w->serverX + workspaceX;
-+ winWorkspace = floor((double)winRealX / (double)w->screen->width);
-+ if (winWorkspace != w->screen->x)
-+ return FALSE;
-+ }
-+
- return TRUE;
- }
-