Don't check for Workspaces.WindowClone for window drops
When checking the type of a DND source, instead of checking 'instanceof Workspaces.WindowClone' accept any actor with realWindow and metaWindow properties. This will be useful to support a separate type of actor dragged from workspace thumbnails. https://bugzilla.gnome.org/show_bug.cgi?id=640996
This commit is contained in:
parent
9748cc264a
commit
3c593fc056
@ -632,7 +632,7 @@ AppIconMenu.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_findMetaWindowForActor: function (actor) {
|
_findMetaWindowForActor: function (actor) {
|
||||||
if (actor._delegate instanceof Workspace.WindowClone)
|
if (actor._delegate.metaWindow)
|
||||||
return actor._delegate.metaWindow;
|
return actor._delegate.metaWindow;
|
||||||
else if (actor.get_meta_window)
|
else if (actor.get_meta_window)
|
||||||
return actor.get_meta_window();
|
return actor.get_meta_window();
|
||||||
|
@ -54,7 +54,7 @@ RemoveFavoriteIcon.prototype = {
|
|||||||
if (source instanceof AppDisplay.AppWellIcon) {
|
if (source instanceof AppDisplay.AppWellIcon) {
|
||||||
let appSystem = Shell.AppSystem.get_default();
|
let appSystem = Shell.AppSystem.get_default();
|
||||||
app = appSystem.get_app(source.getId());
|
app = appSystem.get_app(source.getId());
|
||||||
} else if (source instanceof Workspace.WindowClone) {
|
} else if (source.metaWindow) {
|
||||||
let tracker = Shell.WindowTracker.get_default();
|
let tracker = Shell.WindowTracker.get_default();
|
||||||
app = tracker.get_window_app(source.metaWindow);
|
app = tracker.get_window_app(source.metaWindow);
|
||||||
}
|
}
|
||||||
@ -148,7 +148,7 @@ Dash.prototype = {
|
|||||||
let app = null;
|
let app = null;
|
||||||
if (dragEvent.source instanceof AppDisplay.AppWellIcon)
|
if (dragEvent.source instanceof AppDisplay.AppWellIcon)
|
||||||
app = this._appSystem.get_app(dragEvent.source.getId());
|
app = this._appSystem.get_app(dragEvent.source.getId());
|
||||||
else if (dragEvent.source instanceof Workspace.WindowClone)
|
else if (dragEvent.source.metaWindow)
|
||||||
app = this._tracker.get_window_app(dragEvent.source.metaWindow);
|
app = this._tracker.get_window_app(dragEvent.source.metaWindow);
|
||||||
else
|
else
|
||||||
return DND.DragMotionResult.CONTINUE;
|
return DND.DragMotionResult.CONTINUE;
|
||||||
@ -265,7 +265,7 @@ Dash.prototype = {
|
|||||||
let app = null;
|
let app = null;
|
||||||
if (source instanceof AppDisplay.AppWellIcon)
|
if (source instanceof AppDisplay.AppWellIcon)
|
||||||
app = this._appSystem.get_app(source.getId());
|
app = this._appSystem.get_app(source.getId());
|
||||||
else if (source instanceof Workspace.WindowClone)
|
else if (source.metaWindow)
|
||||||
app = this._tracker.get_window_app(source.metaWindow);
|
app = this._tracker.get_window_app(source.metaWindow);
|
||||||
|
|
||||||
// Don't allow favoriting of transient apps
|
// Don't allow favoriting of transient apps
|
||||||
@ -316,7 +316,7 @@ Dash.prototype = {
|
|||||||
let app = null;
|
let app = null;
|
||||||
if (source instanceof AppDisplay.AppWellIcon) {
|
if (source instanceof AppDisplay.AppWellIcon) {
|
||||||
app = this._appSystem.get_app(source.getId());
|
app = this._appSystem.get_app(source.getId());
|
||||||
} else if (source instanceof Workspace.WindowClone) {
|
} else if (source.metaWindow) {
|
||||||
app = this._tracker.get_window_app(source.metaWindow);
|
app = this._tracker.get_window_app(source.metaWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1412,7 +1412,7 @@ Workspace.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
acceptDrop : function(source, actor, x, y, time) {
|
acceptDrop : function(source, actor, x, y, time) {
|
||||||
if (source instanceof WindowClone) {
|
if (source.realWindow) {
|
||||||
let win = source.realWindow;
|
let win = source.realWindow;
|
||||||
if (this._isMyWindow(win))
|
if (this._isMyWindow(win))
|
||||||
return false;
|
return false;
|
||||||
|
@ -264,7 +264,7 @@ WorkspacesView.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_handleDragOverNewWorkspace: function(source, dropActor, x, y, time) {
|
_handleDragOverNewWorkspace: function(source, dropActor, x, y, time) {
|
||||||
if (source instanceof Workspace.WindowClone)
|
if (source.realWindow)
|
||||||
return DND.DragMotionResult.MOVE_DROP;
|
return DND.DragMotionResult.MOVE_DROP;
|
||||||
if (source.shellWorkspaceLaunch)
|
if (source.shellWorkspaceLaunch)
|
||||||
return DND.DragMotionResult.COPY_DROP;
|
return DND.DragMotionResult.COPY_DROP;
|
||||||
|
Loading…
Reference in New Issue
Block a user