[gnome-shell/wip/carlosg/osk-updates: 6/10] keyboard: Fill suggestion on button-press-event
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/carlosg/osk-updates: 6/10] keyboard: Fill suggestion on button-press-event
- Date: Tue, 26 Apr 2022 14:36:51 +0000 (UTC)
commit 1a8f008e3c3e0adedc6f3ddf8d015e3b03571260
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Apr 22 16:19:14 2022 +0200
keyboard: Fill suggestion on button-press-event
Like OSK key buttons, we must avoid the default grabbing behavior
of StButton here. Hook to button-press-event to commit the selected
words, so we get a chance to prevent focus changes on the current
key focus.
js/ui/keyboard.js | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index 461ae075b5..f102b3d61c 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -173,7 +173,10 @@ class Suggestions extends St.BoxLayout {
add(word, callback) {
let button = new St.Button({ label: word });
- button.connect('clicked', callback);
+ button.connect('button-press-event', () => {
+ callback();
+ return Clutter.EVENT_STOP;
+ });
this.add_child(button);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]