From aa5d352a065d47dbbadfb407ea607817ec83b79f Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Tue, 28 Feb 2012 17:01:48 +0100 Subject: [PATCH] Remove the shell_get_event_state() wrapper The bug that this wrapper was working around has been fixed for quite some time: https://bugzilla.gnome.org/show_bug.cgi?id=650329. --- js/ui/altTab.js | 2 +- js/ui/appDisplay.js | 4 ++-- js/ui/ctrlAltTab.js | 2 +- js/ui/lookingGlass.js | 2 +- js/ui/main.js | 2 +- js/ui/runDialog.js | 2 +- js/ui/viewSelector.js | 2 +- src/shell-util.c | 19 ------------------- src/shell-util.h | 3 --- 9 files changed, 8 insertions(+), 30 deletions(-) diff --git a/js/ui/altTab.js b/js/ui/altTab.js index ab2160cea..0c0b03811 100644 --- a/js/ui/altTab.js +++ b/js/ui/altTab.js @@ -265,7 +265,7 @@ const AltTabPopup = new Lang.Class({ _keyPressEvent : function(actor, event) { let keysym = event.get_key_symbol(); - let event_state = Shell.get_event_state(event); + let event_state = event.get_state(); let backwards = event_state & Clutter.ModifierType.SHIFT_MASK; let action = global.display.get_keybinding_action(event.get_key_code(), event_state); diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 4e8bf3d17..f70c390e0 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -339,7 +339,7 @@ const AppSearchProvider = new Lang.Class({ timestamp: 0 }); let event = Clutter.get_current_event(); - let modifiers = event ? Shell.get_event_state(event) : 0; + let modifiers = event ? event.get_state() : 0; let openNewWindow = modifiers & Clutter.ModifierType.CONTROL_MASK; if (openNewWindow) @@ -584,7 +584,7 @@ const AppWellIcon = new Lang.Class({ _onActivate: function (event) { this.emit('launching'); - let modifiers = Shell.get_event_state(event); + let modifiers = event.get_state(); if (this._onActivateOverride) { this._onActivateOverride(event); diff --git a/js/ui/ctrlAltTab.js b/js/ui/ctrlAltTab.js index 67d08817e..193f14ed9 100644 --- a/js/ui/ctrlAltTab.js +++ b/js/ui/ctrlAltTab.js @@ -233,7 +233,7 @@ const CtrlAltTabPopup = new Lang.Class({ _keyPressEvent : function(actor, event) { let keysym = event.get_key_symbol(); - let shift = (Shell.get_event_state(event) & Clutter.ModifierType.SHIFT_MASK); + let shift = (event.get_state() & Clutter.ModifierType.SHIFT_MASK); if (shift && keysym == Clutter.KEY_Tab) keysym = Clutter.ISO_Left_Tab; diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js index 80f7ca5f6..89d0fa074 100644 --- a/js/ui/lookingGlass.js +++ b/js/ui/lookingGlass.js @@ -1140,7 +1140,7 @@ const LookingGlass = new Lang.Class({ // Handle key events which are relevant for all tabs of the LookingGlass _globalKeyPressEvent : function(actor, event) { let symbol = event.get_key_symbol(); - let modifierState = Shell.get_event_state(event); + let modifierState = event.get_state(); if (symbol == Clutter.Escape) { if (this._objInspector.actor.visible) { this._objInspector.close(); diff --git a/js/ui/main.js b/js/ui/main.js index c80375cb7..64160d6cb 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -572,7 +572,7 @@ function _globalKeyPressHandler(actor, event) { let symbol = event.get_key_symbol(); let keyCode = event.get_key_code(); - let modifierState = Shell.get_event_state(event); + let modifierState = event.get_state(); // This relies on the fact that Clutter.ModifierType is the same as Gdk.ModifierType let action = global.display.get_keybinding_action(keyCode, modifierState); diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js index 69a0c26c8..a41225f4f 100644 --- a/js/ui/runDialog.js +++ b/js/ui/runDialog.js @@ -242,7 +242,7 @@ const RunDialog = new Lang.Class({ let symbol = e.get_key_symbol(); if (symbol == Clutter.Return || symbol == Clutter.KP_Enter) { this.popModal(); - if (Shell.get_event_state(e) & Clutter.ModifierType.CONTROL_MASK) + if (e.get_state() & Clutter.ModifierType.CONTROL_MASK) this._run(o.get_text(), true); else this._run(o.get_text(), false); diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js index 4ba9c9499..20e107789 100644 --- a/js/ui/viewSelector.js +++ b/js/ui/viewSelector.js @@ -511,7 +511,7 @@ const ViewSelector = new Lang.Class({ }, _onStageKeyPress: function(actor, event) { - let modifiers = Shell.get_event_state(event); + let modifiers = event.get_state(); let symbol = event.get_key_symbol(); if (symbol == Clutter.Escape) { diff --git a/src/shell-util.c b/src/shell-util.c index 6647baf3d..0a1baab39 100644 --- a/src/shell-util.c +++ b/src/shell-util.c @@ -592,25 +592,6 @@ shell_util_get_week_start () return week_start; } -/** - * shell_get_event_state: - * @event: a #ClutterEvent - * - * Gets the current state of the event (the set of modifier keys that - * are pressed down). Thhis is a wrapper around - * clutter_event_get_state() that strips out any un-declared modifier - * flags, to make gjs happy; see - * https://bugzilla.gnome.org/show_bug.cgi?id=597292. - * - * Return value: the state from the event - */ -ClutterModifierType -shell_get_event_state (ClutterEvent *event) -{ - ClutterModifierType state = clutter_event_get_state (event); - return state & CLUTTER_MODIFIER_MASK; -} - /** * shell_write_soup_message_to_stream: * @stream: a #GOutputStream diff --git a/src/shell-util.h b/src/shell-util.h index 5b93bd4b6..bfb5089d5 100644 --- a/src/shell-util.h +++ b/src/shell-util.h @@ -25,9 +25,6 @@ char *shell_util_normalize_and_casefold (const char *str); char *shell_util_format_date (const char *format, gint64 time_ms); -ClutterModifierType - shell_get_event_state (ClutterEvent *event); - void shell_write_soup_message_to_stream (GOutputStream *stream, SoupMessage *message, GError **error);