mirror of
https://github.com/gosticks/PaperWM.git
synced 2026-10-06 03:56:53 +00:00
Create simple Space abstraction
Also move full spaces init to `enable`.
This commit is contained in:
@@ -28,6 +28,7 @@ function enable() {
|
||||
// Hook up existing workspaces
|
||||
for (let i=0; i < global.screen.n_workspaces; i++) {
|
||||
let workspace = global.screen.get_workspace_by_index(i)
|
||||
Tiling.spaces[i] = Space(workspace);
|
||||
debug("workspace", workspace)
|
||||
workspace.connect("window-added", dynamic_function_ref("add_handler"))
|
||||
workspace.connect("window-removed", dynamic_function_ref("remove_handler"));
|
||||
|
||||
@@ -29,14 +29,24 @@ panelBox.connect('show', () => {
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Space = (workspace) => {
|
||||
// Simplest way to get a straight array interface
|
||||
let space = [];
|
||||
space.workspace = workspace;
|
||||
space.selectedWindow = null;
|
||||
space.moving = false;
|
||||
space.leftStack = 0;
|
||||
space.rightStack = 0;
|
||||
return space;
|
||||
}
|
||||
|
||||
panelBox.connect('hide', () => {
|
||||
panelBox.y = - panelBox.height;
|
||||
});
|
||||
|
||||
spaces = []
|
||||
for (let i=0; i < global.screen.n_workspaces; i++) {
|
||||
spaces[i] = []
|
||||
}
|
||||
const spaces = []
|
||||
window.spaces = spaces;
|
||||
|
||||
debug_all = true; // Consider the default value in `debug_filter` to be true
|
||||
debug_filter = { "#preview": false };
|
||||
|
||||
Reference in New Issue
Block a user