overview: Only accept AppIcon drops if the app can open a new window
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/121
This commit is contained in:
parent
00e95de114
commit
23344701de
@ -1994,7 +1994,7 @@ var Workspace = class {
|
||||
handleDragOver(source, _actor, _x, _y, _time) {
|
||||
if (source.realWindow && !this._isMyWindow(source.realWindow))
|
||||
return DND.DragMotionResult.MOVE_DROP;
|
||||
if (source.app)
|
||||
if (source.app && source.app.can_open_new_window())
|
||||
return DND.DragMotionResult.COPY_DROP;
|
||||
if (!source.app && source.shellWorkspaceLaunch)
|
||||
return DND.DragMotionResult.COPY_DROP;
|
||||
@ -2031,7 +2031,7 @@ var Workspace = class {
|
||||
|
||||
metaWindow.change_workspace_by_index(workspaceIndex, false);
|
||||
return true;
|
||||
} else if (source.app) {
|
||||
} else if (source.app && source.app.can_open_new_window()) {
|
||||
source.app.open_new_window(workspaceIndex);
|
||||
return true;
|
||||
} else if (!source.app && source.shellWorkspaceLaunch) {
|
||||
|
@ -572,7 +572,7 @@ var WorkspaceThumbnail = GObject.registerClass({
|
||||
|
||||
if (source.realWindow && !this._isMyWindow(source.realWindow))
|
||||
return DND.DragMotionResult.MOVE_DROP;
|
||||
if (source.app)
|
||||
if (source.app && source.app.can_open_new_window())
|
||||
return DND.DragMotionResult.COPY_DROP;
|
||||
if (!source.app && source.shellWorkspaceLaunch)
|
||||
return DND.DragMotionResult.COPY_DROP;
|
||||
@ -599,7 +599,7 @@ var WorkspaceThumbnail = GObject.registerClass({
|
||||
|
||||
metaWindow.change_workspace_by_index(this.metaWorkspace.index(), false);
|
||||
return true;
|
||||
} else if (source.app) {
|
||||
} else if (source.app && source.app.can_open_new_window()) {
|
||||
source.app.open_new_window(this.metaWorkspace.index());
|
||||
return true;
|
||||
} else if (!source.app && source.shellWorkspaceLaunch) {
|
||||
@ -787,7 +787,7 @@ var ThumbnailsBox = GObject.registerClass({
|
||||
// Draggable target interface
|
||||
handleDragOver(source, actor, x, y, time) {
|
||||
if (!source.realWindow &&
|
||||
!source.app &&
|
||||
(!source.app || !source.app.can_open_new_window()) &&
|
||||
(source.app || !source.shellWorkspaceLaunch) &&
|
||||
source != Main.xdndHandler)
|
||||
return DND.DragMotionResult.CONTINUE;
|
||||
@ -847,7 +847,7 @@ var ThumbnailsBox = GObject.registerClass({
|
||||
return this._thumbnails[this._dropWorkspace].acceptDropInternal(source, time);
|
||||
} else if (this._dropPlaceholderPos != -1) {
|
||||
if (!source.realWindow &&
|
||||
!source.app &&
|
||||
(!source.app || !source.app.can_open_new_window()) &&
|
||||
(source.app || !source.shellWorkspaceLaunch))
|
||||
return false;
|
||||
|
||||
@ -865,7 +865,7 @@ var ThumbnailsBox = GObject.registerClass({
|
||||
if (source.metaWindow.get_monitor() != thumbMonitor)
|
||||
source.metaWindow.move_to_monitor(thumbMonitor);
|
||||
source.metaWindow.change_workspace_by_index(newWorkspaceIndex, true);
|
||||
} else if (source.app) {
|
||||
} else if (source.app && source.app.can_open_new_window()) {
|
||||
source.app.open_new_window(newWorkspaceIndex);
|
||||
} else if (!source.app && source.shellWorkspaceLaunch) {
|
||||
// While unused in our own drag sources, shellWorkspaceLaunch allows
|
||||
|
Loading…
Reference in New Issue
Block a user