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:
parent
760da64a4c
commit
aa5d352a06
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user