[gnome-shell] workspaceThumbnail: Use new helper function when accepting drops



commit ff29159df2722cc01024aef42636097c23a41704
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Mar 31 17:15:26 2022 +0200

    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 af94a9d062..45b938f7ba 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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]