[gnome-shell] sessionMode: Add hasRunDialog property



commit 5264f39209eee9bdc763969579d7444b8d89a426
Author: Florian MÃllner <fmuellner gnome org>
Date:   Thu May 17 13:41:02 2012 +0200

    sessionMode: Add hasRunDialog property
    
    Add a sessionMode.hasRunDialog property, which determines whether
    the keyboard shortcut to access the run dialog should be active
    or not.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=676156

 js/ui/main.js        |   13 +++++++++----
 js/ui/sessionMode.js |    2 ++
 2 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/main.js b/js/ui/main.js
index 6634025..04f0445 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -135,10 +135,6 @@ function _initUserSession() {
     _initRecorder();
 
     global.screen.override_workspace_layout(Meta.ScreenCorner.TOPLEFT, false, -1, 1);
-
-    Meta.keybindings_set_custom_handler('panel-run-dialog', function() {
-       getRunDialog().open();
-    });
 }
 
 function start() {
@@ -231,6 +227,12 @@ function start() {
         ExtensionSystem.loadExtensions();
     }
 
+    if (sessionMode.hasRunDialog) {
+        Meta.keybindings_set_custom_handler('panel-run-dialog', function() {
+           getRunDialog().open();
+        });
+    }
+
     if (sessionMode.hasOverview) {
         Meta.keybindings_set_custom_handler('panel-main-menu', function () {
             overview.toggle();
@@ -610,6 +612,9 @@ function _globalKeyPressHandler(actor, event) {
             return true;
         case Meta.KeyBindingAction.PANEL_RUN_DIALOG:
         case Meta.KeyBindingAction.COMMAND_2:
+            if (!sessionMode.hasRunDialog)
+                return false;
+
             getRunDialog().open();
             return true;
         case Meta.KeyBindingAction.PANEL_MAIN_MENU:
diff --git a/js/ui/sessionMode.js b/js/ui/sessionMode.js
index c66e92f..a3edec5 100644
--- a/js/ui/sessionMode.js
+++ b/js/ui/sessionMode.js
@@ -14,6 +14,7 @@ const _modes = {
              allowSettings: false,
              allowExtensions: false,
              allowKeybindingsWhenModal: true,
+             hasRunDialog: false,
              sessionType: Shell.SessionType.GDM },
 
     'user': { hasOverview: true,
@@ -22,6 +23,7 @@ const _modes = {
               allowSettings: true,
               allowExtensions: true,
               allowKeybindingsWhenModal: false,
+              hasRunDialog: true,
               sessionType: Shell.SessionType.USER }
 };
 



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