Merge ~osomon/ubuntu/+source/gnome-shell:bionic-sru-lp1765304 into ~ubuntu-desktop/ubuntu/+source/gnome-shell:ubuntu/bionic

Proposed by Olivier Tilloy
Status: Merged
Merged at revision: 27f00e513651b857c740caeba945b1857c882139
Proposed branch: ~osomon/ubuntu/+source/gnome-shell:bionic-sru-lp1765304
Merge into: ~ubuntu-desktop/ubuntu/+source/gnome-shell:ubuntu/bionic
Diff against target: 103 lines (+81/-0)
3 files modified
debian/changelog (+8/-0)
debian/patches/ibus-set-content-type-no-holdKeyboard.patch (+72/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Iain Lane Approve
Review via email: mp+359817@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Iain Lane (laney) wrote :

thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index 2d2d1df..ca7daa7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
1gnome-shell (3.28.3-0ubuntu0.18.04.4) UNRELEASED; urgency=medium
2
3 * debian/patches/ibus-set-content-type-no-holdKeyboard.patch:
4 - Cherry-pick upstream commit to prevent focus stealing on password fields
5 in firefox when ibus is used (LP: #1765304)
6
7 -- Olivier Tilloy <olivier.tilloy@canonical.com> Thu, 29 Nov 2018 11:34:00 +0100
8
1gnome-shell (3.28.3-0ubuntu0.18.04.3) bionic; urgency=medium9gnome-shell (3.28.3-0ubuntu0.18.04.3) bionic; urgency=medium
210
3 * debian/ubuntu.css:11 * debian/ubuntu.css:
diff --git a/debian/patches/ibus-set-content-type-no-holdKeyboard.patch b/debian/patches/ibus-set-content-type-no-holdKeyboard.patch
4new file mode 10064412new file mode 100644
index 0000000..7892be8
--- /dev/null
+++ b/debian/patches/ibus-set-content-type-no-holdKeyboard.patch
@@ -0,0 +1,72 @@
1Description: Do not call KeyboardManager.holdKeyboard() with set-content-type
2Origin: https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/140
3Bug-Ubuntu: https://launchpad.net/bugs/1765304
4From 551e827841626cd8084daa2210b3bf60e5be96be Mon Sep 17 00:00:00 2001
5From: Takao Fujiwara <tfujiwar@redhat.com>
6Date: Fri, 31 Aug 2018 20:22:23 +0900
7Subject: [PATCH] keyboard: Do not call KeyboardManager.holdKeyboard() with
8 set-content-type
9
10When gnome-shell receives the signal of 'set-content-type' from ibus,
11gnome-shell calls KeyboardManager.holdKeyboard() and
12KeyboardManager.releaseKeyboard() and the functions change the current
13input focus in GNOME Xorg and it could result in closing a popup window
14which has a password entry by focusing on the entry.
15The solution is to stop to call the APIs on 'set-content-type' signal.
16
17https://gitlab.gnome.org/GNOME/gnome-shell/issues/391
18---
19 js/ui/status/keyboard.js | 18 ++++++++++++++++--
20 1 file changed, 16 insertions(+), 2 deletions(-)
21
22diff --git a/js/ui/status/keyboard.js b/js/ui/status/keyboard.js
23index 6d031d88c..980019cd4 100644
24--- a/js/ui/status/keyboard.js
25+++ b/js/ui/status/keyboard.js
26@@ -360,11 +360,14 @@ var InputSourceManager = new Lang.Class({
27 this._settings.connect('per-window-changed', this._sourcesPerWindowChanged.bind(this));
28 this._sourcesPerWindowChanged();
29 this._disableIBus = false;
30+ this._reloading = false;
31 },
32
33 reload() {
34+ this._reloading = true;
35 this._keyboardManager.setKeyboardOptions(this._settings.keyboardOptions);
36 this._inputSourcesChanged();
37+ this._reloading = false;
38 },
39
40 _ibusReadyCallback(im, ready) {
41@@ -458,7 +461,15 @@ var InputSourceManager = new Lang.Class({
42 },
43
44 activateInputSource(is, interactive) {
45- KeyboardManager.holdKeyboard();
46+ // The focus changes during holdKeyboard/releaseKeyboard may trick
47+ // the client into hiding UI containing the currently focused entry.
48+ // So holdKeyboard/releaseKeyboard are not called when
49+ // 'set-content-type' signal is received.
50+ // E.g. Focusing on a password entry in a popup in Xorg Firefox
51+ // will emit 'set-content-type' signal.
52+ // https://gitlab.gnome.org/GNOME/gnome-shell/issues/391
53+ if (!this._reloading)
54+ KeyboardManager.holdKeyboard();
55 this._keyboardManager.apply(is.xkbId);
56
57 // All the "xkb:..." IBus engines simply "echo" back symbols,
58@@ -473,7 +484,10 @@ var InputSourceManager = new Lang.Class({
59 else
60 engine = 'xkb:us::eng';
61
62- this._ibusManager.setEngine(engine, KeyboardManager.releaseKeyboard);
63+ if (!this._reloading)
64+ this._ibusManager.setEngine(engine, KeyboardManager.releaseKeyboard);
65+ else
66+ this._ibusManager.setEngine(engine);
67 this._currentInputSourceChanged(is);
68
69 if (interactive)
70--
712.18.1
72
diff --git a/debian/patches/series b/debian/patches/series
index 6a12345..50a4a68 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -25,3 +25,4 @@ popupMenu-Don-t-handle-key-presses-directly-if-there-are-.patch
25st-button-Ignore-pointer-emulated-touch-events.patch25st-button-Ignore-pointer-emulated-touch-events.patch
26st-scroll-view-Handle-the-case-where-scrollbars-are-NULL.patch26st-scroll-view-Handle-the-case-where-scrollbars-are-NULL.patch
27st-scroll-view-Remove-scrollbars-references-on-dispose.patch27st-scroll-view-Remove-scrollbars-references-on-dispose.patch
28ibus-set-content-type-no-holdKeyboard.patch

Subscribers

People subscribed via source and target branches

to all changes: