Bug 574697 - Slide the workspaces back in if the user starts dragging a document or an application item in the expanded display mode
Sliding the workspaces back in when the user starts dragging an item in the expanded display mode allows the user to select a workspace in which the item should be launched and stay in the overlay mode. This patch adds code to dnd.js that handles notifying actors when a drag item is being dragged over them. Overlay code uses such notification to unset expanded display modes and trigger sliding in of the workspaces. If the drag is cancelled the drag item snaps back to its source or disappears at the original position of its source if the source is no longer displayed.
This commit is contained in:
@@ -568,6 +568,8 @@ Overlay.prototype = {
|
||||
}
|
||||
|
||||
this._group = new Clutter.Group();
|
||||
this._group._delegate = this;
|
||||
|
||||
this.visible = false;
|
||||
|
||||
let background = new Clutter.Rectangle({ color: OVERLAY_BACKGROUND_COLOR,
|
||||
@@ -604,7 +606,7 @@ Overlay.prototype = {
|
||||
{ x: displayGridColumnWidth * asideXFactor,
|
||||
time: ANIMATION_TIME,
|
||||
transition: "easeOutQuad"
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
this._sideshow.connect('less-activated', function(sideshow) {
|
||||
@@ -621,6 +623,24 @@ Overlay.prototype = {
|
||||
});
|
||||
},
|
||||
|
||||
//// Draggable target interface ////
|
||||
|
||||
// Unsets the expanded display mode if a GenericDisplayItem is being
|
||||
// dragged over the overlay, i.e. as soon as it starts being dragged.
|
||||
// This slides the workspaces back in and allows the user to place
|
||||
// the item on any workspace.
|
||||
handleDragOver : function(source, actor, x, y, time) {
|
||||
if (source instanceof GenericDisplay.GenericDisplayItem) {
|
||||
this._sideshow._unsetMoreAppsMode();
|
||||
this._sideshow._unsetMoreDocsMode();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
//// Public methods ////
|
||||
|
||||
show : function() {
|
||||
if (this.visible)
|
||||
return;
|
||||
@@ -690,6 +710,8 @@ Overlay.prototype = {
|
||||
});
|
||||
},
|
||||
|
||||
//// Private methods ////
|
||||
|
||||
_hideDone: function() {
|
||||
let global = Shell.Global.get();
|
||||
|
||||
|
Reference in New Issue
Block a user