Skip to content
Browse files

Added expo plugin

  • Loading branch information...
1 parent 2da14d0 commit ba75ab22b1f6ad139dfe83374e57b51fce44cc94 Diego committed Feb 19, 2012
Showing with 25 additions and 10 deletions.
  1. +8 −3 js/ui/layout.js
  2. +12 −3 js/ui/main.js
  3. +1 −1 js/ui/windowManager.js
  4. +4 −3 js/ui/workspace.js
View
11 js/ui/layout.js
@@ -652,7 +652,7 @@ HotCorner.prototype = {
if (source != Main.xdndHandler)
return;
- if (!Main.overview.visible && !Main.overview.animationInProgress) {
+ if (!Main.overview.visible && !Main.overview.animationInProgress && !Main.expo.visible) {
this.rippleAnimation();
Main.overview.showTemporarily();
Main.overview.beginItemDrag(actor);
@@ -662,18 +662,23 @@ HotCorner.prototype = {
_onCornerEntered : function() {
if (!this._entered) {
this._entered = true;
- if (!Main.overview.animationInProgress) {
+ if (!Main.overview.animationInProgress && !Main.expo.visible) {
this._activationTime = Date.now() / 1000;
this.rippleAnimation();
Main.overview.toggle();
+ } else if (Main.expo.visible){
+ this._activationTime = Date.now() / 1000;
+
+ this.rippleAnimation();
+ Main.expo.hide();
}
}
return false;
},
_onCornerClicked : function() {
- if (this.shouldToggleOverviewOnClick())
+ if (this.shouldToggleOverviewOnClick() && !Main.expo.visible)
Main.overview.toggle();
return true;
},
View
15 js/ui/main.js
@@ -22,6 +22,7 @@ const AppletManager = imports.ui.appletManager;
const Keyboard = imports.ui.keyboard;
const MessageTray = imports.ui.messageTray;
const Overview = imports.ui.overview;
+const Expo = imports.ui.expo;
const Panel = imports.ui.panel;
const PlacesManager = imports.ui.placesManager;
const RunDialog = imports.ui.runDialog;
@@ -55,6 +56,7 @@ let panel2 = null;
let hotCorners = [];
let placesManager = null;
let overview = null;
+let expo = null;
let runDialog = null;
let lookingGlass = null;
let wm = null;
@@ -219,6 +221,7 @@ function start() {
xdndHandler = new XdndHandler.XdndHandler();
// This overview object is just a stub for non-user sessions
overview = new Overview.Overview({ isDummy: global.session_type != Cinnamon.SessionType.USER });
+ expo = new Expo.Expo({ isDummy: global.session_type != Cinnamon.SessionType.USER });
magnifier = new Magnifier.Magnifier();
statusIconDispatcher = new StatusIconDispatcher.StatusIconDispatcher();
@@ -251,6 +254,7 @@ function start() {
layoutManager.init();
keyboard.init();
overview.init();
+ expo.init();
if (global.session_type == Cinnamon.SessionType.USER)
_initUserSession();
@@ -609,12 +613,13 @@ function _globalKeyPressHandler(actor, event) {
// Other bindings are only available to the user session when the overview is up and
// no modal dialog is present.
- if (global.session_type == Cinnamon.SessionType.USER && (!overview.visible || modalCount > 1))
+ if (global.session_type == Cinnamon.SessionType.USER && ((!overview.visible && !expo.visible) || modalCount > 1))
return false;
// This isn't a Meta.KeyBindingAction yet
- if (symbol == Clutter.Super_L || symbol == Clutter.Super_R) {
+ if (symbol == Clutter.Super_L || symbol == Clutter.Super_R || symbol == Clutter.Return) {
overview.hide();
+ expo.hide();
return true;
}
@@ -638,17 +643,20 @@ function _globalKeyPressHandler(actor, event) {
wm.actionMoveWorkspaceRight();
return true;
case Meta.KeyBindingAction.WORKSPACE_UP:
- overview.hide();
+ overview.hide();
+ expo.hide();
return true;
case Meta.KeyBindingAction.WORKSPACE_DOWN:
overview.hide();
+ expo.hide();
return true;
case Meta.KeyBindingAction.PANEL_RUN_DIALOG:
case Meta.KeyBindingAction.COMMAND_2:
getRunDialog().open();
return true;
case Meta.KeyBindingAction.PANEL_MAIN_MENU:
overview.hide();
+ expo.hide();
return true;
}
@@ -812,6 +820,7 @@ function activateWindow(window, time, workspaceNum) {
}
overview.hide();
+ expo.hide();
}
// TODO - replace this timeout with some system to guess when the user might
View
2 js/ui/windowManager.js
@@ -754,7 +754,7 @@ WindowManager.prototype = {
_showWorkspaceSwitcher : function(cinnamonwm, binding, mask, window, backwards) {
if (binding == 'switch_to_workspace_up') {
- Main.overview.toggle();
+ Main.expo.toggle();
return;
}
if (binding == 'switch_to_workspace_down') {
View
7 js/ui/workspace.js
@@ -1017,6 +1017,8 @@ Workspace.prototype = {
* ANIMATE - Indicates that we need animate changing position.
*/
positionWindows : function(flags) {
+ if (Main.expo.visible)
+ return;
if (this._repositionWindowsId > 0) {
Mainloop.source_remove(this._repositionWindowsId);
this._repositionWindowsId = 0;
@@ -1236,7 +1238,6 @@ Workspace.prototype = {
return;
let win = metaWin.get_compositor_private();
-
if (!win) {
// Newly-created windows are added to a workspace before
// the compositor finds out about them...
@@ -1256,9 +1257,9 @@ Workspace.prototype = {
if (this._lookupIndex (metaWin) != -1)
return;
- if (!this._isMyWindow(win) || !this._isOverviewWindow(win))
+ if (!this._isMyWindow(win) || !this._isOverviewWindow(win)){
return;
-
+ }
let clone = this._addWindowClone(win);
if (win._overviewHint) {

0 comments on commit ba75ab2

Please sign in to comment.
Something went wrong with that request. Please try again.