Skip to content

Commit bc8b941

Browse files
committed
DesktopIntegration: Allow reordering workspaces
1 parent cf68ff7 commit bc8b941

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/DesktopIntegration.vala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,4 +244,15 @@ public class Gala.DesktopIntegration : GLib.Object {
244244

245245
wm.window_overview.open (hints);
246246
}
247+
248+
public void reorder_workspace (int index, int new_index) throws DBusError, IOError {
249+
unowned var workspace_manager = wm.get_display ().get_workspace_manager ();
250+
unowned var workspace = workspace_manager.get_workspace_by_index (index);
251+
252+
if (workspace == null) {
253+
throw new IOError.NOT_FOUND ("Invalid index, workspace not found");
254+
}
255+
256+
workspace_manager.reorder_workspace (workspace, new_index);
257+
}
247258
}

0 commit comments

Comments
 (0)