[gnome-shell/wip/sass] Rename KeyBindingMode to ActionMode



commit f7ed09ef052ccfc98db5f3005de4cb867eeec857
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Dec 11 15:35:40 2014 +0100

    Rename KeyBindingMode to ActionMode
    
    The keybinding mode is no longer used exclusively for actions triggered
    by keybindings, so reflect this by a more generic name.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=740237

 js/gdm/loginDialog.js        |    2 +-
 js/ui/edgeDragAction.js      |    2 +-
 js/ui/layout.js              |   14 ++--
 js/ui/lookingGlass.js        |    2 +-
 js/ui/main.js                |   34 +++++-----
 js/ui/messageTray.js         |   18 +++---
 js/ui/modalDialog.js         |    6 +-
 js/ui/overview.js            |    2 +-
 js/ui/panel.js               |    2 +-
 js/ui/screenShield.js        |    4 +-
 js/ui/status/keyboard.js     |    8 +-
 js/ui/unlockDialog.js        |    2 +-
 js/ui/viewSelector.js        |   12 ++--
 js/ui/windowManager.js       |  162 +++++++++++++++++++++---------------------
 src/Makefile.am              |    2 +-
 src/shell-action-modes.h     |   39 ++++++++++
 src/shell-keybinding-modes.h |   38 ----------
 17 files changed, 175 insertions(+), 174 deletions(-)
---
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index 9504965..bef41ed 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -1155,7 +1155,7 @@ const LoginDialog = new Lang.Class({
         this.actor.show();
         this.actor.opacity = 0;
 
-        Main.pushModal(this.actor, { keybindingMode: Shell.KeyBindingMode.LOGIN_SCREEN });
+        Main.pushModal(this.actor, { actionMode: Shell.ActionMode.LOGIN_SCREEN });
 
         Tweener.addTween(this.actor,
                          { opacity: 255,
diff --git a/js/ui/edgeDragAction.js b/js/ui/edgeDragAction.js
index 46e96d7..5fc4e72 100644
--- a/js/ui/edgeDragAction.js
+++ b/js/ui/edgeDragAction.js
@@ -37,7 +37,7 @@ const EdgeDragAction = new Lang.Class({
         if (this.get_n_current_points() == 0)
             return false;
 
-        if (!(this._allowedModes & Main.keybindingMode))
+        if (!(this._allowedModes & Main.actionMode))
             return false;
 
         let [x, y] = this.get_press_coords(0);
diff --git a/js/ui/layout.js b/js/ui/layout.js
index c20dc61..204ab94 100644
--- a/js/ui/layout.js
+++ b/js/ui/layout.js
@@ -458,8 +458,8 @@ const LayoutManager = new Lang.Class({
     _setupTrayPressure: function() {
         this._trayPressure = new PressureBarrier(MESSAGE_TRAY_PRESSURE_THRESHOLD,
                                                  MESSAGE_TRAY_PRESSURE_TIMEOUT,
-                                                 Shell.KeyBindingMode.NORMAL |
-                                                 Shell.KeyBindingMode.OVERVIEW);
+                                                 Shell.ActionMode.NORMAL |
+                                                 Shell.ActionMode.OVERVIEW);
         this._trayPressure.setEventFilter(this._trayBarrierEventFilter);
         this._trayPressure.connect('trigger', function(barrier) {
             if (Main.layoutManager.bottomMonitor.inFullscreen)
@@ -1067,8 +1067,8 @@ const HotCorner = new Lang.Class({
 
         this._pressureBarrier = new PressureBarrier(HOT_CORNER_PRESSURE_THRESHOLD,
                                                     HOT_CORNER_PRESSURE_TIMEOUT,
-                                                    Shell.KeyBindingMode.NORMAL |
-                                                    Shell.KeyBindingMode.OVERVIEW);
+                                                    Shell.ActionMode.NORMAL |
+                                                    Shell.ActionMode.OVERVIEW);
         this._pressureBarrier.connect('trigger', Lang.bind(this, this._toggleOverview));
 
         // Cache the three ripples instead of dynamically creating and destroying them.
@@ -1245,10 +1245,10 @@ const HotCorner = new Lang.Class({
 const PressureBarrier = new Lang.Class({
     Name: 'PressureBarrier',
 
-    _init: function(threshold, timeout, keybindingMode) {
+    _init: function(threshold, timeout, actionMode) {
         this._threshold = threshold;
         this._timeout = timeout;
-        this._keybindingMode = keybindingMode;
+        this._actionMode = actionMode;
         this._barriers = [];
         this._eventFilter = null;
 
@@ -1351,7 +1351,7 @@ const PressureBarrier = new Lang.Class({
             return;
 
         // Throw out all events not in the proper keybinding mode
-        if (!(this._keybindingMode & Main.keybindingMode))
+        if (!(this._actionMode & Main.actionMode))
             return;
 
         let slide = this._getDistanceAlongBarrier(barrier, event);
diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js
index eb837d8..93747ec 100644
--- a/js/ui/lookingGlass.js
+++ b/js/ui/lookingGlass.js
@@ -1086,7 +1086,7 @@ const LookingGlass = new Lang.Class({
         if (this._open)
             return;
 
-        if (!Main.pushModal(this._entry, { keybindingMode: Shell.KeyBindingMode.LOOKING_GLASS }))
+        if (!Main.pushModal(this._entry, { actionMode: Shell.ActionMode.LOOKING_GLASS }))
             return;
 
         this._notebook.selectIndex(0);
diff --git a/js/ui/main.js b/js/ui/main.js
index 0b22a36..32c8644 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -63,7 +63,7 @@ let shellMountOpDBusService = null;
 let screenSaverDBus = null;
 let screencastService = null;
 let modalCount = 0;
-let keybindingMode = Shell.KeyBindingMode.NONE;
+let actionMode = Shell.ActionMode.NONE;
 let modalActorFocusStack = [];
 let uiGroup = null;
 let magnifier = null;
@@ -80,15 +80,15 @@ function _sessionUpdated() {
         _loadDefaultStylesheet();
 
     wm.setCustomKeybindingHandler('panel-main-menu',
-                                  Shell.KeyBindingMode.NORMAL |
-                                  Shell.KeyBindingMode.OVERVIEW,
+                                  Shell.ActionMode.NORMAL |
+                                  Shell.ActionMode.OVERVIEW,
                                   sessionMode.hasOverview ? Lang.bind(overview, overview.toggle) : null);
-    wm.allowKeybinding('overlay-key', Shell.KeyBindingMode.NORMAL |
-                                      Shell.KeyBindingMode.OVERVIEW);
+    wm.allowKeybinding('overlay-key', Shell.ActionMode.NORMAL |
+                                      Shell.ActionMode.OVERVIEW);
 
     wm.setCustomKeybindingHandler('panel-run-dialog',
-                                  Shell.KeyBindingMode.NORMAL |
-                                  Shell.KeyBindingMode.OVERVIEW,
+                                  Shell.ActionMode.NORMAL |
+                                  Shell.ActionMode.OVERVIEW,
                                   sessionMode.hasRunDialog ? openRunDialog : null);
 
     if (!sessionMode.hasRunDialog) {
@@ -209,8 +209,8 @@ function _initializeUI() {
     }
 
     layoutManager.connect('startup-complete', function() {
-        if (keybindingMode == Shell.KeyBindingMode.NONE) {
-            keybindingMode = Shell.KeyBindingMode.NORMAL;
+        if (actionMode == Shell.ActionMode.NONE) {
+            actionMode = Shell.ActionMode.NORMAL;
         }
         if (screenShield) {
             screenShield.lockIfWasLocked();
@@ -372,7 +372,7 @@ function _findModal(actor) {
  *  - options: Meta.ModalOptions flags to indicate that the pointer is
  *             already grabbed
  *
- *  - keybindingMode: used to set the current Shell.KeyBindingMode to filter
+ *  - actionMode: used to set the current Shell.ActionMode to filter
  *                    global keybindings; the default of NONE will filter
  *                    out all keybindings
  *
@@ -381,7 +381,7 @@ function _findModal(actor) {
 function pushModal(actor, params) {
     params = Params.parse(params, { timestamp: global.get_current_time(),
                                     options: 0,
-                                    keybindingMode: Shell.KeyBindingMode.NONE });
+                                    actionMode: Shell.ActionMode.NONE });
 
     if (modalCount == 0) {
         if (!global.begin_modal(params.timestamp, params.options)) {
@@ -411,9 +411,9 @@ function pushModal(actor, params) {
                                 destroyId: actorDestroyId,
                                 prevFocus: prevFocus,
                                 prevFocusDestroyId: prevFocusDestroyId,
-                                keybindingMode: keybindingMode });
+                                actionMode: actionMode });
 
-    keybindingMode = params.keybindingMode;
+    actionMode = params.actionMode;
     global.stage.set_key_focus(actor);
     return true;
 }
@@ -439,7 +439,7 @@ function popModal(actor, timestamp) {
     if (focusIndex < 0) {
         global.stage.set_key_focus(null);
         global.end_modal(timestamp);
-        keybindingMode = Shell.KeyBindingMode.NORMAL;
+        actionMode = Shell.ActionMode.NORMAL;
 
         throw new Error('incorrect pop');
     }
@@ -452,7 +452,7 @@ function popModal(actor, timestamp) {
     if (focusIndex == modalActorFocusStack.length - 1) {
         if (record.prevFocus)
             record.prevFocus.disconnect(record.prevFocusDestroyId);
-        keybindingMode = record.keybindingMode;
+        actionMode = record.actionMode;
         global.stage.set_key_focus(record.prevFocus);
     } else {
         // If we have:
@@ -477,7 +477,7 @@ function popModal(actor, timestamp) {
         for (let i = modalActorFocusStack.length - 1; i > focusIndex; i--) {
             modalActorFocusStack[i].prevFocus = modalActorFocusStack[i - 1].prevFocus;
             modalActorFocusStack[i].prevFocusDestroyId = modalActorFocusStack[i - 1].prevFocusDestroyId;
-            modalActorFocusStack[i].keybindingMode = modalActorFocusStack[i - 1].keybindingMode;
+            modalActorFocusStack[i].actionMode = modalActorFocusStack[i - 1].actionMode;
         }
     }
     modalActorFocusStack.splice(focusIndex, 1);
@@ -488,7 +488,7 @@ function popModal(actor, timestamp) {
     layoutManager.modalEnded();
     global.end_modal(timestamp);
     Meta.enable_unredirect_for_screen(global.screen);
-    keybindingMode = Shell.KeyBindingMode.NORMAL;
+    actionMode = Shell.ActionMode.NORMAL;
 }
 
 function createLookingGlass() {
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index a034fc3..c9329ea 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1852,7 +1852,7 @@ const MessageTray = new Lang.Class({
         this.idleMonitor = Meta.IdleMonitor.get_core();
 
         this._grabHelper = new GrabHelper.GrabHelper(this.actor,
-                                                     { keybindingMode: Shell.KeyBindingMode.MESSAGE_TRAY });
+                                                     { actionMode: Shell.ActionMode.MESSAGE_TRAY });
         this._grabHelper.addActor(this._summaryBoxPointer.actor);
         this._grabHelper.addActor(this.actor);
 
@@ -1916,16 +1916,16 @@ const MessageTray = new Lang.Class({
         Main.wm.addKeybinding('toggle-message-tray',
                               new Gio.Settings({ schema_id: SHELL_KEYBINDINGS_SCHEMA }),
                               Meta.KeyBindingFlags.NONE,
-                              Shell.KeyBindingMode.NORMAL |
-                              Shell.KeyBindingMode.MESSAGE_TRAY |
-                              Shell.KeyBindingMode.OVERVIEW,
+                              Shell.ActionMode.NORMAL |
+                              Shell.ActionMode.MESSAGE_TRAY |
+                              Shell.ActionMode.OVERVIEW,
                               Lang.bind(this, this.toggleAndNavigate));
         Main.wm.addKeybinding('focus-active-notification',
                               new Gio.Settings({ schema_id: SHELL_KEYBINDINGS_SCHEMA }),
                               Meta.KeyBindingFlags.NONE,
-                              Shell.KeyBindingMode.NORMAL |
-                              Shell.KeyBindingMode.MESSAGE_TRAY |
-                              Shell.KeyBindingMode.OVERVIEW,
+                              Shell.ActionMode.NORMAL |
+                              Shell.ActionMode.MESSAGE_TRAY |
+                              Shell.ActionMode.OVERVIEW,
                               Lang.bind(this, this._expandActiveNotification));
 
         this._sources = new Map();
@@ -1952,8 +1952,8 @@ const MessageTray = new Lang.Class({
                                                   Lang.bind(this, this._onTrayButtonKeyPress));
 
         let gesture = new EdgeDragAction.EdgeDragAction(St.Side.BOTTOM,
-                                                        Shell.KeyBindingMode.NORMAL |
-                                                        Shell.KeyBindingMode.OVERVIEW);
+                                                        Shell.ActionMode.NORMAL |
+                                                        Shell.ActionMode.OVERVIEW);
         gesture.connect('activated', Lang.bind(this, this.toggle));
         global.stage.add_action(gesture);
     },
diff --git a/js/ui/modalDialog.js b/js/ui/modalDialog.js
index d1d4971..b188e39 100644
--- a/js/ui/modalDialog.js
+++ b/js/ui/modalDialog.js
@@ -41,14 +41,14 @@ const ModalDialog = new Lang.Class({
     _init: function(params) {
         params = Params.parse(params, { shellReactive: false,
                                         styleClass: null,
-                                        keybindingMode: Shell.KeyBindingMode.SYSTEM_MODAL,
+                                        actionMode: Shell.ActionMode.SYSTEM_MODAL,
                                         shouldFadeIn: true,
                                         shouldFadeOut: true,
                                         destroyOnClose: true });
 
         this.state = State.CLOSED;
         this._hasModal = false;
-        this._keybindingMode = params.keybindingMode;
+        this._actionMode = params.actionMode;
         this._shellReactive = params.shellReactive;
         this._shouldFadeIn = params.shouldFadeIn;
         this._shouldFadeOut = params.shouldFadeOut;
@@ -362,7 +362,7 @@ const ModalDialog = new Lang.Class({
         if (this._hasModal)
             return true;
         if (!Main.pushModal(this._group, { timestamp: timestamp,
-                                           keybindingMode: this._keybindingMode }))
+                                           actionMode: this._actionMode }))
             return false;
 
         this._hasModal = true;
diff --git a/js/ui/overview.js b/js/ui/overview.js
index 4da6243..e21b4bb 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -509,7 +509,7 @@ const Overview = new Lang.Class({
             if (shouldBeModal) {
                 if (!this._modal) {
                     if (Main.pushModal(this._overview,
-                                       { keybindingMode: Shell.KeyBindingMode.OVERVIEW })) {
+                                       { actionMode: Shell.ActionMode.OVERVIEW })) {
                         this._modal = true;
                     } else {
                         this.hide();
diff --git a/js/ui/panel.js b/js/ui/panel.js
index 335af18..46dfffb 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -829,7 +829,7 @@ const Panel = new Lang.Class({
 
         this.statusArea = {};
 
-        this.menuManager = new PopupMenu.PopupMenuManager(this, { keybindingMode: 
Shell.KeyBindingMode.TOPBAR_POPUP });
+        this.menuManager = new PopupMenu.PopupMenuManager(this, { actionMode: Shell.ActionMode.TOPBAR_POPUP 
});
 
         this._leftBox = new St.BoxLayout({ name: 'panelLeft' });
         this.actor.add_actor(this._leftBox);
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index 6aef53b..f2551f6 100644
--- a/js/ui/screenShield.js
+++ b/js/ui/screenShield.js
@@ -647,14 +647,14 @@ const ScreenShield = new Lang.Class({
         if (this._isModal)
             return true;
 
-        this._isModal = Main.pushModal(this.actor, { keybindingMode: Shell.KeyBindingMode.LOCK_SCREEN });
+        this._isModal = Main.pushModal(this.actor, { actionMode: Shell.ActionMode.LOCK_SCREEN });
         if (this._isModal)
             return true;
 
         // We failed to get a pointer grab, it means that
         // something else has it. Try with a keyboard grab only
         this._isModal = Main.pushModal(this.actor, { options: Meta.ModalOptions.POINTER_ALREADY_GRABBED,
-                                                     keybindingMode: Shell.KeyBindingMode.LOCK_SCREEN });
+                                                     actionMode: Shell.ActionMode.LOCK_SCREEN });
         return this._isModal;
     },
 
diff --git a/js/ui/status/keyboard.js b/js/ui/status/keyboard.js
index 4ae8ba1..897497a 100644
--- a/js/ui/status/keyboard.js
+++ b/js/ui/status/keyboard.js
@@ -163,13 +163,13 @@ const InputSourceManager = new Lang.Class({
             Main.wm.addKeybinding('switch-input-source',
                                   new Gio.Settings({ schema_id: "org.gnome.desktop.wm.keybindings" }),
                                   Meta.KeyBindingFlags.NONE,
-                                  Shell.KeyBindingMode.ALL,
+                                  Shell.ActionMode.ALL,
                                   Lang.bind(this, this._switchInputSource));
         this._keybindingActionBackward =
             Main.wm.addKeybinding('switch-input-source-backward',
                                   new Gio.Settings({ schema_id: "org.gnome.desktop.wm.keybindings" }),
                                   Meta.KeyBindingFlags.IS_REVERSED,
-                                  Shell.KeyBindingMode.ALL,
+                                  Shell.ActionMode.ALL,
                                   Lang.bind(this, this._switchInputSource));
         this._settings = new Gio.Settings({ schema_id: DESKTOP_INPUT_SOURCES_SCHEMA });
         this._settings.connect('changed::' + KEY_INPUT_SOURCES, Lang.bind(this, this._inputSourcesChanged));
@@ -239,8 +239,8 @@ const InputSourceManager = new Lang.Class({
         // effect without considerable work to consolidate the usage
         // of pushModal/popModal and grabHelper. See
         // https://bugzilla.gnome.org/show_bug.cgi?id=695143 .
-        if (Main.keybindingMode == Shell.KeyBindingMode.MESSAGE_TRAY ||
-            Main.keybindingMode == Shell.KeyBindingMode.TOPBAR_POPUP) {
+        if (Main.actionMode == Shell.ActionMode.MESSAGE_TRAY ||
+            Main.actionMode == Shell.ActionMode.TOPBAR_POPUP) {
             this._modifiersSwitcher();
             return;
         }
diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js
index a7f2c6f..f4a7374 100644
--- a/js/ui/unlockDialog.js
+++ b/js/ui/unlockDialog.js
@@ -154,7 +154,7 @@ const UnlockDialog = new Lang.Class({
             return true;
 
         if (!Main.pushModal(this.actor, { timestamp: timestamp,
-                                          keybindingMode: Shell.KeyBindingMode.UNLOCK_SCREEN }))
+                                          actionMode: Shell.ActionMode.UNLOCK_SCREEN }))
             return false;
 
         this._isModal = true;
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index 57395e3..ab22ff9 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -65,7 +65,7 @@ const ShowOverviewAction = new Lang.Class({
     },
 
     vfunc_gesture_prepare : function(action, actor) {
-        return Main.keybindingMode == Shell.KeyBindingMode.NORMAL &&
+        return Main.actionMode == Shell.ActionMode.NORMAL &&
                this.get_n_current_points() == this.get_n_touch_points();
     },
 
@@ -203,21 +203,21 @@ const ViewSelector = new Lang.Class({
         Main.wm.addKeybinding('toggle-application-view',
                               new Gio.Settings({ schema_id: SHELL_KEYBINDINGS_SCHEMA }),
                               Meta.KeyBindingFlags.NONE,
-                              Shell.KeyBindingMode.NORMAL |
-                              Shell.KeyBindingMode.OVERVIEW,
+                              Shell.ActionMode.NORMAL |
+                              Shell.ActionMode.OVERVIEW,
                               Lang.bind(this, this._toggleAppsPage));
 
         Main.wm.addKeybinding('toggle-overview',
                               new Gio.Settings({ schema_id: SHELL_KEYBINDINGS_SCHEMA }),
                               Meta.KeyBindingFlags.NONE,
-                              Shell.KeyBindingMode.NORMAL |
-                              Shell.KeyBindingMode.OVERVIEW,
+                              Shell.ActionMode.NORMAL |
+                              Shell.ActionMode.OVERVIEW,
                               Lang.bind(Main.overview, Main.overview.toggle));
 
         let gesture;
 
         gesture = new EdgeDragAction.EdgeDragAction(St.Side.LEFT,
-                                                    Shell.KeyBindingMode.NORMAL);
+                                                    Shell.ActionMode.NORMAL);
         gesture.connect('activated', Lang.bind(this, function() {
             if (Main.overview.visible)
                 Main.overview.hide();
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index e332552..d88c022 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -478,9 +478,9 @@ const WorkspaceSwitchAction = new Lang.Class({
     },
 
     vfunc_gesture_prepare : function(action, actor) {
-        let allowedModes = Shell.KeyBindingMode.NORMAL | Shell.KeyBindingMode.OVERVIEW;
+        let allowedModes = Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW;
         return this.get_n_current_points() == this.get_n_touch_points() &&
-               (allowedModes & Main.keybindingMode);
+               (allowedModes & Main.actionMode);
     },
 
     vfunc_gesture_end : function(action, actor) {
@@ -528,7 +528,7 @@ const AppSwitchAction = new Lang.Class({
     },
 
     vfunc_gesture_prepare : function(action, actor) {
-        if (Main.keybindingMode != Shell.KeyBindingMode.NORMAL) {
+        if (Main.actionMode != Shell.ActionMode.NORMAL) {
             this.cancel();
             return false;
         }
@@ -623,172 +623,172 @@ const WindowManager = new Lang.Class({
         this._tilePreview = null;
 
         this.setCustomKeybindingHandler('switch-to-workspace-left',
-                                        Shell.KeyBindingMode.NORMAL |
-                                        Shell.KeyBindingMode.OVERVIEW,
+                                        Shell.ActionMode.NORMAL |
+                                        Shell.ActionMode.OVERVIEW,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('switch-to-workspace-right',
-                                        Shell.KeyBindingMode.NORMAL |
-                                        Shell.KeyBindingMode.OVERVIEW,
+                                        Shell.ActionMode.NORMAL |
+                                        Shell.ActionMode.OVERVIEW,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('switch-to-workspace-up',
-                                        Shell.KeyBindingMode.NORMAL |
-                                        Shell.KeyBindingMode.OVERVIEW,
+                                        Shell.ActionMode.NORMAL |
+                                        Shell.ActionMode.OVERVIEW,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('switch-to-workspace-down',
-                                        Shell.KeyBindingMode.NORMAL |
-                                        Shell.KeyBindingMode.OVERVIEW,
+                                        Shell.ActionMode.NORMAL |
+                                        Shell.ActionMode.OVERVIEW,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('switch-to-workspace-last',
-                                        Shell.KeyBindingMode.NORMAL |
-                                        Shell.KeyBindingMode.OVERVIEW,
+                                        Shell.ActionMode.NORMAL |
+                                        Shell.ActionMode.OVERVIEW,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('move-to-workspace-left',
-                                        Shell.KeyBindingMode.NORMAL |
-                                        Shell.KeyBindingMode.OVERVIEW,
+                                        Shell.ActionMode.NORMAL |
+                                        Shell.ActionMode.OVERVIEW,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('move-to-workspace-right',
-                                        Shell.KeyBindingMode.NORMAL |
-                                        Shell.KeyBindingMode.OVERVIEW,
+                                        Shell.ActionMode.NORMAL |
+                                        Shell.ActionMode.OVERVIEW,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('move-to-workspace-up',
-                                        Shell.KeyBindingMode.NORMAL |
-                                        Shell.KeyBindingMode.OVERVIEW,
+                                        Shell.ActionMode.NORMAL |
+                                        Shell.ActionMode.OVERVIEW,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('move-to-workspace-down',
-                                        Shell.KeyBindingMode.NORMAL |
-                                        Shell.KeyBindingMode.OVERVIEW,
+                                        Shell.ActionMode.NORMAL |
+                                        Shell.ActionMode.OVERVIEW,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('switch-to-workspace-1',
-                                        Shell.KeyBindingMode.NORMAL |
-                                        Shell.KeyBindingMode.OVERVIEW,
+                                        Shell.ActionMode.NORMAL |
+                                        Shell.ActionMode.OVERVIEW,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('switch-to-workspace-2',
-                                        Shell.KeyBindingMode.NORMAL |
-                                        Shell.KeyBindingMode.OVERVIEW,
+                                        Shell.ActionMode.NORMAL |
+                                        Shell.ActionMode.OVERVIEW,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('switch-to-workspace-3',
-                                        Shell.KeyBindingMode.NORMAL |
-                                        Shell.KeyBindingMode.OVERVIEW,
+                                        Shell.ActionMode.NORMAL |
+                                        Shell.ActionMode.OVERVIEW,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('switch-to-workspace-4',
-                                        Shell.KeyBindingMode.NORMAL |
-                                        Shell.KeyBindingMode.OVERVIEW,
+                                        Shell.ActionMode.NORMAL |
+                                        Shell.ActionMode.OVERVIEW,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('switch-to-workspace-5',
-                                        Shell.KeyBindingMode.NORMAL |
-                                        Shell.KeyBindingMode.OVERVIEW,
+                                        Shell.ActionMode.NORMAL |
+                                        Shell.ActionMode.OVERVIEW,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('switch-to-workspace-6',
-                                        Shell.KeyBindingMode.NORMAL |
-                                        Shell.KeyBindingMode.OVERVIEW,
+                                        Shell.ActionMode.NORMAL |
+                                        Shell.ActionMode.OVERVIEW,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('switch-to-workspace-7',
-                                        Shell.KeyBindingMode.NORMAL |
-                                        Shell.KeyBindingMode.OVERVIEW,
+                                        Shell.ActionMode.NORMAL |
+                                        Shell.ActionMode.OVERVIEW,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('switch-to-workspace-8',
-                                        Shell.KeyBindingMode.NORMAL |
-                                        Shell.KeyBindingMode.OVERVIEW,
+                                        Shell.ActionMode.NORMAL |
+                                        Shell.ActionMode.OVERVIEW,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('switch-to-workspace-9',
-                                        Shell.KeyBindingMode.NORMAL |
-                                        Shell.KeyBindingMode.OVERVIEW,
+                                        Shell.ActionMode.NORMAL |
+                                        Shell.ActionMode.OVERVIEW,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('switch-to-workspace-10',
-                                        Shell.KeyBindingMode.NORMAL |
-                                        Shell.KeyBindingMode.OVERVIEW,
+                                        Shell.ActionMode.NORMAL |
+                                        Shell.ActionMode.OVERVIEW,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('switch-to-workspace-11',
-                                        Shell.KeyBindingMode.NORMAL |
-                                        Shell.KeyBindingMode.OVERVIEW,
+                                        Shell.ActionMode.NORMAL |
+                                        Shell.ActionMode.OVERVIEW,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('switch-to-workspace-12',
-                                        Shell.KeyBindingMode.NORMAL |
-                                        Shell.KeyBindingMode.OVERVIEW,
+                                        Shell.ActionMode.NORMAL |
+                                        Shell.ActionMode.OVERVIEW,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('move-to-workspace-1',
-                                        Shell.KeyBindingMode.NORMAL,
+                                        Shell.ActionMode.NORMAL,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('move-to-workspace-2',
-                                        Shell.KeyBindingMode.NORMAL,
+                                        Shell.ActionMode.NORMAL,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('move-to-workspace-3',
-                                        Shell.KeyBindingMode.NORMAL,
+                                        Shell.ActionMode.NORMAL,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('move-to-workspace-4',
-                                        Shell.KeyBindingMode.NORMAL,
+                                        Shell.ActionMode.NORMAL,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('move-to-workspace-5',
-                                        Shell.KeyBindingMode.NORMAL,
+                                        Shell.ActionMode.NORMAL,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('move-to-workspace-6',
-                                        Shell.KeyBindingMode.NORMAL,
+                                        Shell.ActionMode.NORMAL,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('move-to-workspace-7',
-                                        Shell.KeyBindingMode.NORMAL,
+                                        Shell.ActionMode.NORMAL,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('move-to-workspace-8',
-                                        Shell.KeyBindingMode.NORMAL,
+                                        Shell.ActionMode.NORMAL,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('move-to-workspace-9',
-                                        Shell.KeyBindingMode.NORMAL,
+                                        Shell.ActionMode.NORMAL,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('move-to-workspace-10',
-                                        Shell.KeyBindingMode.NORMAL,
+                                        Shell.ActionMode.NORMAL,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('move-to-workspace-11',
-                                        Shell.KeyBindingMode.NORMAL,
+                                        Shell.ActionMode.NORMAL,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('move-to-workspace-12',
-                                        Shell.KeyBindingMode.NORMAL,
+                                        Shell.ActionMode.NORMAL,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('move-to-workspace-last',
-                                        Shell.KeyBindingMode.NORMAL,
+                                        Shell.ActionMode.NORMAL,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('switch-applications',
-                                        Shell.KeyBindingMode.NORMAL,
+                                        Shell.ActionMode.NORMAL,
                                         Lang.bind(this, this._startAppSwitcher));
         this.setCustomKeybindingHandler('switch-group',
-                                        Shell.KeyBindingMode.NORMAL,
+                                        Shell.ActionMode.NORMAL,
                                         Lang.bind(this, this._startAppSwitcher));
         this.setCustomKeybindingHandler('switch-applications-backward',
-                                        Shell.KeyBindingMode.NORMAL,
+                                        Shell.ActionMode.NORMAL,
                                         Lang.bind(this, this._startAppSwitcher));
         this.setCustomKeybindingHandler('switch-group-backward',
-                                        Shell.KeyBindingMode.NORMAL,
+                                        Shell.ActionMode.NORMAL,
                                         Lang.bind(this, this._startAppSwitcher));
         this.setCustomKeybindingHandler('switch-windows',
-                                        Shell.KeyBindingMode.NORMAL,
+                                        Shell.ActionMode.NORMAL,
                                         Lang.bind(this, this._startWindowSwitcher));
         this.setCustomKeybindingHandler('switch-windows-backward',
-                                        Shell.KeyBindingMode.NORMAL,
+                                        Shell.ActionMode.NORMAL,
                                         Lang.bind(this, this._startWindowSwitcher));
         this.setCustomKeybindingHandler('switch-panels',
-                                        Shell.KeyBindingMode.NORMAL |
-                                        Shell.KeyBindingMode.OVERVIEW |
-                                        Shell.KeyBindingMode.LOCK_SCREEN |
-                                        Shell.KeyBindingMode.UNLOCK_SCREEN |
-                                        Shell.KeyBindingMode.LOGIN_SCREEN,
+                                        Shell.ActionMode.NORMAL |
+                                        Shell.ActionMode.OVERVIEW |
+                                        Shell.ActionMode.LOCK_SCREEN |
+                                        Shell.ActionMode.UNLOCK_SCREEN |
+                                        Shell.ActionMode.LOGIN_SCREEN,
                                         Lang.bind(this, this._startA11ySwitcher));
         this.setCustomKeybindingHandler('switch-panels-backward',
-                                        Shell.KeyBindingMode.NORMAL |
-                                        Shell.KeyBindingMode.OVERVIEW |
-                                        Shell.KeyBindingMode.LOCK_SCREEN |
-                                        Shell.KeyBindingMode.UNLOCK_SCREEN |
-                                        Shell.KeyBindingMode.LOGIN_SCREEN,
+                                        Shell.ActionMode.NORMAL |
+                                        Shell.ActionMode.OVERVIEW |
+                                        Shell.ActionMode.LOCK_SCREEN |
+                                        Shell.ActionMode.UNLOCK_SCREEN |
+                                        Shell.ActionMode.LOGIN_SCREEN,
                                         Lang.bind(this, this._startA11ySwitcher));
 
         this.addKeybinding('pause-resume-tweens',
                            new Gio.Settings({ schema_id: SHELL_KEYBINDINGS_SCHEMA }),
                            Meta.KeyBindingFlags.NONE,
-                           Shell.KeyBindingMode.ALL,
+                           Shell.ActionMode.ALL,
                            Lang.bind(this, this._toggleTweens));
 
         this.addKeybinding('open-application-menu',
                            new Gio.Settings({ schema_id: SHELL_KEYBINDINGS_SCHEMA }),
                            Meta.KeyBindingFlags.NONE,
-                           Shell.KeyBindingMode.NORMAL |
-                           Shell.KeyBindingMode.TOPBAR_POPUP,
+                           Shell.ActionMode.NORMAL |
+                           Shell.ActionMode.TOPBAR_POPUP,
                            Lang.bind(this, this._toggleAppMenu));
 
         Main.overview.connect('showing', Lang.bind(this, function() {
@@ -877,7 +877,7 @@ const WindowManager = new Lang.Class({
 
     removeKeybinding: function(name) {
         if (global.display.remove_keybinding(name))
-            this.allowKeybinding(name, Shell.KeyBindingMode.NONE);
+            this.allowKeybinding(name, Shell.ActionMode.NONE);
     },
 
     allowKeybinding: function(name, modes) {
@@ -1234,18 +1234,18 @@ const WindowManager = new Lang.Class({
     },
 
     _filterKeybinding: function(shellwm, binding) {
-        if (Main.keybindingMode == Shell.KeyBindingMode.NONE)
+        if (Main.actionMode == Shell.ActionMode.NONE)
             return true;
 
         // There's little sense in implementing a keybinding in mutter and
         // not having it work in NORMAL mode; handle this case generically
         // so we don't have to explicitly allow all builtin keybindings in
         // NORMAL mode.
-        if (Main.keybindingMode == Shell.KeyBindingMode.NORMAL &&
+        if (Main.actionMode == Shell.ActionMode.NORMAL &&
             binding.is_builtin())
             return false;
 
-        return !(this._allowedKeybindings[binding.get_name()] & Main.keybindingMode);
+        return !(this._allowedKeybindings[binding.get_name()] & Main.actionMode);
     },
 
     _switchWorkspace : function(shellwm, from, to, direction) {
diff --git a/src/Makefile.am b/src/Makefile.am
index 82c06f3..3758f4f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -99,7 +99,7 @@ shell_public_headers_h =              \
        shell-gtk-embed.h               \
        shell-global.h                  \
        shell-invert-lightness-effect.h \
-       shell-keybinding-modes.h        \
+       shell-action-modes.h            \
        shell-mount-operation.h         \
        shell-perf-log.h                \
        shell-screenshot.h              \
diff --git a/src/shell-action-modes.h b/src/shell-action-modes.h
new file mode 100644
index 0000000..cff1d12
--- /dev/null
+++ b/src/shell-action-modes.h
@@ -0,0 +1,39 @@
+/**
+ * ShellActionMode:
+ * @SHELL_ACTION_MODE_NONE: block action
+ * @SHELL_ACTION_MODE_NORMAL: allow action when in window mode,
+ *     e.g. when the focus is in an application window
+ * @SHELL_ACTION_MODE_OVERVIEW: allow action while the overview
+ *     is active
+ * @SHELL_ACTION_MODE_LOCK_SCREEN: allow action when the screen
+ *     is locked, e.g. when the screen shield is shown
+ * @SHELL_ACTION_MODE_UNLOCK_SCREEN: allow action in the unlock
+ *     dialog
+ * @SHELL_ACTION_MODE_LOGIN_SCREEN: allow action in the login screen
+ * @SHELL_ACTION_MODE_MESSAGE_TRAY: allow action while the message
+ *     tray is popped up
+ * @SHELL_ACTION_MODE_SYSTEM_MODAL: allow action when a system modal
+ *     dialog (e.g. authentification or session dialogs) is open
+ * @SHELL_ACTION_MODE_LOOKING_GLASS: allow action in looking glass
+ * @SHELL_ACTION_MODE_TOPBAR_POPUP: allow action while a top bar menu
+ *     is open
+ * @SHELL_ACTION_MODE_ALL: always allow action
+ *
+ * Controls in which GNOME Shell states an action (like keybindings and gestures)
+ * should be handled.
+*/
+typedef enum {
+  SHELL_ACTION_MODE_NONE          = 0,
+  SHELL_ACTION_MODE_NORMAL        = 1 << 0,
+  SHELL_ACTION_MODE_OVERVIEW      = 1 << 1,
+  SHELL_ACTION_MODE_LOCK_SCREEN   = 1 << 2,
+  SHELL_ACTION_MODE_UNLOCK_SCREEN = 1 << 3,
+  SHELL_ACTION_MODE_LOGIN_SCREEN  = 1 << 4,
+  SHELL_ACTION_MODE_MESSAGE_TRAY  = 1 << 5,
+  SHELL_ACTION_MODE_SYSTEM_MODAL  = 1 << 6,
+  SHELL_ACTION_MODE_LOOKING_GLASS = 1 << 7,
+  SHELL_ACTION_MODE_TOPBAR_POPUP  = 1 << 8,
+
+  SHELL_ACTION_MODE_ALL = ~0,
+} ShellActionMode;
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]