Merge lp:~bfiller/unity-2d/metacity-cycle-workspace-switcher into lp:~unity-2d-team/unity-2d/metacity

Proposed by Bill Filler
Status: Merged
Merged at revision: 103
Proposed branch: lp:~bfiller/unity-2d/metacity-cycle-workspace-switcher
Merge into: lp:~unity-2d-team/unity-2d/metacity
Diff against target: 210 lines (+183/-13)
2 files modified
debian/changelog (+8/-0)
debian/patches/17-workspace-switcher-cycle.patch (+175/-13)
To merge this branch: bzr merge lp:~bfiller/unity-2d/metacity-cycle-workspace-switcher
Reviewer Review Type Date Requested Status
Florian Boucault Pending
Review via email: mp+49314@code.launchpad.net

Description of the change

updated to make this option configurable via gconf key/apps/metacity/general/workspace_switcher_keyboard_cycle. The default is false so metacity workspace switcher functionality unchanged unless user explicitly op's in. Also added support for multi-row workspace switcher layouts, such that right to left top to bottom is honored when this option enabled.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2011-02-08 22:29:50 +0000
3+++ debian/changelog 2011-02-10 22:43:55 +0000
4@@ -1,3 +1,11 @@
5+metacity (1:2.30.2-0ubuntu1upicek7) maverick; urgency=low
6+
7+ * 17-workspace-switcher-cycle.patch: update to be configurable
8+ via gconf /apps/metacity/general/workspace_switcher_keyboard_cycle.
9+ Added support for multi-row workspace switcher layouts.
10+
11+ -- Bill Filler <bill.filler@canonical.com> Thu, 10 Feb 2011 15:14:50 -0500
12+
13 metacity (1:2.30.2-0ubuntu1upicek6) maverick; urgency=low
14
15 * debian/patches/17-workspace-switcher-cycle.patch: added patch
16
17=== modified file 'debian/patches/17-workspace-switcher-cycle.patch'
18--- debian/patches/17-workspace-switcher-cycle.patch 2011-02-08 22:29:50 +0000
19+++ debian/patches/17-workspace-switcher-cycle.patch 2011-02-10 22:43:55 +0000
20@@ -1,15 +1,177 @@
21-diff -Nur -x '*.orig' -x '*~' metacity-2.30.2//src/core/workspace.c metacity-2.30.2.new//src/core/workspace.c
22---- metacity-2.30.2//src/core/workspace.c 2011-02-08 17:17:36.000000000 -0500
23-+++ metacity-2.30.2.new//src/core/workspace.c 2011-02-08 17:23:00.628654844 -0500
24-@@ -840,9 +840,9 @@
25- }
26-
27- if (layout.current_col < 0)
28+Index: metacity-2.30.2/src/core/prefs.c
29+===================================================================
30+--- metacity-2.30.2.orig/src/core/prefs.c 2011-02-10 17:29:08.118485807 -0500
31++++ metacity-2.30.2/src/core/prefs.c 2011-02-10 17:29:08.138485359 -0500
32+@@ -100,6 +100,7 @@
33+ static gboolean hide_decorator_tooltip = FALSE;
34+ static gboolean show_maximized_titlebars = TRUE;
35+ static gboolean capture_before_unmap = FALSE;
36++static gboolean workspace_switcher_keyboard_cycle = FALSE;
37+
38+ static MetaVisualBellType visual_bell_type = META_VISUAL_BELL_FULLSCREEN_FLASH;
39+ static MetaButtonLayout button_layout;
40+@@ -430,6 +431,11 @@
41+ &capture_before_unmap,
42+ FALSE,
43+ },
44++ { "/apps/metacity/general/workspace_switcher_keyboard_cycle",
45++ META_PREF_WORKSPACE_SWITCHER_KEYBOARD_CYCLE,
46++ &workspace_switcher_keyboard_cycle,
47++ FALSE,
48++ },
49+ { NULL, 0, NULL, FALSE },
50+ };
51+
52+@@ -1793,6 +1799,9 @@
53+
54+ case META_PREF_CAPTURE_BEFORE_UNMAP:
55+ return "CAPTURE_BEFORE_UNMAP";
56++
57++ case META_PREF_WORKSPACE_SWITCHER_KEYBOARD_CYCLE:
58++ return "WORKSPACE_SWITCHER_KEYBOARD_CYCLE";
59+ }
60+
61+ return "(unknown)";
62+@@ -2749,6 +2758,12 @@
63+ return capture_before_unmap;
64+ }
65+
66++gboolean
67++meta_prefs_get_workspace_switcher_keyboard_cycle (void)
68++{
69++ return workspace_switcher_keyboard_cycle;
70++}
71++
72+ guint
73+ meta_prefs_get_mouse_button_resize (void)
74+ {
75+Index: metacity-2.30.2/src/core/workspace.c
76+===================================================================
77+--- metacity-2.30.2.orig/src/core/workspace.c 2011-02-10 17:29:07.968489170 -0500
78++++ metacity-2.30.2/src/core/workspace.c 2011-02-10 17:29:19.218236998 -0500
79+@@ -811,8 +811,9 @@
80+ {
81+ MetaWorkspaceLayout layout;
82+ int i, current_space, num_workspaces;
83+- gboolean ltr;
84++ gboolean ltr, cycle;
85+
86++ cycle = meta_prefs_get_workspace_switcher_keyboard_cycle ();
87+ current_space = meta_workspace_index (workspace);
88+ num_workspaces = meta_screen_get_n_workspaces (workspace->screen);
89+ meta_screen_calc_workspace_layout (workspace->screen, num_workspaces,
90+@@ -839,14 +840,52 @@
91+ break;
92+ }
93+
94+- if (layout.current_col < 0)
95 - layout.current_col = 0;
96-+ layout.current_col = num_workspaces - 1;
97- if (layout.current_col >= layout.cols)
98+- if (layout.current_col >= layout.cols)
99 - layout.current_col = layout.cols - 1;
100-+ layout.current_col = 0;
101- if (layout.current_row < 0)
102- layout.current_row = 0;
103- if (layout.current_row >= layout.rows)
104+- if (layout.current_row < 0)
105+- layout.current_row = 0;
106+- if (layout.current_row >= layout.rows)
107+- layout.current_row = layout.rows - 1;
108++ if (cycle)
109++ {
110++ /* right to left */
111++ if (layout.current_col < 0)
112++ {
113++ layout.current_col = layout.cols - 1;
114++ if (layout.rows > 1)
115++ {
116++ /* first row */
117++ if (layout.current_row == 0)
118++ layout.current_row = layout.rows - 1;
119++ else
120++ layout.current_row -= 1;
121++ }
122++ }
123++
124++ /* left to right */
125++ if (layout.current_col >= layout.cols)
126++ {
127++ layout.current_col = 0;
128++
129++ if (layout.rows > 1)
130++ {
131++ /* last row */
132++ if (layout.current_row == (layout.rows -1))
133++ layout.current_row = 0;
134++ else
135++ layout.current_row += 1;
136++ }
137++ }
138++ if (layout.current_row < 0)
139++ layout.current_row = 0;
140++ if (layout.current_row >= layout.rows)
141++ layout.current_row = layout.rows - 1;
142++ }
143++ else
144++ {
145++ if (layout.current_col < 0)
146++ layout.current_col = 0;
147++ if (layout.current_col >= layout.cols)
148++ layout.current_col = layout.cols - 1;
149++ if (layout.current_row < 0)
150++ layout.current_row = 0;
151++ if (layout.current_row >= layout.rows)
152++ layout.current_row = layout.rows - 1;
153++ }
154+
155+ i = layout.grid[layout.current_row * layout.cols + layout.current_col];
156+
157+Index: metacity-2.30.2/src/include/prefs.h
158+===================================================================
159+--- metacity-2.30.2.orig/src/include/prefs.h 2011-02-10 17:29:08.118485807 -0500
160++++ metacity-2.30.2/src/include/prefs.h 2011-02-10 17:29:08.138485359 -0500
161+@@ -63,7 +63,8 @@
162+ META_PREF_FORCE_FULLSCREEN,
163+ META_PREF_HIDE_DECORATOR_TOOLTIP,
164+ META_PREF_SHOW_MAXIMIZED_TITLEBARS,
165+- META_PREF_CAPTURE_BEFORE_UNMAP
166++ META_PREF_CAPTURE_BEFORE_UNMAP,
167++ META_PREF_WORKSPACE_SWITCHER_KEYBOARD_CYCLE
168+ } MetaPreference;
169+
170+ typedef void (* MetaPrefsChangedFunc) (MetaPreference pref,
171+@@ -123,6 +124,8 @@
172+ gboolean meta_prefs_get_force_fullscreen (void);
173+
174+ gboolean meta_prefs_get_capture_before_unmap (void);
175++gboolean meta_prefs_get_workspace_switcher_keyboard_cycle (void);
176++
177+
178+ /**
179+ * Sets whether the compositor is turned on.
180+Index: metacity-2.30.2/src/metacity.schemas.in.in
181+===================================================================
182+--- metacity-2.30.2.orig/src/metacity.schemas.in.in 2011-02-10 17:29:08.118485807 -0500
183++++ metacity-2.30.2/src/metacity.schemas.in.in 2011-02-10 17:29:08.138485359 -0500
184+@@ -357,6 +357,26 @@
185+ </schema>
186+
187+ <schema>
188++ <key>/schemas/apps/metacity/general/workspace_switcher_keyboard_cycle</key>
189++ <applyto>/apps/metacity/general/workspace_switcher_keyboard_cycle</applyto>
190++ <owner>metacity</owner>
191++ <type>bool</type>
192++ <default>false</default>
193++ <locale name="C">
194++ <short>Workspace Switcher Keyboard Cycle</short>
195++ <long>
196++ Determines if the workspace switcher enables cycling
197++ of workspaces using keyboard shortcuts. (typically right and
198++ left arrow keys). If true and single row layout, keys will
199++ cycle from last to first and first to last workspace when
200++ pressed on first or last workspace. If true and multi-row
201++ layout, keys will cycle left to right, top to bottom
202++ and vice versa.
203++ </long>
204++ </locale>
205++ </schema>
206++
207++ <schema>
208+ <key>/schemas/apps/metacity/general/audible_bell</key>
209+ <applyto>/apps/metacity/general/audible_bell</applyto>
210+ <owner>metacity</owner>

Subscribers

People subscribed via source and target branches

to all changes: