]> git.pld-linux.org Git - packages/compiz.git/blob - compiz-switcher-all-desktops.patch
- obsolete
[packages/compiz.git] / compiz-switcher-all-desktops.patch
1 diff -ruN compiz-20060222./plugins/switcher.c compiz-20060222/plugins/switcher.c
2 --- compiz-20060222./plugins/switcher.c 2006-02-22 03:27:31.000000000 +0100
3 +++ compiz-20060222/plugins/switcher.c  2006-02-22 21:47:13.744958456 +0100
4 @@ -59,6 +59,8 @@
5  #define SWITCH_TIMESTEP_MAX       50.0f
6  #define SWITCH_TIMESTEP_PRECISION 0.1f
7  
8 +#define SWITCH_ALL_DESKTOPS_DEFAULT    TRUE
9 +
10  static char *winType[] = {
11      "Toolbar",
12      "Utility",
13 @@ -84,7 +86,8 @@
14  #define SWITCH_SCREEN_OPTION_SPEED       4
15  #define SWITCH_SCREEN_OPTION_TIMESTEP    5
16  #define SWITCH_SCREEN_OPTION_WINDOW_TYPE  6
17 -#define SWITCH_SCREEN_OPTION_NUM          7
18 +#define SWITCH_SCREEN_OPTION_ALL_DESKTOPS 7
19 +#define SWITCH_SCREEN_OPTION_NUM          8
20  
21  typedef struct _SwitchScreen {
22      PreparePaintScreenProc preparePaintScreen;
23 @@ -233,6 +236,11 @@
24             ss->wMask = compWindowTypeMaskFromStringList (&o->value);
25             return TRUE;
26         }
27 +       break;
28 +    case SWITCH_SCREEN_OPTION_ALL_DESKTOPS:
29 +       if (compSetBoolOption (o, value))
30 +           return TRUE;
31 +       break;
32      default:
33         break;
34      }
35 @@ -325,6 +333,13 @@
36      o->rest.s.nString    = nWindowTypeString;
37  
38      ss->wMask = compWindowTypeMaskFromStringList (&o->value);
39 +
40 +    o = &ss->opt[SWITCH_SCREEN_OPTION_ALL_DESKTOPS];
41 +    o->name      = "all_dekstops";
42 +    o->shortDesc = "All Desktops";
43 +    o->longDesc  = "Switch between windows on all virtual desktops";
44 +    o->type      = CompOptionTypeBool;
45 +    o->value.b   = SWITCH_ALL_DESKTOPS_DEFAULT;
46  }
47  
48  static void
49 @@ -341,6 +356,7 @@
50  static Bool
51  isSwitchWin (CompWindow *w)
52  {
53 +    int workspaceX, winRealX, winWorkspace;
54      SWITCH_SCREEN (w->screen);
55  
56      if (!w->mapNum || w->attrib.map_state != IsViewable)
57 @@ -355,6 +371,17 @@
58      if (w->state & CompWindowStateSkipPagerMask)
59         return FALSE;
60  
61 +    if (!ss->opt[SWITCH_SCREEN_OPTION_ALL_DESKTOPS].value.b)
62 +    {
63 +           /* only switch between windows in the current workspace
64 +              Tiago Sousa <mirage@kaotik.org> */
65 +           workspaceX = w->screen->width * w->screen->x;
66 +           winRealX = w->serverX + workspaceX;
67 +           winWorkspace = floor((double)winRealX / (double)w->screen->width);
68 +           if (winWorkspace != w->screen->x)
69 +               return FALSE;
70 +    }
71 +
72      return TRUE;
73  }
74  
This page took 0.05519 seconds and 3 git commands to generate.