diff --git a/tiling-assistant@leleat-on-github/src/extension/moveHandler.js b/tiling-assistant@leleat-on-github/src/extension/moveHandler.js index 331a8ac..db68a8f 100644 --- a/tiling-assistant@leleat-on-github/src/extension/moveHandler.js +++ b/tiling-assistant@leleat-on-github/src/extension/moveHandler.js @@ -140,7 +140,7 @@ class MoveHandler { const moveDist = getDistance(currPoint, oldPoint); if (moveDist > 10) { - this._restoreSizeAndRestartGrab(window, x, y, grabOp); + this._restoreSizeAndRestartGrab(window, grabOp); return GLib.SOURCE_REMOVE; } @@ -407,12 +407,8 @@ class MoveHandler { } } - _restoreSizeAndRestartGrab(window, px, py, grabOp) { - Twm.untile(window, { - restoreFullPos: false, - xAnchor: px, - skipAnim: this._wasMaximizedOnStart - }); + _restoreSizeAndRestartGrab(window, grabOp) { + Twm.untile(window, { skipAnim: this._wasMaximizedOnStart }); this._onMoveStarted(window, grabOp); } diff --git a/tiling-assistant@leleat-on-github/src/extension/tilingWindowManager.js b/tiling-assistant@leleat-on-github/src/extension/tilingWindowManager.js index 40475bb..0b6ad15 100644 --- a/tiling-assistant@leleat-on-github/src/extension/tilingWindowManager.js +++ b/tiling-assistant@leleat-on-github/src/extension/tilingWindowManager.js @@ -241,13 +241,10 @@ class TilingWindowManager { * @param {boolean} [param.restoreFullPos=true] decides, if we restore the * pre-tile position or whether the size while keeping the titlebar * at the relative same position. - * @param {number} [param.xAnchor=undefined] used when wanting to restore the - * size while keeping titlebar at the relative x position. By default, - * we use the pointer position. * @param {boolean} [param.skipAnim=false] decides, if we skip the until animation. * @param {boolean} [param.clampToWorkspace=false] decides, if we skip the until animation. */ - untile(window, { restoreFullPos = true, xAnchor = undefined, skipAnim = false, clampToWorkspace = false } = {}) { + untile(window, { restoreFullPos = true, skipAnim = false, clampToWorkspace = false } = {}) { const wasMaximized = window.get_maximized(); if (wasMaximized) window.unmaximize(wasMaximized); @@ -285,16 +282,15 @@ class TilingWindowManager { if (restoreFullPos) { window.move_resize_frame(userOp, oldRect.x, oldRect.y, oldRect.width, oldRect.height); } else { - // Resize the window while keeping the relative x pos (of the pointer) const currWindowFrame = window.get_frame_rect(); - xAnchor = xAnchor ?? global.get_pointer()[0]; - const relativeMouseX = (xAnchor - currWindowFrame.x) / currWindowFrame.width; - const newPosX = xAnchor - oldRect.width * relativeMouseX; - // Wayland workaround for DND / restore position - Meta.is_wayland_compositor() && window.move_frame(true, newPosX, currWindowFrame.y); - - window.move_resize_frame(userOp, newPosX, currWindowFrame.y, oldRect.width, oldRect.height); + window.move_resize_frame( + userOp, + currWindowFrame.x, + currWindowFrame.y, + oldRect.width, + oldRect.height + ); } this.clearTilingProps(window.get_id());