From becf4396c99cff5bb9cded5b774b7d0f9c6551c3 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 17 Apr 2013 19:59:02 -0400 Subject: [PATCH] Disable naked Super keybinding if sticky With sticky keys, users should be able to press and release a modifier and then press a key to activate a modifier-key combination. Activating the overview on the Super key release keeps these users from using keyboard shortcuts involving the Super modifier. The solution implemented here is to simply disable the Super-release binding if sticky keys are enabled. It is still possible to go to the overview by using Super-S or Alt-F1. https://bugzilla.gnome.org/show_bug.cgi?id=685974 --- js/ui/main.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/js/ui/main.js b/js/ui/main.js index f43811414..7232deb8b 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -41,6 +41,9 @@ const Util = imports.misc.util; const OVERRIDES_SCHEMA = 'org.gnome.shell.overrides'; const DEFAULT_BACKGROUND_COLOR = Clutter.Color.from_pixel(0x2e3436ff); +const A11Y_SCHEMA = 'org.gnome.desktop.a11y.keyboard'; +const STICKY_KEYS_ENABLE = 'stickykeys-enable'; + let componentManager = null; let panel = null; let overview = null; @@ -69,6 +72,7 @@ let _startDate; let _defaultCssStylesheet = null; let _cssStylesheet = null; let _overridesSettings = null; +let _a11ySettings = null; function _sessionUpdated() { _loadDefaultStylesheet(); @@ -157,9 +161,14 @@ function _initializeUI() { layoutManager.init(); overview.init(); + _a11ySettings = new Gio.Settings({ schema: A11Y_SCHEMA }); + global.screen.override_workspace_layout(Meta.ScreenCorner.TOPLEFT, false, -1, 1); - global.display.connect('overlay-key', Lang.bind(overview, overview.toggle)); + global.display.connect('overlay-key', Lang.bind(overview, function () { + if (!_a11ySettings.get_boolean (STICKY_KEYS_ENABLE)) + overview.toggle(); + })); // Provide the bus object for gnome-session to // initiate logouts.