Bug 591437 - Rename overlay.js to overview.js
Replace 'overlay' with the more descriptive name 'overview' where the Activities Overview is meant. Call it Overview (capitalized) in code comments. The overlay-group and overlay-key provided by Mutter are not affected, since they may be used for other components than the Activities Overview.
This commit is contained in:
parent
1f31e80c47
commit
47af454115
@ -12,7 +12,7 @@ dist_jsui_DATA = \
|
|||||||
link.js \
|
link.js \
|
||||||
lookingGlass.js \
|
lookingGlass.js \
|
||||||
main.js \
|
main.js \
|
||||||
overlay.js \
|
overview.js \
|
||||||
panel.js \
|
panel.js \
|
||||||
places.js \
|
places.js \
|
||||||
runDialog.js \
|
runDialog.js \
|
||||||
|
@ -198,7 +198,7 @@ AppDisplay.prototype = {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
// Load the apps now so it doesn't slow down the first
|
// Load the apps now so it doesn't slow down the first
|
||||||
// transition into the overlay
|
// transition into the Overview
|
||||||
this._refreshCache();
|
this._refreshCache();
|
||||||
|
|
||||||
this._focusInMenus = true;
|
this._focusInMenus = true;
|
||||||
@ -517,7 +517,7 @@ WellDisplayItem.prototype = {
|
|||||||
/* Pick the first window and activate it;
|
/* Pick the first window and activate it;
|
||||||
* In the future, we want to have a menu dropdown here. */
|
* In the future, we want to have a menu dropdown here. */
|
||||||
let first = this._windows[0];
|
let first = this._windows[0];
|
||||||
Main.overlay.activateWindow (first, Clutter.get_current_event_time());
|
Main.overview.activateWindow(first, Clutter.get_current_event_time());
|
||||||
}
|
}
|
||||||
this.emit('activated');
|
this.emit('activated');
|
||||||
},
|
},
|
||||||
@ -814,7 +814,7 @@ AppWell.prototype = {
|
|||||||
let app = apps[i];
|
let app = apps[i];
|
||||||
let display = new WellDisplayItem(app, this.isFavorite);
|
let display = new WellDisplayItem(app, this.isFavorite);
|
||||||
display.connect('activated', Lang.bind(this, function (display) {
|
display.connect('activated', Lang.bind(this, function (display) {
|
||||||
Main.overlay.hide();
|
Main.overview.hide();
|
||||||
}));
|
}));
|
||||||
this._grid.actor.add_actor(display.actor);
|
this._grid.actor.add_actor(display.actor);
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ const Shell = imports.gi.Shell;
|
|||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
|
|
||||||
// This manages the shell "chrome"; the UI that's visible in the
|
// This manages the shell "chrome"; the UI that's visible in the
|
||||||
// normal mode (ie, outside the overlay), that surrounds the main
|
// normal mode (ie, outside the Overview), that surrounds the main
|
||||||
// workspace content.
|
// workspace content.
|
||||||
|
|
||||||
function Chrome() {
|
function Chrome() {
|
||||||
@ -23,8 +23,8 @@ Chrome.prototype = {
|
|||||||
// The group itself has zero size so it doesn't interfere with DND
|
// The group itself has zero size so it doesn't interfere with DND
|
||||||
this.actor = new Clutter.Group({ width: 0, height: 0 });
|
this.actor = new Clutter.Group({ width: 0, height: 0 });
|
||||||
global.stage.add_actor(this.actor);
|
global.stage.add_actor(this.actor);
|
||||||
this.nonOverlayActor = new Clutter.Group();
|
this.nonOverviewActor = new Clutter.Group();
|
||||||
this.actor.add_actor(this.nonOverlayActor);
|
this.actor.add_actor(this.nonOverviewActor);
|
||||||
|
|
||||||
this._obscuredByFullscreen = false;
|
this._obscuredByFullscreen = false;
|
||||||
|
|
||||||
@ -37,10 +37,10 @@ Chrome.prototype = {
|
|||||||
global.screen.connect('notify::n-workspaces',
|
global.screen.connect('notify::n-workspaces',
|
||||||
Lang.bind(this, this._queueUpdateRegions));
|
Lang.bind(this, this._queueUpdateRegions));
|
||||||
|
|
||||||
Main.overlay.connect('showing',
|
Main.overview.connect('showing',
|
||||||
Lang.bind(this, this._overlayShowing));
|
Lang.bind(this, this._overviewShowing));
|
||||||
Main.overlay.connect('hidden',
|
Main.overview.connect('hidden',
|
||||||
Lang.bind(this, this._overlayHidden));
|
Lang.bind(this, this._overviewHidden));
|
||||||
|
|
||||||
this._queueUpdateRegions();
|
this._queueUpdateRegions();
|
||||||
},
|
},
|
||||||
@ -78,27 +78,27 @@ Chrome.prototype = {
|
|||||||
else if (shapeActor && !this._verifyAncestry(shapeActor, actor))
|
else if (shapeActor && !this._verifyAncestry(shapeActor, actor))
|
||||||
throw new Error('shapeActor is not a descendent of actor');
|
throw new Error('shapeActor is not a descendent of actor');
|
||||||
|
|
||||||
this.nonOverlayActor.add_actor(actor);
|
this.nonOverviewActor.add_actor(actor);
|
||||||
|
|
||||||
if (shapeActor)
|
if (shapeActor)
|
||||||
this._trackActor(shapeActor, true, true);
|
this._trackActor(shapeActor, true, true);
|
||||||
},
|
},
|
||||||
|
|
||||||
// setVisibleInOverlay:
|
// setVisibleInOverview:
|
||||||
// @actor: an actor in the chrome layer
|
// @actor: an actor in the chrome layer
|
||||||
// @visible: overlay visibility
|
// @visible: Overview visibility
|
||||||
//
|
//
|
||||||
// By default, actors in the chrome layer are automatically hidden
|
// By default, actors in the chrome layer are automatically hidden
|
||||||
// when the overlay is shown. This can be used to override that
|
// when the Overview is shown. This can be used to override that
|
||||||
// behavior
|
// behavior
|
||||||
setVisibleInOverlay: function(actor, visible) {
|
setVisibleInOverview: function(actor, visible) {
|
||||||
if (!this._verifyAncestry(actor, this.actor))
|
if (!this._verifyAncestry(actor, this.actor))
|
||||||
throw new Error('actor is not a descendent of the chrome layer');
|
throw new Error('actor is not a descendent of the chrome layer');
|
||||||
|
|
||||||
if (visible)
|
if (visible)
|
||||||
actor.reparent(this.actor);
|
actor.reparent(this.actor);
|
||||||
else
|
else
|
||||||
actor.reparent(this.nonOverlayActor);
|
actor.reparent(this.nonOverviewActor);
|
||||||
},
|
},
|
||||||
|
|
||||||
// addInputRegionActor:
|
// addInputRegionActor:
|
||||||
@ -126,8 +126,8 @@ Chrome.prototype = {
|
|||||||
//
|
//
|
||||||
// Removes @actor from the chrome layer
|
// Removes @actor from the chrome layer
|
||||||
removeActor: function(actor) {
|
removeActor: function(actor) {
|
||||||
if (actor.get_parent() == this.nonOverlayActor)
|
if (actor.get_parent() == this.nonOverviewActor)
|
||||||
this.nonOverlayActor.remove_actor(actor);
|
this.nonOverviewActor.remove_actor(actor);
|
||||||
else
|
else
|
||||||
this.actor.remove_actor(actor);
|
this.actor.remove_actor(actor);
|
||||||
this._untrackActor(actor, true, true);
|
this._untrackActor(actor, true, true);
|
||||||
@ -172,7 +172,7 @@ Chrome.prototype = {
|
|||||||
this._trackedActors.push(actorData);
|
this._trackedActors.push(actorData);
|
||||||
|
|
||||||
actor = actor.get_parent();
|
actor = actor.get_parent();
|
||||||
if (actor != this.actor && actor != this.nonOverlayActor)
|
if (actor != this.actor && actor != this.nonOverviewActor)
|
||||||
this._trackActor(actor, false, false);
|
this._trackActor(actor, false, false);
|
||||||
|
|
||||||
if (inputRegion || strut)
|
if (inputRegion || strut)
|
||||||
@ -200,7 +200,7 @@ Chrome.prototype = {
|
|||||||
actor.disconnect(actorData.parentSetId);
|
actor.disconnect(actorData.parentSetId);
|
||||||
|
|
||||||
actor = actor.get_parent();
|
actor = actor.get_parent();
|
||||||
if (actor && actor != this.actor && actor != this.nonOverlayActor)
|
if (actor && actor != this.actor && actor != this.nonOverviewActor)
|
||||||
this._untrackActor(actor, false, false);
|
this._untrackActor(actor, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,23 +211,23 @@ Chrome.prototype = {
|
|||||||
_actorReparented: function(actor, oldParent) {
|
_actorReparented: function(actor, oldParent) {
|
||||||
if (this._verifyAncestry(actor, this.actor)) {
|
if (this._verifyAncestry(actor, this.actor)) {
|
||||||
let newParent = actor.get_parent();
|
let newParent = actor.get_parent();
|
||||||
if (newParent != this.actor && newParent != this.nonOverlayActor)
|
if (newParent != this.actor && newParent != this.nonOverviewActor)
|
||||||
this._trackActor(newParent, false, false);
|
this._trackActor(newParent, false, false);
|
||||||
}
|
}
|
||||||
if (oldParent != this.actor && oldParent != this.nonOverlayActor)
|
if (oldParent != this.actor && oldParent != this.nonOverviewActor)
|
||||||
this._untrackActor(oldParent, false, false);
|
this._untrackActor(oldParent, false, false);
|
||||||
},
|
},
|
||||||
|
|
||||||
_overlayShowing: function() {
|
_overviewShowing: function() {
|
||||||
this.actor.show();
|
this.actor.show();
|
||||||
this.nonOverlayActor.hide();
|
this.nonOverviewActor.hide();
|
||||||
this._queueUpdateRegions();
|
this._queueUpdateRegions();
|
||||||
},
|
},
|
||||||
|
|
||||||
_overlayHidden: function() {
|
_overviewHidden: function() {
|
||||||
if (this._obscuredByFullscreen)
|
if (this._obscuredByFullscreen)
|
||||||
this.actor.hide();
|
this.actor.hide();
|
||||||
this.nonOverlayActor.show();
|
this.nonOverviewActor.show();
|
||||||
this._queueUpdateRegions();
|
this._queueUpdateRegions();
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -272,7 +272,7 @@ Chrome.prototype = {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
let shouldBeVisible = !this._obscuredByFullscreen || Main.overlay.visible;
|
let shouldBeVisible = !this._obscuredByFullscreen || Main.overview.visible;
|
||||||
if (this.actor.visible != shouldBeVisible) {
|
if (this.actor.visible != shouldBeVisible) {
|
||||||
this.actor.visible = shouldBeVisible;
|
this.actor.visible = shouldBeVisible;
|
||||||
this._queueUpdateRegions();
|
this._queueUpdateRegions();
|
||||||
|
@ -389,9 +389,9 @@ Dash.prototype = {
|
|||||||
// Next, if we're in one of the "more" modes or showing the details pane, close them
|
// Next, if we're in one of the "more" modes or showing the details pane, close them
|
||||||
else if (this._activePane != null)
|
else if (this._activePane != null)
|
||||||
this._activePane.close();
|
this._activePane.close();
|
||||||
// Finally, just close the overlay entirely
|
// Finally, just close the Overview entirely
|
||||||
else
|
else
|
||||||
Main.overlay.hide();
|
Main.overview.hide();
|
||||||
return true;
|
return true;
|
||||||
} else if (symbol == Clutter.Up) {
|
} else if (symbol == Clutter.Up) {
|
||||||
if (!this._searchActive)
|
if (!this._searchActive)
|
||||||
@ -489,7 +489,7 @@ Dash.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
hide: function() {
|
hide: function() {
|
||||||
this._firstSelectAfterOverlayShow = true;
|
this._firstSelectAfterOverviewShow = true;
|
||||||
if (this._searchEntry.entry.text != '')
|
if (this._searchEntry.entry.text != '')
|
||||||
this._searchEntry.entry.text = '';
|
this._searchEntry.entry.text = '';
|
||||||
if (this._activePane != null)
|
if (this._activePane != null)
|
||||||
@ -512,7 +512,7 @@ Dash.prototype = {
|
|||||||
this._activePane = null;
|
this._activePane = null;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
Main.overlay.addPane(pane);
|
Main.overview.addPane(pane);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Signals.addSignalMethods(Dash.prototype);
|
Signals.addSignalMethods(Dash.prototype);
|
||||||
|
@ -114,7 +114,7 @@ DocDisplay.prototype = {
|
|||||||
this._docsStale = true;
|
this._docsStale = true;
|
||||||
this._docManager.connect('changed', function(mgr, userData) {
|
this._docManager.connect('changed', function(mgr, userData) {
|
||||||
me._docsStale = true;
|
me._docsStale = true;
|
||||||
// Changes in local recent files should not happen when we are in the overlay mode,
|
// Changes in local recent files should not happen when we are in the Overview mode,
|
||||||
// but redisplaying right away is cool when we use Zephyr.
|
// but redisplaying right away is cool when we use Zephyr.
|
||||||
// Also, we might be displaying remote documents, like Google Docs, in the future
|
// Also, we might be displaying remote documents, like Google Docs, in the future
|
||||||
// which might be edited by someone else.
|
// which might be edited by someone else.
|
||||||
@ -148,7 +148,7 @@ DocDisplay.prototype = {
|
|||||||
// we should do the sorting manually because we want the order to be based on last visited.
|
// we should do the sorting manually because we want the order to be based on last visited.
|
||||||
//
|
//
|
||||||
// This function is called each time the search string is set back to '' or we display
|
// This function is called each time the search string is set back to '' or we display
|
||||||
// the overlay, so we are doing the sorting over the same items multiple times if the list
|
// the Overview, so we are doing the sorting over the same items multiple times if the list
|
||||||
// of recent items didn't change. We could store an additional array of doc ids and sort
|
// of recent items didn't change. We could store an additional array of doc ids and sort
|
||||||
// them once when they are returned by this._recentManager.get_items() to avoid having to do
|
// them once when they are returned by this._recentManager.get_items() to avoid having to do
|
||||||
// this sorting each time, but the sorting seems to be very fast anyway, so there is no need
|
// this sorting each time, but the sorting seems to be very fast anyway, so there is no need
|
||||||
|
@ -380,13 +380,13 @@ GenericDisplay.prototype = {
|
|||||||
this._redisplay(true);
|
this._redisplay(true);
|
||||||
},
|
},
|
||||||
|
|
||||||
// Launches the item that is currently selected, closing the overlay
|
// Launches the item that is currently selected, closing the Overview
|
||||||
activateSelected: function() {
|
activateSelected: function() {
|
||||||
if (this._selectedIndex != -1) {
|
if (this._selectedIndex != -1) {
|
||||||
let selected = this._findDisplayedByIndex(this._selectedIndex);
|
let selected = this._findDisplayedByIndex(this._selectedIndex);
|
||||||
selected.launch();
|
selected.launch();
|
||||||
this.unsetSelected();
|
this.unsetSelected();
|
||||||
Main.overlay.hide();
|
Main.overview.hide();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ const Shell = imports.gi.Shell;
|
|||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
|
|
||||||
const Chrome = imports.ui.chrome;
|
const Chrome = imports.ui.chrome;
|
||||||
const Overlay = imports.ui.overlay;
|
const Overview = imports.ui.overview;
|
||||||
const Panel = imports.ui.panel;
|
const Panel = imports.ui.panel;
|
||||||
const RunDialog = imports.ui.runDialog;
|
const RunDialog = imports.ui.runDialog;
|
||||||
const LookingGlass = imports.ui.lookingGlass;
|
const LookingGlass = imports.ui.lookingGlass;
|
||||||
@ -24,7 +24,7 @@ DEFAULT_BACKGROUND_COLOR.from_pixel(0x2266bbff);
|
|||||||
let chrome = null;
|
let chrome = null;
|
||||||
let panel = null;
|
let panel = null;
|
||||||
let sidebar = null;
|
let sidebar = null;
|
||||||
let overlay = null;
|
let overview = null;
|
||||||
let runDialog = null;
|
let runDialog = null;
|
||||||
let lookingGlass = null;
|
let lookingGlass = null;
|
||||||
let wm = null;
|
let wm = null;
|
||||||
@ -46,7 +46,7 @@ function start() {
|
|||||||
global.stage.color = DEFAULT_BACKGROUND_COLOR;
|
global.stage.color = DEFAULT_BACKGROUND_COLOR;
|
||||||
|
|
||||||
// Mutter currently hardcodes putting "Yessir. The compositor is running""
|
// Mutter currently hardcodes putting "Yessir. The compositor is running""
|
||||||
// in the overlay. Clear that out.
|
// in the Overview. Clear that out.
|
||||||
let children = global.overlay_group.get_children();
|
let children = global.overlay_group.get_children();
|
||||||
for (let i = 0; i < children.length; i++)
|
for (let i = 0; i < children.length; i++)
|
||||||
children[i].destroy();
|
children[i].destroy();
|
||||||
@ -59,7 +59,7 @@ function start() {
|
|||||||
runDialog.open();
|
runDialog.open();
|
||||||
});
|
});
|
||||||
|
|
||||||
overlay = new Overlay.Overlay();
|
overview = new Overview.Overview();
|
||||||
chrome = new Chrome.Chrome();
|
chrome = new Chrome.Chrome();
|
||||||
panel = new Panel.Panel();
|
panel = new Panel.Panel();
|
||||||
sidebar = new Sidebar.Sidebar();
|
sidebar = new Sidebar.Sidebar();
|
||||||
@ -80,8 +80,8 @@ function start() {
|
|||||||
panel.startupAnimation();
|
panel.startupAnimation();
|
||||||
|
|
||||||
let display = global.screen.get_display();
|
let display = global.screen.get_display();
|
||||||
display.connect('overlay-key', Lang.bind(overlay, overlay.toggle));
|
display.connect('overlay-key', Lang.bind(overview, overview.toggle));
|
||||||
global.connect('panel-main-menu', Lang.bind(overlay, overlay.toggle));
|
global.connect('panel-main-menu', Lang.bind(overview, overview.toggle));
|
||||||
|
|
||||||
Mainloop.idle_add(_removeUnusedWorkspaces);
|
Mainloop.idle_add(_removeUnusedWorkspaces);
|
||||||
}
|
}
|
||||||
|
@ -19,14 +19,14 @@ const Dash = imports.ui.dash;
|
|||||||
const Tweener = imports.ui.tweener;
|
const Tweener = imports.ui.tweener;
|
||||||
const Workspaces = imports.ui.workspaces;
|
const Workspaces = imports.ui.workspaces;
|
||||||
|
|
||||||
const ROOT_OVERLAY_COLOR = new Clutter.Color();
|
const ROOT_OVERVIEW_COLOR = new Clutter.Color();
|
||||||
ROOT_OVERLAY_COLOR.from_pixel(0x000000ff);
|
ROOT_OVERVIEW_COLOR.from_pixel(0x000000ff);
|
||||||
|
|
||||||
// Time for initial animation going into overlay mode
|
// Time for initial animation going into Overview mode
|
||||||
const ANIMATION_TIME = 0.25;
|
const ANIMATION_TIME = 0.25;
|
||||||
|
|
||||||
// We divide the screen into a grid of rows and columns, which we use
|
// We divide the screen into a grid of rows and columns, which we use
|
||||||
// to help us position the overlay components, such as the side panel
|
// to help us position the Overview components, such as the side panel
|
||||||
// that lists applications and documents, the workspaces display, and
|
// that lists applications and documents, the workspaces display, and
|
||||||
// the button for adding additional workspaces.
|
// the button for adding additional workspaces.
|
||||||
// In the regular mode, the side panel takes up one column on the left,
|
// In the regular mode, the side panel takes up one column on the left,
|
||||||
@ -74,11 +74,11 @@ let wideScreen = false;
|
|||||||
let displayGridColumnWidth = null;
|
let displayGridColumnWidth = null;
|
||||||
let displayGridRowHeight = null;
|
let displayGridRowHeight = null;
|
||||||
|
|
||||||
function Overlay() {
|
function Overview() {
|
||||||
this._init();
|
this._init();
|
||||||
}
|
}
|
||||||
|
|
||||||
Overlay.prototype = {
|
Overview.prototype = {
|
||||||
_init : function() {
|
_init : function() {
|
||||||
let me = this;
|
let me = this;
|
||||||
|
|
||||||
@ -101,8 +101,8 @@ Overlay.prototype = {
|
|||||||
reactive: true });
|
reactive: true });
|
||||||
this._group.add_actor(this._transparentBackground);
|
this._group.add_actor(this._transparentBackground);
|
||||||
|
|
||||||
// Background color for the overlay
|
// Background color for the Overview
|
||||||
this._backOver = new Clutter.Rectangle({ color: ROOT_OVERLAY_COLOR });
|
this._backOver = new Clutter.Rectangle({ color: ROOT_OVERVIEW_COLOR });
|
||||||
this._group.add_actor(this._backOver);
|
this._group.add_actor(this._backOver);
|
||||||
|
|
||||||
this._group.hide();
|
this._group.hide();
|
||||||
@ -203,7 +203,7 @@ Overlay.prototype = {
|
|||||||
//// Draggable target interface ////
|
//// Draggable target interface ////
|
||||||
|
|
||||||
// Closes any active panes if a GenericDisplayItem is being
|
// Closes any active panes if a GenericDisplayItem is being
|
||||||
// dragged over the overlay, i.e. as soon as it starts being dragged.
|
// dragged over the Overview, i.e. as soon as it starts being dragged.
|
||||||
// This allows the user to place the item on any workspace.
|
// This allows the user to place the item on any workspace.
|
||||||
handleDragOver : function(source, actor, x, y, time) {
|
handleDragOver : function(source, actor, x, y, time) {
|
||||||
if (source instanceof GenericDisplay.GenericDisplayItem
|
if (source instanceof GenericDisplay.GenericDisplayItem
|
||||||
@ -218,13 +218,13 @@ Overlay.prototype = {
|
|||||||
|
|
||||||
//// Public methods ////
|
//// Public methods ////
|
||||||
|
|
||||||
// Returns the scale the overlay has when we just start zooming out
|
// Returns the scale the Overview has when we just start zooming out
|
||||||
// to overview mode. That is, when just the active workspace is showing.
|
// to overview mode. That is, when just the active workspace is showing.
|
||||||
getZoomedInScale : function() {
|
getZoomedInScale : function() {
|
||||||
return 1 / this._workspaces.getScale();
|
return 1 / this._workspaces.getScale();
|
||||||
},
|
},
|
||||||
|
|
||||||
// Returns the position the overlay has when we just start zooming out
|
// Returns the position the Overview has when we just start zooming out
|
||||||
// to overview mode. That is, when just the active workspace is showing.
|
// to overview mode. That is, when just the active workspace is showing.
|
||||||
getZoomedInPosition : function() {
|
getZoomedInPosition : function() {
|
||||||
let [posX, posY] = this._workspaces.getActiveWorkspacePosition();
|
let [posX, posY] = this._workspaces.getActiveWorkspacePosition();
|
||||||
@ -233,12 +233,12 @@ Overlay.prototype = {
|
|||||||
return [- posX * scale, - posY * scale];
|
return [- posX * scale, - posY * scale];
|
||||||
},
|
},
|
||||||
|
|
||||||
// Returns the current scale of the overlay.
|
// Returns the current scale of the Overview.
|
||||||
getScale : function() {
|
getScale : function() {
|
||||||
return this._group.scaleX;
|
return this._group.scaleX;
|
||||||
},
|
},
|
||||||
|
|
||||||
// Returns the current position of the overlay.
|
// Returns the current position of the Overview.
|
||||||
getPosition : function() {
|
getPosition : function() {
|
||||||
return [this._group.x, this._group.y];
|
return [this._group.x, this._group.y];
|
||||||
},
|
},
|
||||||
@ -278,16 +278,16 @@ Overlay.prototype = {
|
|||||||
this._group.add_actor(this._workspaces.actor);
|
this._group.add_actor(this._workspaces.actor);
|
||||||
|
|
||||||
// All the the actors in the window group are completely obscured,
|
// All the the actors in the window group are completely obscured,
|
||||||
// hiding the group holding them while the overlay is displayed greatly
|
// hiding the group holding them while the Overview is displayed greatly
|
||||||
// increases performance of the overlay especially when there are many
|
// increases performance of the Overview especially when there are many
|
||||||
// windows visible.
|
// windows visible.
|
||||||
//
|
//
|
||||||
// If we switched to displaying the actors in the overlay rather than
|
// If we switched to displaying the actors in the Overview rather than
|
||||||
// clones of them, this would obviously no longer be necessary.
|
// clones of them, this would obviously no longer be necessary.
|
||||||
global.window_group.hide();
|
global.window_group.hide();
|
||||||
this._group.show();
|
this._group.show();
|
||||||
|
|
||||||
// Create a zoom out effect. First scale the overlay group up and
|
// Create a zoom out effect. First scale the Overview group up and
|
||||||
// position it so that the active workspace fills up the whole screen,
|
// position it so that the active workspace fills up the whole screen,
|
||||||
// then transform the group to its normal dimensions and position.
|
// then transform the group to its normal dimensions and position.
|
||||||
// The opposite transition is used in hide().
|
// The opposite transition is used in hide().
|
||||||
@ -327,7 +327,7 @@ Overlay.prototype = {
|
|||||||
this._activeDisplayPane.close();
|
this._activeDisplayPane.close();
|
||||||
this._workspaces.hide();
|
this._workspaces.hide();
|
||||||
|
|
||||||
// Create a zoom in effect by transforming the overlay group so that
|
// Create a zoom in effect by transforming the Overview group so that
|
||||||
// the active workspace fills up the whole screen. The opposite
|
// the active workspace fills up the whole screen. The opposite
|
||||||
// transition is used in show().
|
// transition is used in show().
|
||||||
let scale = this.getZoomedInScale();
|
let scale = this.getZoomedInScale();
|
||||||
@ -367,11 +367,11 @@ Overlay.prototype = {
|
|||||||
*
|
*
|
||||||
* Make the given MetaWindow be the focus window, switching
|
* Make the given MetaWindow be the focus window, switching
|
||||||
* to the workspace it's on if necessary. This function
|
* to the workspace it's on if necessary. This function
|
||||||
* should only be used when the overlay is currently active;
|
* should only be used when the Overview is currently active;
|
||||||
* outside of that, use the relevant methods on MetaDisplay.
|
* outside of that, use the relevant methods on MetaDisplay.
|
||||||
*/
|
*/
|
||||||
activateWindow: function (metaWindow, time) {
|
activateWindow: function (metaWindow, time) {
|
||||||
this._workspaces.activateWindowFromOverlay(metaWindow, time);
|
this._workspaces.activateWindowFromOverview(metaWindow, time);
|
||||||
this.hide();
|
this.hide();
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -405,4 +405,4 @@ Overlay.prototype = {
|
|||||||
this.emit('hidden');
|
this.emit('hidden');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Signals.addSignalMethods(Overlay.prototype);
|
Signals.addSignalMethods(Overview.prototype);
|
@ -164,22 +164,22 @@ Panel.prototype = {
|
|||||||
}));
|
}));
|
||||||
this._traymanager.manage_stage(global.stage);
|
this._traymanager.manage_stage(global.stage);
|
||||||
|
|
||||||
// TODO: decide what to do with the rest of the panel in the overlay mode (make it fade-out, become non-reactive, etc.)
|
// TODO: decide what to do with the rest of the panel in the Overview mode (make it fade-out, become non-reactive, etc.)
|
||||||
// We get into the overlay mode on button-press-event as opposed to button-release-event because eventually we'll probably
|
// We get into the Overview mode on button-press-event as opposed to button-release-event because eventually we'll probably
|
||||||
// have the overlay act like a menu that allows the user to release the mouse on the activity the user wants
|
// have the Overview act like a menu that allows the user to release the mouse on the activity the user wants
|
||||||
// to switch to.
|
// to switch to.
|
||||||
this.button.button.connect('button-press-event',
|
this.button.button.connect('button-press-event',
|
||||||
Lang.bind(Main.overlay, Main.overlay.toggle));
|
Lang.bind(Main.overview, Main.overview.toggle));
|
||||||
// In addition to pressing the button, the overlay can be entered and exited by other means, such as
|
// In addition to pressing the button, the Overview can be entered and exited by other means, such as
|
||||||
// pressing the System key, Alt+F1 or Esc. We want the button to be pressed in when the overlay is entered
|
// pressing the System key, Alt+F1 or Esc. We want the button to be pressed in when the Overview is entered
|
||||||
// and to be released when it is exited regardless of how it was triggered.
|
// and to be released when it is exited regardless of how it was triggered.
|
||||||
Main.overlay.connect('showing', Lang.bind(this.button, this.button.pressIn));
|
Main.overview.connect('showing', Lang.bind(this.button, this.button.pressIn));
|
||||||
Main.overlay.connect('hiding', Lang.bind(this.button, this.button.release));
|
Main.overview.connect('hiding', Lang.bind(this.button, this.button.release));
|
||||||
|
|
||||||
this.actor.add_actor(box);
|
this.actor.add_actor(box);
|
||||||
|
|
||||||
Main.chrome.addActor(this.actor, box);
|
Main.chrome.addActor(this.actor, box);
|
||||||
Main.chrome.setVisibleInOverlay(this.actor, true);
|
Main.chrome.setVisibleInOverview(this.actor, true);
|
||||||
|
|
||||||
// Start the clock
|
// Start the clock
|
||||||
this._updateClock();
|
this._updateClock();
|
||||||
@ -219,8 +219,8 @@ Panel.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_onHotCornerTriggered : function() {
|
_onHotCornerTriggered : function() {
|
||||||
if (!Main.overlay.animationInProgress) {
|
if (!Main.overview.animationInProgress) {
|
||||||
Main.overlay.toggle();
|
Main.overview.toggle();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ Places.prototype = {
|
|||||||
let homeIcon = Shell.util_get_icon_for_uri (homeUri);
|
let homeIcon = Shell.util_get_icon_for_uri (homeUri);
|
||||||
let homeTexture = Shell.TextureCache.get_default().load_gicon(homeIcon, PLACES_ICON_SIZE);
|
let homeTexture = Shell.TextureCache.get_default().load_gicon(homeIcon, PLACES_ICON_SIZE);
|
||||||
let home = new PlaceDisplay(homeLabel, homeTexture, Lang.bind(this, function() {
|
let home = new PlaceDisplay(homeLabel, homeTexture, Lang.bind(this, function() {
|
||||||
Main.overlay.hide();
|
Main.overview.hide();
|
||||||
Gio.app_info_launch_default_for_uri(homeUri, Main.createAppLaunchContext());
|
Gio.app_info_launch_default_for_uri(homeUri, Main.createAppLaunchContext());
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ Places.prototype = {
|
|||||||
if (networkApp != null) {
|
if (networkApp != null) {
|
||||||
let networkIcon = networkApp.create_icon_texture(PLACES_ICON_SIZE);
|
let networkIcon = networkApp.create_icon_texture(PLACES_ICON_SIZE);
|
||||||
let network = new PlaceDisplay(networkApp.get_name(), networkIcon, Lang.bind(this, function () {
|
let network = new PlaceDisplay(networkApp.get_name(), networkIcon, Lang.bind(this, function () {
|
||||||
Main.overlay.hide();
|
Main.overview.hide();
|
||||||
networkApp.launch();
|
networkApp.launch();
|
||||||
}));
|
}));
|
||||||
this._menuBox.append(network.actor, Big.BoxPackFlags.NONE);
|
this._menuBox.append(network.actor, Big.BoxPackFlags.NONE);
|
||||||
@ -87,7 +87,7 @@ Places.prototype = {
|
|||||||
|
|
||||||
let connectIcon = Shell.TextureCache.get_default().load_icon_name("applications-internet", PLACES_ICON_SIZE);
|
let connectIcon = Shell.TextureCache.get_default().load_icon_name("applications-internet", PLACES_ICON_SIZE);
|
||||||
let connect = new PlaceDisplay('Connect to...', connectIcon, Lang.bind(this, function () {
|
let connect = new PlaceDisplay('Connect to...', connectIcon, Lang.bind(this, function () {
|
||||||
Main.overlay.hide();
|
Main.overview.hide();
|
||||||
new Shell.Process({ args: ['nautilus-connect-server'] }).run();
|
new Shell.Process({ args: ['nautilus-connect-server'] }).run();
|
||||||
}));
|
}));
|
||||||
this._menuBox.append(connect.actor, Big.BoxPackFlags.NONE);
|
this._menuBox.append(connect.actor, Big.BoxPackFlags.NONE);
|
||||||
@ -149,7 +149,7 @@ Places.prototype = {
|
|||||||
let icon = Shell.util_get_icon_for_uri(bookmark);
|
let icon = Shell.util_get_icon_for_uri(bookmark);
|
||||||
let iconTexture = Shell.TextureCache.get_default().load_gicon(icon, PLACES_ICON_SIZE);
|
let iconTexture = Shell.TextureCache.get_default().load_gicon(icon, PLACES_ICON_SIZE);
|
||||||
let item = new PlaceDisplay(label, iconTexture, Lang.bind(this, function() {
|
let item = new PlaceDisplay(label, iconTexture, Lang.bind(this, function() {
|
||||||
Main.overlay.hide();
|
Main.overview.hide();
|
||||||
Gio.app_info_launch_default_for_uri(bookmark, Main.createAppLaunchContext());
|
Gio.app_info_launch_default_for_uri(bookmark, Main.createAppLaunchContext());
|
||||||
}));
|
}));
|
||||||
this._dirsBox.append(item.actor, Big.BoxPackFlags.NONE);
|
this._dirsBox.append(item.actor, Big.BoxPackFlags.NONE);
|
||||||
|
@ -85,7 +85,7 @@ WindowManager.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_shouldAnimate : function(actor) {
|
_shouldAnimate : function(actor) {
|
||||||
if (Main.overlay.visible)
|
if (Main.overview.visible)
|
||||||
return false;
|
return false;
|
||||||
if (actor && (actor.get_window_type() != Meta.CompWindowType.NORMAL))
|
if (actor && (actor.get_window_type() != Meta.CompWindowType.NORMAL))
|
||||||
return false;
|
return false;
|
||||||
|
@ -15,7 +15,7 @@ const AppDisplay = imports.ui.appDisplay;
|
|||||||
const DND = imports.ui.dnd;
|
const DND = imports.ui.dnd;
|
||||||
const GenericDisplay = imports.ui.genericDisplay;
|
const GenericDisplay = imports.ui.genericDisplay;
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
const Overlay = imports.ui.overlay;
|
const Overview = imports.ui.overview;
|
||||||
const Panel = imports.ui.panel;
|
const Panel = imports.ui.panel;
|
||||||
const Tweener = imports.ui.tweener;
|
const Tweener = imports.ui.tweener;
|
||||||
|
|
||||||
@ -293,16 +293,16 @@ Workspace.prototype = {
|
|||||||
Lang.bind(this,
|
Lang.bind(this,
|
||||||
function(clone, time) {
|
function(clone, time) {
|
||||||
this._metaWorkspace.activate(time);
|
this._metaWorkspace.activate(time);
|
||||||
Main.overlay.hide();
|
Main.overview.hide();
|
||||||
}));
|
}));
|
||||||
this.actor.add_actor(this._desktop.actor);
|
this.actor.add_actor(this._desktop.actor);
|
||||||
|
|
||||||
// Create clones for remaining windows that should be
|
// Create clones for remaining windows that should be
|
||||||
// visible in the overlay
|
// visible in the Overview
|
||||||
this._windows = [this._desktop];
|
this._windows = [this._desktop];
|
||||||
this._windowIcons = [ null ];
|
this._windowIcons = [ null ];
|
||||||
for (let i = 0; i < windows.length; i++) {
|
for (let i = 0; i < windows.length; i++) {
|
||||||
if (this._isOverlayWindow(windows[i])) {
|
if (this._isOverviewWindow(windows[i])) {
|
||||||
this._addWindowClone(windows[i]);
|
this._addWindowClone(windows[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -318,7 +318,7 @@ Workspace.prototype = {
|
|||||||
|
|
||||||
this._frame = null;
|
this._frame = null;
|
||||||
|
|
||||||
this.leavingOverlay = false;
|
this.leavingOverview = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
updateRemovable : function() {
|
updateRemovable : function() {
|
||||||
@ -346,7 +346,7 @@ Workspace.prototype = {
|
|||||||
this._removeButton.set_opacity(0);
|
this._removeButton.set_opacity(0);
|
||||||
Tweener.addTween(this._removeButton,
|
Tweener.addTween(this._removeButton,
|
||||||
{ opacity: 255,
|
{ opacity: 255,
|
||||||
time: Overlay.ANIMATION_TIME,
|
time: Overview.ANIMATION_TIME,
|
||||||
transition: "easeOutQuad"
|
transition: "easeOutQuad"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -357,7 +357,7 @@ Workspace.prototype = {
|
|||||||
if (this._visible) {
|
if (this._visible) {
|
||||||
Tweener.addTween(this._removeButton,
|
Tweener.addTween(this._removeButton,
|
||||||
{ opacity: 0,
|
{ opacity: 0,
|
||||||
time: Overlay.ANIMATION_TIME,
|
time: Overview.ANIMATION_TIME,
|
||||||
transition: "easeOutQuad",
|
transition: "easeOutQuad",
|
||||||
onComplete: this._removeRemoveButton,
|
onComplete: this._removeRemoveButton,
|
||||||
onCompleteScope: this
|
onCompleteScope: this
|
||||||
@ -428,7 +428,7 @@ Workspace.prototype = {
|
|||||||
this._desktop.actor.height + 2 * FRAME_SIZE / this.actor.scale_y);
|
this._desktop.actor.height + 2 * FRAME_SIZE / this.actor.scale_y);
|
||||||
},
|
},
|
||||||
|
|
||||||
// Reposition all windows in their zoomed-to-overlay position. if workspaceZooming
|
// Reposition all windows in their zoomed-to-Overview position. if workspaceZooming
|
||||||
// is true, then the workspace is moving at the same time and we need to take
|
// is true, then the workspace is moving at the same time and we need to take
|
||||||
// that into account
|
// that into account
|
||||||
positionWindows : function(workspaceZooming) {
|
positionWindows : function(workspaceZooming) {
|
||||||
@ -460,7 +460,7 @@ Workspace.prototype = {
|
|||||||
scale_x: scale,
|
scale_x: scale,
|
||||||
scale_y: scale,
|
scale_y: scale,
|
||||||
workspace_relative: workspaceZooming ? this : null,
|
workspace_relative: workspaceZooming ? this : null,
|
||||||
time: Overlay.ANIMATION_TIME,
|
time: Overview.ANIMATION_TIME,
|
||||||
transition: "easeOutQuad",
|
transition: "easeOutQuad",
|
||||||
onComplete: Lang.bind(this, function() {
|
onComplete: Lang.bind(this, function() {
|
||||||
this._fadeInWindowIcon(clone, icon);
|
this._fadeInWindowIcon(clone, icon);
|
||||||
@ -494,7 +494,7 @@ Workspace.prototype = {
|
|||||||
icon.raise(this.actor);
|
icon.raise(this.actor);
|
||||||
Tweener.addTween(icon,
|
Tweener.addTween(icon,
|
||||||
{ opacity: 255,
|
{ opacity: 255,
|
||||||
time: Overlay.ANIMATION_TIME,
|
time: Overview.ANIMATION_TIME,
|
||||||
transition: "easeOutQuad" });
|
transition: "easeOutQuad" });
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -531,14 +531,14 @@ Workspace.prototype = {
|
|||||||
|
|
||||||
// If metaWin.get_compositor_private() returned non-NULL, that
|
// If metaWin.get_compositor_private() returned non-NULL, that
|
||||||
// means the window still exists (and is just being moved to
|
// means the window still exists (and is just being moved to
|
||||||
// another workspace or something), so set its overlayHint
|
// another workspace or something), so set its overviewHint
|
||||||
// accordingly. (If it returned NULL, then the window is being
|
// accordingly. (If it returned NULL, then the window is being
|
||||||
// destroyed; we'd like to animate this, but it's too late at
|
// destroyed; we'd like to animate this, but it's too late at
|
||||||
// this point.)
|
// this point.)
|
||||||
if (win) {
|
if (win) {
|
||||||
let [stageX, stageY] = clone.actor.get_transformed_position();
|
let [stageX, stageY] = clone.actor.get_transformed_position();
|
||||||
let [stageWidth, stageHeight] = clone.actor.get_transformed_size();
|
let [stageWidth, stageHeight] = clone.actor.get_transformed_size();
|
||||||
win._overlayHint = {
|
win._overviewHint = {
|
||||||
x: stageX,
|
x: stageX,
|
||||||
y: stageY,
|
y: stageY,
|
||||||
scale: stageWidth / clone.actor.width
|
scale: stageWidth / clone.actor.width
|
||||||
@ -552,7 +552,7 @@ Workspace.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_windowAdded : function(metaWorkspace, metaWin) {
|
_windowAdded : function(metaWorkspace, metaWin) {
|
||||||
if (this.leavingOverlay)
|
if (this.leavingOverview)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let win = metaWin.get_compositor_private();
|
let win = metaWin.get_compositor_private();
|
||||||
@ -569,16 +569,16 @@ Workspace.prototype = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this._isOverlayWindow(win))
|
if (!this._isOverviewWindow(win))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let clone = this._addWindowClone(win);
|
let clone = this._addWindowClone(win);
|
||||||
|
|
||||||
if (win._overlayHint) {
|
if (win._overviewHint) {
|
||||||
let x = (win._overlayHint.x - this.actor.x) / this.scale;
|
let x = (win._overviewHint.x - this.actor.x) / this.scale;
|
||||||
let y = (win._overlayHint.y - this.actor.y) / this.scale;
|
let y = (win._overviewHint.y - this.actor.y) / this.scale;
|
||||||
let scale = win._overlayHint.scale / this.scale;
|
let scale = win._overviewHint.scale / this.scale;
|
||||||
delete win._overlayHint;
|
delete win._overviewHint;
|
||||||
|
|
||||||
clone.actor.set_position (x, y);
|
clone.actor.set_position (x, y);
|
||||||
clone.actor.set_scale (scale, scale);
|
clone.actor.set_scale (scale, scale);
|
||||||
@ -588,8 +588,8 @@ Workspace.prototype = {
|
|||||||
this.updateRemovable();
|
this.updateRemovable();
|
||||||
},
|
},
|
||||||
|
|
||||||
// Animate the full-screen to overlay transition.
|
// Animate the full-screen to Overview transition.
|
||||||
zoomToOverlay : function() {
|
zoomToOverview : function() {
|
||||||
this.actor.set_position(this.gridX, this.gridY);
|
this.actor.set_position(this.gridX, this.gridY);
|
||||||
this.actor.set_scale(this.scale, this.scale);
|
this.actor.set_scale(this.scale, this.scale);
|
||||||
|
|
||||||
@ -603,7 +603,7 @@ Workspace.prototype = {
|
|||||||
this._removeButton.opacity = 0;
|
this._removeButton.opacity = 0;
|
||||||
Tweener.addTween(this._removeButton,
|
Tweener.addTween(this._removeButton,
|
||||||
{ opacity: 255,
|
{ opacity: 255,
|
||||||
time: Overlay.ANIMATION_TIME,
|
time: Overview.ANIMATION_TIME,
|
||||||
transition: 'easeOutQuad'
|
transition: 'easeOutQuad'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -611,14 +611,14 @@ Workspace.prototype = {
|
|||||||
this._visible = true;
|
this._visible = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
// Animates the return from overlay mode
|
// Animates the return from Overview mode
|
||||||
zoomFromOverlay : function() {
|
zoomFromOverview : function() {
|
||||||
this.leavingOverlay = true;
|
this.leavingOverview = true;
|
||||||
|
|
||||||
this._hideAllIcons();
|
this._hideAllIcons();
|
||||||
|
|
||||||
Main.overlay.connect('hidden', Lang.bind(this,
|
Main.overview.connect('hidden', Lang.bind(this,
|
||||||
this._doneLeavingOverlay));
|
this._doneLeavingOverview));
|
||||||
|
|
||||||
// Fade out the remove button if available, so that it doesn't
|
// Fade out the remove button if available, so that it doesn't
|
||||||
// disappear too abrubtly and doesn't become too big.
|
// disappear too abrubtly and doesn't become too big.
|
||||||
@ -626,7 +626,7 @@ Workspace.prototype = {
|
|||||||
Tweener.removeTweens(this._removeButton);
|
Tweener.removeTweens(this._removeButton);
|
||||||
Tweener.addTween(this._removeButton,
|
Tweener.addTween(this._removeButton,
|
||||||
{ opacity: 0,
|
{ opacity: 0,
|
||||||
time: Overlay.ANIMATION_TIME,
|
time: Overview.ANIMATION_TIME,
|
||||||
transition: 'easeOutQuad'
|
transition: 'easeOutQuad'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -640,7 +640,7 @@ Workspace.prototype = {
|
|||||||
scale_x: 1.0,
|
scale_x: 1.0,
|
||||||
scale_y: 1.0,
|
scale_y: 1.0,
|
||||||
workspace_relative: this,
|
workspace_relative: this,
|
||||||
time: Overlay.ANIMATION_TIME,
|
time: Overview.ANIMATION_TIME,
|
||||||
opacity: 255,
|
opacity: 255,
|
||||||
transition: "easeOutQuad"
|
transition: "easeOutQuad"
|
||||||
});
|
});
|
||||||
@ -658,7 +658,7 @@ Workspace.prototype = {
|
|||||||
y: this.gridY,
|
y: this.gridY,
|
||||||
scale_x: this.scale,
|
scale_x: this.scale,
|
||||||
scale_y: this.scale,
|
scale_y: this.scale,
|
||||||
time: Overlay.ANIMATION_TIME,
|
time: Overview.ANIMATION_TIME,
|
||||||
transition: "easeOutQuad",
|
transition: "easeOutQuad",
|
||||||
onComplete: Lang.bind(this, this._fadeInAllIcons)
|
onComplete: Lang.bind(this, this._fadeInAllIcons)
|
||||||
});
|
});
|
||||||
@ -680,7 +680,7 @@ Workspace.prototype = {
|
|||||||
y: this.gridY,
|
y: this.gridY,
|
||||||
scale_x: this.scale,
|
scale_x: this.scale,
|
||||||
scale_y: this.scale,
|
scale_y: this.scale,
|
||||||
time: Overlay.ANIMATION_TIME,
|
time: Overview.ANIMATION_TIME,
|
||||||
transition: "easeOutQuad"
|
transition: "easeOutQuad"
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -703,7 +703,7 @@ Workspace.prototype = {
|
|||||||
y: destY,
|
y: destY,
|
||||||
scale_x: this.scale,
|
scale_x: this.scale,
|
||||||
scale_y: this.scale,
|
scale_y: this.scale,
|
||||||
time: Overlay.ANIMATION_TIME,
|
time: Overview.ANIMATION_TIME,
|
||||||
transition: "easeOutQuad",
|
transition: "easeOutQuad",
|
||||||
onComplete: onComplete
|
onComplete: onComplete
|
||||||
});
|
});
|
||||||
@ -726,9 +726,9 @@ Workspace.prototype = {
|
|||||||
this._metaWorkspace.disconnect(this._windowRemovedId);
|
this._metaWorkspace.disconnect(this._windowRemovedId);
|
||||||
},
|
},
|
||||||
|
|
||||||
// Sets this.leavingOverlay flag to false.
|
// Sets this.leavingOverview flag to false.
|
||||||
_doneLeavingOverlay : function() {
|
_doneLeavingOverview : function() {
|
||||||
this.leavingOverlay = false;
|
this.leavingOverview = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
// Tests if @win belongs to this workspaces
|
// Tests if @win belongs to this workspaces
|
||||||
@ -737,8 +737,8 @@ Workspace.prototype = {
|
|||||||
(win.get_meta_window() && win.get_meta_window().is_on_all_workspaces());
|
(win.get_meta_window() && win.get_meta_window().is_on_all_workspaces());
|
||||||
},
|
},
|
||||||
|
|
||||||
// Tests if @win should be shown in the overlay
|
// Tests if @win should be shown in the Overview
|
||||||
_isOverlayWindow : function (win) {
|
_isOverviewWindow : function (win) {
|
||||||
let wintype = win.get_window_type();
|
let wintype = win.get_window_type();
|
||||||
if (wintype == Meta.WindowType.DESKTOP ||
|
if (wintype == Meta.WindowType.DESKTOP ||
|
||||||
wintype == Meta.WindowType.DOCK)
|
wintype == Meta.WindowType.DOCK)
|
||||||
@ -813,7 +813,7 @@ Workspace.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_onCloneSelected : function (clone, time) {
|
_onCloneSelected : function (clone, time) {
|
||||||
Main.overlay.activateWindow(clone.metaWindow, time);
|
Main.overview.activateWindow(clone.metaWindow, time);
|
||||||
},
|
},
|
||||||
|
|
||||||
_removeSelf : function(actor, event) {
|
_removeSelf : function(actor, event) {
|
||||||
@ -836,7 +836,7 @@ Workspace.prototype = {
|
|||||||
|
|
||||||
// Set a hint on the Mutter.Window so its initial position
|
// Set a hint on the Mutter.Window so its initial position
|
||||||
// in the new workspace will be correct
|
// in the new workspace will be correct
|
||||||
win._overlayHint = {
|
win._overviewHint = {
|
||||||
x: actor.x,
|
x: actor.x,
|
||||||
y: actor.y,
|
y: actor.y,
|
||||||
scale: actor.scale_x
|
scale: actor.scale_x
|
||||||
@ -911,11 +911,11 @@ Workspaces.prototype = {
|
|||||||
// Position/scale the desktop windows and their children after the
|
// Position/scale the desktop windows and their children after the
|
||||||
// workspaces have been created. This cannot be done first because
|
// workspaces have been created. This cannot be done first because
|
||||||
// window movement depends on the Workspaces object being accessible
|
// window movement depends on the Workspaces object being accessible
|
||||||
// as an Overlay member.
|
// as an Overview member.
|
||||||
Main.overlay.connect('showing',
|
Main.overview.connect('showing',
|
||||||
Lang.bind(this, function() {
|
Lang.bind(this, function() {
|
||||||
for (let w = 0; w < this._workspaces.length; w++)
|
for (let w = 0; w < this._workspaces.length; w++)
|
||||||
this._workspaces[w].zoomToOverlay();
|
this._workspaces[w].zoomToOverview();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Track changes to the number of workspaces
|
// Track changes to the number of workspaces
|
||||||
@ -936,8 +936,8 @@ Workspaces.prototype = {
|
|||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
|
|
||||||
// Should only be called from active overlay context
|
// Should only be called from active Overview context
|
||||||
activateWindowFromOverlay: function (metaWindow, time) {
|
activateWindowFromOverview: function (metaWindow, time) {
|
||||||
let global = Shell.Global.get();
|
let global = Shell.Global.get();
|
||||||
let activeWorkspaceNum = global.screen.get_active_workspace_index();
|
let activeWorkspaceNum = global.screen.get_active_workspace_index();
|
||||||
let windowWorkspaceNum = metaWindow.get_workspace().index();
|
let windowWorkspaceNum = metaWindow.get_workspace().index();
|
||||||
@ -962,7 +962,7 @@ Workspaces.prototype = {
|
|||||||
activeWorkspace.actor.raise_top();
|
activeWorkspace.actor.raise_top();
|
||||||
|
|
||||||
for (let w = 0; w < this._workspaces.length; w++)
|
for (let w = 0; w < this._workspaces.length; w++)
|
||||||
this._workspaces[w].zoomFromOverlay();
|
this._workspaces[w].zoomFromOverview();
|
||||||
},
|
},
|
||||||
|
|
||||||
destroy : function() {
|
destroy : function() {
|
||||||
@ -1138,49 +1138,49 @@ Workspaces.prototype = {
|
|||||||
Tweener.registerSpecialPropertyModifier("workspace_relative", _workspaceRelativeModifier, _workspaceRelativeGet);
|
Tweener.registerSpecialPropertyModifier("workspace_relative", _workspaceRelativeModifier, _workspaceRelativeGet);
|
||||||
|
|
||||||
function _workspaceRelativeModifier(workspace) {
|
function _workspaceRelativeModifier(workspace) {
|
||||||
let [startX, startY] = Main.overlay.getPosition();
|
let [startX, startY] = Main.overview.getPosition();
|
||||||
let overlayPosX, overlayPosY, overlayScale;
|
let overviewPosX, overviewPosY, overviewScale;
|
||||||
|
|
||||||
if (!workspace)
|
if (!workspace)
|
||||||
return [];
|
return [];
|
||||||
|
|
||||||
if (workspace.leavingOverlay) {
|
if (workspace.leavingOverview) {
|
||||||
let [zoomedInX, zoomedInY] = Main.overlay.getZoomedInPosition();
|
let [zoomedInX, zoomedInY] = Main.overview.getZoomedInPosition();
|
||||||
overlayPosX = { begin: startX, end: zoomedInX };
|
overviewPosX = { begin: startX, end: zoomedInX };
|
||||||
overlayPosY = { begin: startY, end: zoomedInY };
|
overviewPosY = { begin: startY, end: zoomedInY };
|
||||||
overlayScale = { begin: Main.overlay.getScale(),
|
overviewScale = { begin: Main.overview.getScale(),
|
||||||
end: Main.overlay.getZoomedInScale() };
|
end: Main.overview.getZoomedInScale() };
|
||||||
} else {
|
} else {
|
||||||
overlayPosX = { begin: startX, end: 0 };
|
overviewPosX = { begin: startX, end: 0 };
|
||||||
overlayPosY = { begin: startY, end: 0 };
|
overviewPosY = { begin: startY, end: 0 };
|
||||||
overlayScale = { begin: Main.overlay.getScale(), end: 1 };
|
overviewScale = { begin: Main.overview.getScale(), end: 1 };
|
||||||
}
|
}
|
||||||
|
|
||||||
return [ { name: "x",
|
return [ { name: "x",
|
||||||
parameters: { workspacePos: workspace.gridX,
|
parameters: { workspacePos: workspace.gridX,
|
||||||
overlayPos: overlayPosX,
|
overviewPos: overviewPosX,
|
||||||
overlayScale: overlayScale } },
|
overviewScale: overviewScale } },
|
||||||
{ name: "y",
|
{ name: "y",
|
||||||
parameters: { workspacePos: workspace.gridY,
|
parameters: { workspacePos: workspace.gridY,
|
||||||
overlayPos: overlayPosY,
|
overviewPos: overviewPosY,
|
||||||
overlayScale: overlayScale } }
|
overviewScale: overviewScale } }
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
function _workspaceRelativeGet(begin, end, time, params) {
|
function _workspaceRelativeGet(begin, end, time, params) {
|
||||||
let curOverlayPos = (1 - time) * params.overlayPos.begin +
|
let curOverviewPos = (1 - time) * params.overviewPos.begin +
|
||||||
time * params.overlayPos.end;
|
time * params.overviewPos.end;
|
||||||
let curOverlayScale = (1 - time) * params.overlayScale.begin +
|
let curOverviewScale = (1 - time) * params.overviewScale.begin +
|
||||||
time * params.overlayScale.end;
|
time * params.overviewScale.end;
|
||||||
|
|
||||||
// Calculate the screen position of the window.
|
// Calculate the screen position of the window.
|
||||||
let screen = (1 - time) *
|
let screen = (1 - time) *
|
||||||
((begin + params.workspacePos) * params.overlayScale.begin +
|
((begin + params.workspacePos) * params.overviewScale.begin +
|
||||||
params.overlayPos.begin) +
|
params.overviewPos.begin) +
|
||||||
time *
|
time *
|
||||||
((end + params.workspacePos) * params.overlayScale.end +
|
((end + params.workspacePos) * params.overviewScale.end +
|
||||||
params.overlayPos.end);
|
params.overviewPos.end);
|
||||||
|
|
||||||
// Return the workspace coordinates.
|
// Return the workspace coordinates.
|
||||||
return (screen - curOverlayPos) / curOverlayScale - params.workspacePos;
|
return (screen - curOverviewPos) / curOverviewScale - params.workspacePos;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user