updated on Thu Jan 12 08:01:00 UTC 2012
[aur-mirror.git] / awn-extras-applets / fix-shinyswitcher-scrolling.patch
blob69dcae9c143b4aa52ca02b5b584e0d528df1ec09
1 === modified file 'applets/maintained/shiny-switcher/shinyswitcherapplet.c'
2 --- applets/maintained/shiny-switcher/shinyswitcherapplet.c 2010-09-12 16:15:07 +0000
3 +++ applets/maintained/shiny-switcher/shinyswitcherapplet.c 2010-11-02 13:52:43 +0000
4 @@ -769,7 +769,7 @@
7 static gboolean
8 -_scroll_event(GtkWidget *widget, GdkEventMotion *event, AwnShinySwitcher *shinyswitcher)
9 +_scroll_event(GtkWidget *widget, GdkEventScroll *event, AwnShinySwitcher *shinyswitcher)
11 AwnShinySwitcherPrivate * priv = GET_PRIVATE (shinyswitcher);
12 WnckWorkspace *cur_space = wnck_screen_get_active_workspace(priv->wnck_screen);
13 @@ -779,7 +779,7 @@
15 if (event->type == GDK_SCROLL)
17 - WnckMotionDirection direction1, direction2;
18 + WnckMotionDirection left, right, up, down;
20 switch (priv->mousewheel)
22 @@ -787,8 +787,10 @@
23 case 1:
25 case 3:
26 - direction1 = WNCK_MOTION_LEFT;
27 - direction2 = WNCK_MOTION_RIGHT;
28 + left = WNCK_MOTION_LEFT;
29 + right = WNCK_MOTION_RIGHT;
30 + up = WNCK_MOTION_UP;
31 + down = WNCK_MOTION_DOWN;
32 break;
34 case 2:
35 @@ -796,22 +798,52 @@
36 case 4:
38 default:
39 - direction1 = WNCK_MOTION_RIGHT;
40 - direction2 = WNCK_MOTION_LEFT;
42 + left = WNCK_MOTION_RIGHT;
43 + right = WNCK_MOTION_LEFT;
44 + up = WNCK_MOTION_DOWN;
45 + down = WNCK_MOTION_UP;
48 - if (event->state & GDK_SHIFT_MASK)
49 + if ( (event->direction == GDK_SCROLL_UP) ||
50 + (event->direction == GDK_SCROLL_LEFT) )
52 - new_space = wnck_workspace_get_neighbor(cur_space, WNCK_MOTION_RIGHT);
53 + new_space = wnck_workspace_get_neighbor(cur_space, left);
54 + if (new_space == NULL)
55 + {
56 + new_space = wnck_workspace_get_neighbor(cur_space, up);
57 + if (new_space)
58 + {
59 + for (cur_space = new_space; cur_space; )
60 + {
61 + cur_space = wnck_workspace_get_neighbor(cur_space, right);
62 + if (cur_space)
63 + {
64 + new_space = cur_space;
65 + }
66 + }
67 + }
68 + }
70 else
72 - new_space = wnck_workspace_get_neighbor(cur_space, WNCK_MOTION_LEFT);
74 + new_space = wnck_workspace_get_neighbor(cur_space, right);
75 + if (!new_space)
76 + {
77 + new_space = wnck_workspace_get_neighbor(cur_space, down);
78 + if (new_space)
79 + {
80 + for (cur_space = new_space; cur_space; )
81 + {
82 + cur_space = wnck_workspace_get_neighbor(cur_space, left);
83 + if (cur_space)
84 + {
85 + new_space = cur_space;
86 + }
87 + }
88 + }
89 + }
93 if (new_space)
95 wnck_workspace_activate(new_space, event->time); /* FIXME */