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

Subscribers

People subscribed via source and target branches

to all changes: