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.
This commit is contained in:
Rui Matos 2012-02-28 17:01:48 +01:00
parent 760da64a4c
commit aa5d352a06
9 changed files with 8 additions and 30 deletions

View File

@ -265,7 +265,7 @@ const AltTabPopup = new Lang.Class({
_keyPressEvent : function(actor, event) { _keyPressEvent : function(actor, event) {
let keysym = event.get_key_symbol(); 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 backwards = event_state & Clutter.ModifierType.SHIFT_MASK;
let action = global.display.get_keybinding_action(event.get_key_code(), event_state); let action = global.display.get_keybinding_action(event.get_key_code(), event_state);

View File

@ -339,7 +339,7 @@ const AppSearchProvider = new Lang.Class({
timestamp: 0 }); timestamp: 0 });
let event = Clutter.get_current_event(); 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; let openNewWindow = modifiers & Clutter.ModifierType.CONTROL_MASK;
if (openNewWindow) if (openNewWindow)
@ -584,7 +584,7 @@ const AppWellIcon = new Lang.Class({
_onActivate: function (event) { _onActivate: function (event) {
this.emit('launching'); this.emit('launching');
let modifiers = Shell.get_event_state(event); let modifiers = event.get_state();
if (this._onActivateOverride) { if (this._onActivateOverride) {
this._onActivateOverride(event); this._onActivateOverride(event);

View File

@ -233,7 +233,7 @@ const CtrlAltTabPopup = new Lang.Class({
_keyPressEvent : function(actor, event) { _keyPressEvent : function(actor, event) {
let keysym = event.get_key_symbol(); 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) if (shift && keysym == Clutter.KEY_Tab)
keysym = Clutter.ISO_Left_Tab; keysym = Clutter.ISO_Left_Tab;

View File

@ -1140,7 +1140,7 @@ const LookingGlass = new Lang.Class({
// Handle key events which are relevant for all tabs of the LookingGlass // Handle key events which are relevant for all tabs of the LookingGlass
_globalKeyPressEvent : function(actor, event) { _globalKeyPressEvent : function(actor, event) {
let symbol = event.get_key_symbol(); let symbol = event.get_key_symbol();
let modifierState = Shell.get_event_state(event); let modifierState = event.get_state();
if (symbol == Clutter.Escape) { if (symbol == Clutter.Escape) {
if (this._objInspector.actor.visible) { if (this._objInspector.actor.visible) {
this._objInspector.close(); this._objInspector.close();

View File

@ -572,7 +572,7 @@ function _globalKeyPressHandler(actor, event) {
let symbol = event.get_key_symbol(); let symbol = event.get_key_symbol();
let keyCode = event.get_key_code(); 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 // This relies on the fact that Clutter.ModifierType is the same as Gdk.ModifierType
let action = global.display.get_keybinding_action(keyCode, modifierState); let action = global.display.get_keybinding_action(keyCode, modifierState);

View File

@ -242,7 +242,7 @@ const RunDialog = new Lang.Class({
let symbol = e.get_key_symbol(); let symbol = e.get_key_symbol();
if (symbol == Clutter.Return || symbol == Clutter.KP_Enter) { if (symbol == Clutter.Return || symbol == Clutter.KP_Enter) {
this.popModal(); 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); this._run(o.get_text(), true);
else else
this._run(o.get_text(), false); this._run(o.get_text(), false);

View File

@ -511,7 +511,7 @@ const ViewSelector = new Lang.Class({
}, },
_onStageKeyPress: function(actor, event) { _onStageKeyPress: function(actor, event) {
let modifiers = Shell.get_event_state(event); let modifiers = event.get_state();
let symbol = event.get_key_symbol(); let symbol = event.get_key_symbol();
if (symbol == Clutter.Escape) { if (symbol == Clutter.Escape) {

View File

@ -592,25 +592,6 @@ shell_util_get_week_start ()
return 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: * shell_write_soup_message_to_stream:
* @stream: a #GOutputStream * @stream: a #GOutputStream

View File

@ -25,9 +25,6 @@ char *shell_util_normalize_and_casefold (const char *str);
char *shell_util_format_date (const char *format, char *shell_util_format_date (const char *format,
gint64 time_ms); gint64 time_ms);
ClutterModifierType
shell_get_event_state (ClutterEvent *event);
void shell_write_soup_message_to_stream (GOutputStream *stream, void shell_write_soup_message_to_stream (GOutputStream *stream,
SoupMessage *message, SoupMessage *message,
GError **error); GError **error);