From be5ef5eb92b1abf1d69a8681870c8f54570ef8ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Fri, 22 Sep 2017 21:22:32 +0200 Subject: [PATCH] Semi fix for positioning windows moved between workspaces TODO: actually figure out the correct position, relying on `focus()` isn't correct. --- tiling.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tiling.js b/tiling.js index ecbd7e8..42d9456 100644 --- a/tiling.js +++ b/tiling.js @@ -370,9 +370,20 @@ add_handler = (ws, meta_window) => { // Existing windows being moved need a new position in this space. This // can be done here since the window is fully initialized. - // Maxmize height. Setting position here doesn't work... - meta_window.move_resize_frame(true, 0, 0, - meta_window.get_frame_rect().width, primary.height - panelBox.height - margin_tb*2); + // If the MetaWindowActor is available the window already exists and we can position + if (meta_window.get_compositor_private()) { + meta_window.move_resize_frame(true, + meta_window.scrollwm_initial_position.x, + meta_screen.scrollwm_initial_position.y, + meta_window.get_frame_rect().width, + primary.height - panelBox.height - margin_tb*2); + delete meta_window.scrollwm_initial_position + } else { + // Just maxmize height. (This sometimes fails though) + meta_window.move_resize_frame(true, 0, 0, + meta_window.get_frame_rect().width, + primary.height - panelBox.height - margin_tb*2); + } meta_window[focus_signal] = meta_window.connect("focus", focus_wrapper); }