diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2018-08-15 15:39:58 +0200 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2018-08-15 15:43:26 +0200 |
commit | 79ab5d52d25b356db448bcd1dd6a1289823b5bd2 (patch) | |
tree | 903031c483e85e886793d56bc6e94f6082de1bb6 | |
parent | 764fbbe0524e89eb25cad8894fa4091f3fa47ac7 (diff) | |
download | gnome-shell-wip/carlosg/issue-440.tar.gz |
runDialog: Use ClutterText::activate for enter handlingwip/carlosg/issue-440
Instead of consuming the event in front of the input method. Enter
is sometimes overriden by those, so it seems better to let the IM
handle the key event, and react later to it if it got propagated
anyway. That is what ::activate does, so use this signal.
This used to work before ClutterInputMethod/InputFocus because the
IM received the events directly from stage captured events. This
is not the case anymore.
Closes: #440
-rw-r--r-- | js/ui/runDialog.js | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js index b514f5b9f..6e8c8a905 100644 --- a/js/ui/runDialog.js +++ b/js/ui/runDialog.js @@ -118,18 +118,16 @@ var RunDialog = new Lang.Class({ this._history = new History.HistoryManager({ gsettingsKey: HISTORY_KEY, entry: this._entryText }); + this._entryText.connect('activate', (o) => { + this.popModal(); + this._run(o.get_text(), + Clutter.get_current_event().get_state() & Clutter.ModifierType.CONTROL_MASK); + if (!this._commandError || + !this.pushModal()) + this.close(); + }); this._entryText.connect('key-press-event', (o, e) => { let symbol = e.get_key_symbol(); - if (symbol == Clutter.Return || symbol == Clutter.KP_Enter) { - this.popModal(); - this._run(o.get_text(), - e.get_state() & Clutter.ModifierType.CONTROL_MASK); - if (!this._commandError || - !this.pushModal()) - this.close(); - - return Clutter.EVENT_STOP; - } if (symbol == Clutter.Tab) { let text = o.get_text(); let prefix; |