]> git.pld-linux.org Git - packages/compiz.git/blob - compiz-switcher-all-desktops.patch
- BR: pkgconfig
[packages/compiz.git] / compiz-switcher-all-desktops.patch
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
7  
8 +#define SWITCH_ALL_DESKTOPS_DEFAULT    TRUE
9 +
10  static char *winType[] = {
11      "Toolbar",
12      "Utility",
13 @@ -87,7 +89,8 @@
14  #define SWITCH_SCREEN_OPTION_TIMESTEP    5
15  #define SWITCH_SCREEN_OPTION_WINDOW_TYPE  6
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
20  
21  typedef struct _SwitchScreen {
22      PreparePaintScreenProc preparePaintScreen;
23 @@ -240,6 +243,10 @@
24      case SWITCH_SCREEN_OPTION_MIPMAP:
25         if (compSetBoolOption (o, value))
26             return TRUE;
27 +       break;
28 +    case SWITCH_SCREEN_OPTION_ALL_DESKTOPS:
29 +       if (compSetBoolOption (o, value))
30 +           return TRUE;
31      default:
32         break;
33      }
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;
38 +
39 +    o = &ss->opt[SWITCH_SCREEN_OPTION_ALL_DESKTOPS];
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;
45  }
46  
47  static void
48 @@ -355,6 +369,7 @@
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)
56 @@ -369,6 +384,17 @@
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  
This page took 0.369018 seconds and 3 git commands to generate.