]>
Commit | Line | Data |
---|---|---|
3f59180d | 1 | diff -ruN compiz-20060223./plugins/switcher.c compiz-20060223/plugins/switcher.c |
2 | --- compiz-20060223./plugins/switcher.c 2006-02-23 02:36:26.000000000 +0100 | |
3 | +++ compiz-20060223/plugins/switcher.c 2006-02-23 16:33:23.330820040 +0100 | |
4 | @@ -61,6 +61,8 @@ | |
5 | ||
6 | #define SWITCH_MIPMAP_DEFAULT TRUE | |
03b4d665 | 7 | |
8 | +#define SWITCH_ALL_DESKTOPS_DEFAULT TRUE | |
9 | + | |
10 | static char *winType[] = { | |
11 | "Toolbar", | |
12 | "Utility", | |
3f59180d | 13 | @@ -87,7 +89,8 @@ |
03b4d665 | 14 | #define SWITCH_SCREEN_OPTION_TIMESTEP 5 |
15 | #define SWITCH_SCREEN_OPTION_WINDOW_TYPE 6 | |
3f59180d | 16 | #define SWITCH_SCREEN_OPTION_MIPMAP 7 |
17 | -#define SWITCH_SCREEN_OPTION_NUM 8 | |
18 | +#define SWITCH_SCREEN_OPTION_ALL_DESKTOPS 8 | |
19 | +#define SWITCH_SCREEN_OPTION_NUM 9 | |
03b4d665 | 20 | |
21 | typedef struct _SwitchScreen { | |
22 | PreparePaintScreenProc preparePaintScreen; | |
3f59180d | 23 | @@ -240,6 +243,10 @@ |
24 | case SWITCH_SCREEN_OPTION_MIPMAP: | |
25 | if (compSetBoolOption (o, value)) | |
03b4d665 | 26 | return TRUE; |
03b4d665 | 27 | + break; |
28 | + case SWITCH_SCREEN_OPTION_ALL_DESKTOPS: | |
29 | + if (compSetBoolOption (o, value)) | |
30 | + return TRUE; | |
03b4d665 | 31 | default: |
32 | break; | |
33 | } | |
3f59180d | 34 | @@ -339,6 +346,13 @@ |
35 | o->longDesc = "Generate mipmaps when possible for higher quality scaling"; | |
36 | o->type = CompOptionTypeBool; | |
37 | o->value.b = SWITCH_MIPMAP_DEFAULT; | |
03b4d665 | 38 | + |
39 | + o = &ss->opt[SWITCH_SCREEN_OPTION_ALL_DESKTOPS]; | |
3f59180d | 40 | + o->name = "all_dekstops"; |
41 | + o->shortDesc = "All Desktops"; | |
42 | + o->longDesc = "Switch between windows on all virtual desktops"; | |
43 | + o->type = CompOptionTypeBool; | |
44 | + o->value.b = SWITCH_ALL_DESKTOPS_DEFAULT; | |
03b4d665 | 45 | } |
46 | ||
47 | static void | |
3f59180d | 48 | @@ -355,6 +369,7 @@ |
03b4d665 | 49 | static Bool |
50 | isSwitchWin (CompWindow *w) | |
51 | { | |
52 | + int workspaceX, winRealX, winWorkspace; | |
53 | SWITCH_SCREEN (w->screen); | |
54 | ||
55 | if (!w->mapNum || w->attrib.map_state != IsViewable) | |
3f59180d | 56 | @@ -369,6 +384,17 @@ |
03b4d665 | 57 | if (w->state & CompWindowStateSkipPagerMask) |
58 | return FALSE; | |
59 | ||
60 | + if (!ss->opt[SWITCH_SCREEN_OPTION_ALL_DESKTOPS].value.b) | |
61 | + { | |
62 | + /* only switch between windows in the current workspace | |
63 | + Tiago Sousa <mirage@kaotik.org> */ | |
64 | + workspaceX = w->screen->width * w->screen->x; | |
65 | + winRealX = w->serverX + workspaceX; | |
66 | + winWorkspace = floor((double)winRealX / (double)w->screen->width); | |
67 | + if (winWorkspace != w->screen->x) | |
68 | + return FALSE; | |
69 | + } | |
70 | + | |
71 | return TRUE; | |
72 | } | |
73 |