workspaceThumbnails: Move to primary monitor first when creating workspace

When dragging a window preview from a non-primary monitor onto a
workspace thumbnail, the window is moved to the primery monitor
first before changing its workspace. However when dragging the window
between thumbnails to create a new workspace, it is kept on its current
monitor instead. This is not only inconsistent, but outright confusing
with the default 'workspaces-only-on-primary' setting, as the newly
created workspace is immediately removed again.

https://bugzilla.gnome.org/show_bug.cgi?id=683819
This commit is contained in:
Florian Müllner 2014-04-26 16:17:24 +02:00
parent 8c45e6fa43
commit c7306449ae

View File

@ -826,10 +826,14 @@ const ThumbnailsBox = new Lang.Class({
window.change_workspace_by_index(window.get_workspace().index() + 1, true);
});
if (isWindow)
if (isWindow) {
// ... and bam, a workspace, good as new.
// 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);
else if (source.shellWorkspaceLaunch) {
} else if (source.shellWorkspaceLaunch) {
source.shellWorkspaceLaunch({ workspace: newWorkspaceIndex,
timestamp: time });
// This new workspace will be automatically removed if the application fails