Merge lp:~unity-team/unity/workspace-configure-love into lp:unity

Proposed by Jason Smith
Status: Merged
Merged at revision: 558
Proposed branch: lp:~unity-team/unity/workspace-configure-love
Merge into: lp:unity
Diff against target: 26 lines (+15/-1)
1 file modified
targets/mutter/spaces-manager.vala (+15/-1)
To merge this branch: bzr merge lp:~unity-team/unity/workspace-configure-love
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
Review via email: mp+36570@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

It's not 5 lines of code, liar! :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'targets/mutter/spaces-manager.vala'
--- targets/mutter/spaces-manager.vala 2010-09-24 16:06:23 +0000
+++ targets/mutter/spaces-manager.vala 2010-09-24 16:59:00 +0000
@@ -155,7 +155,21 @@
155 this.plugin = plugin;155 this.plugin = plugin;
156 this.plugin.workspace_switch_event.connect (this.workspace_switched);156 this.plugin.workspace_switch_event.connect (this.workspace_switched);
157 157
158 set_desktop_layout (2, 2, 2 * 2);158 int num_workspaces = Mutter.meta_prefs_get_num_workspaces ();
159
160 if (num_workspaces <= 4)
161 {
162 set_desktop_layout (2, 2, 2 * 2);
163 }
164 else
165 {
166 int width = (int) Math.ceil (Math.sqrt ((double) num_workspaces));
167 int height = 1;
168 while (width * height < num_workspaces)
169 height++;
170
171 set_desktop_layout (width, height, num_workspaces);
172 }
159 }173 }
160174
161 void set_desktop_layout (int columns, int rows, int num_workspace)175 void set_desktop_layout (int columns, int rows, int num_workspace)