mirror of
https://github.com/gosticks/PaperWM.git
synced 2026-10-05 03:46:53 +00:00
Support for tiling in new _static_ workspaces
Doesn't work with dynamic workspaces because they doesn't trigger the `workspace-added` signal. (Removed some superfluous logging)
This commit is contained in:
@@ -111,7 +111,6 @@ ensure_viewport = (meta_window, force) => {
|
||||
let workspace = workspaces[meta_window.get_workspace().workspace_index];
|
||||
let index = workspace.indexOf(meta_window)
|
||||
function move_to(meta_window, x, y) {
|
||||
debug('ensure, workspace length', workspace.length);
|
||||
ensuring = meta_window;
|
||||
move(meta_window, x, y, () => { ensuring = false });
|
||||
propogate_forward(workspace, index + 1, x + frame.width + window_gap, true);
|
||||
@@ -374,6 +373,22 @@ window_created = (display, meta_window, user_data) => {
|
||||
|
||||
global.display.connect('window-created', dynamic_function_ref('window_created'));
|
||||
|
||||
workspace_added = (screen, index) => {
|
||||
workspaces[index] = [];
|
||||
let workspace = global.screen.get_workspace_by_index(index);
|
||||
workspace.connect("window-added", dynamic_function_ref("add_handler"))
|
||||
workspace.connect("window-removed", dynamic_function_ref("remove_handler"));
|
||||
debug('workspace-added', index, workspace);
|
||||
|
||||
}
|
||||
// Doesn't seem to trigger for some reason
|
||||
workspace_removed = (screen, arg1, arg2) => {
|
||||
debug('workspace-removed');
|
||||
let workspace = global.screen.get_workspace_by_index(index);
|
||||
}
|
||||
|
||||
global.screen.connect("workspace-added", dynamic_function_ref('workspace_added'))
|
||||
global.screen.connect("workspace-removed", dynamic_function_ref('workspace_removed'));
|
||||
|
||||
recover_all_tilings = function() {
|
||||
for (let i=0; i < global.screen.n_workspaces; i++) {
|
||||
|
||||
Reference in New Issue
Block a user