dnd: Centralize drag actor positioning code, use shellWorkspaceLaunch for workspaces
We had multiple copies of the code to position a drag actor given a particular source. Instead, just put it inside dnd.js. Second, rather than test for GenericDisplay/WellDisplayItem etc., in various places, add a new method on each source "shellWorkspaceLaunch" which both marks the item as being droppable on a workspace, and is called by the workspaces code to launch the item.
This commit is contained in:
@ -11,9 +11,7 @@ const Pango = imports.gi.Pango;
|
||||
const Shell = imports.gi.Shell;
|
||||
const Signals = imports.signals;
|
||||
|
||||
const AppDisplay = imports.ui.appDisplay;
|
||||
const DND = imports.ui.dnd;
|
||||
const GenericDisplay = imports.ui.genericDisplay;
|
||||
const Main = imports.ui.main;
|
||||
const Overview = imports.ui.overview;
|
||||
const Panel = imports.ui.panel;
|
||||
@ -855,9 +853,9 @@ Workspace.prototype = {
|
||||
false, // don't create workspace
|
||||
time);
|
||||
return true;
|
||||
} else if (source instanceof GenericDisplay.GenericDisplayItem || source instanceof AppDisplay.WellDisplayItem) {
|
||||
} else if (source.shellWorkspaceLaunch) {
|
||||
this._metaWorkspace.activate(time);
|
||||
source.launch();
|
||||
source.shellWorkspaceLaunch();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user