From ff29159df2722cc01024aef42636097c23a41704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org> Date: Thu, 31 Mar 2022 17:15:26 +0200 Subject: [PATCH] workspaceThumbnail: Use new helper function when accepting drops Moving a window from a secondary monitor to a non-active workspace currently fails for the aforementioned reasons. Use the newly added helper function to address this. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/893 Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2259> --- js/ui/workspaceThumbnail.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/js/ui/workspaceThumbnail.js b/js/ui/workspaceThumbnail.js index af94a9d06..45b938f7b 100644 --- a/js/ui/workspaceThumbnail.js +++ b/js/ui/workspaceThumbnail.js @@ -552,14 +552,8 @@ var WorkspaceThumbnail = GObject.registerClass({ return false; let metaWindow = win.get_meta_window(); - - // We need to move the window before changing the workspace, because - // the move itself could cause a workspace change if the window enters - // the primary monitor - if (metaWindow.get_monitor() != this.monitorIndex) - metaWindow.move_to_monitor(this.monitorIndex); - - metaWindow.change_workspace_by_index(this.metaWorkspace.index(), false); + Main.moveWindowToMonitorAndWorkspace(metaWindow, + this.monitorIndex, this.metaWorkspace.index()); return true; } else if (source.app && source.app.can_open_new_window()) { if (source.animateLaunchAtPos) @@ -903,9 +897,8 @@ var ThumbnailsBox = GObject.registerClass({ if (isWindow) { // Move the window to our monitor first if necessary. let thumbMonitor = this._thumbnails[newWorkspaceIndex].monitorIndex; - if (source.metaWindow.get_monitor() != thumbMonitor) - source.metaWindow.move_to_monitor(thumbMonitor); - source.metaWindow.change_workspace_by_index(newWorkspaceIndex, true); + Main.moveWindowToMonitorAndWorkspace(source.metaWindow, + thumbMonitor, newWorkspaceIndex, true); } else if (source.app && source.app.can_open_new_window()) { if (source.animateLaunchAtPos) source.animateLaunchAtPos(actor.x, actor.y);