Merge ~3v1n0/ubuntu/+source/gnome-settings-daemon:ubuntu/bionic into ~ubuntu-desktop/ubuntu/+source/gnome-settings-daemon:ubuntu/bionic

Proposed by Marco Trevisan (Treviño) on 2019-01-22
Status: Merged
Approved by: Sebastien Bacher on 2019-01-24
Approved revision: 22d96685d5a0d4d6684da55400245987f7e83a98
Merged at revision: 02e520af1584b62e45acd00e8c755d670f35d3e6
Proposed branch: ~3v1n0/ubuntu/+source/gnome-settings-daemon:ubuntu/bionic
Merge into: ~ubuntu-desktop/ubuntu/+source/gnome-settings-daemon:ubuntu/bionic
Diff against target: 252 lines (+224/-0)
4 files modified
debian/changelog (+7/-0)
debian/gbp.conf (+17/-0)
debian/patches/keyboard-Enable-ibus-for-OSK-purposes.patch (+199/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Iain Lane Approve on 2019-01-25
Sebastien Bacher 2019-01-22 Approve on 2019-01-24
Review via email: mp+362049@code.launchpad.net
To post a comment you must log in.
Sebastien Bacher (seb128) wrote :

Looks good to me, do you want me to merge/upload that as well or do you plan to land in a silo?

review: Approve
Iain Lane (laney) wrote :

I'll upload, 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 bb73cc0..910ba6a 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+gnome-settings-daemon (3.28.1-0ubuntu1.2) UNRELEASED; urgency=medium
7+
8+ * debian/patches/keyboard-Enable-ibus-for-OSK-purposes.patch:
9+ - Enable IBus for OSK (LP: #1760399)
10+
11+ -- Marco Trevisan (Treviño) <marco@ubuntu.com> Mon, 21 Jan 2019 20:26:58 +0100
12+
13 gnome-settings-daemon (3.28.1-0ubuntu1.1) bionic; urgency=medium
14
15 * debian/patches/git_binary_encoding.patch:
16diff --git a/debian/gbp.conf b/debian/gbp.conf
17new file mode 100644
18index 0000000..52f9b83
19--- /dev/null
20+++ b/debian/gbp.conf
21@@ -0,0 +1,17 @@
22+[DEFAULT]
23+pristine-tar = True
24+debian-branch = debian/bionic
25+upstream-branch = upstream/3.28.x
26+upstream-vcs-tag = %(version)s
27+
28+[buildpackage]
29+sign-tags = True
30+
31+[dch]
32+multimaint-merge = True
33+
34+[import-orig]
35+postimport = dch -v%(version)s New upstream release; git add debian/changelog; debcommit
36+
37+[pq]
38+patch-numbers = False
39diff --git a/debian/patches/keyboard-Enable-ibus-for-OSK-purposes.patch b/debian/patches/keyboard-Enable-ibus-for-OSK-purposes.patch
40new file mode 100644
41index 0000000..6a76d1b
42--- /dev/null
43+++ b/debian/patches/keyboard-Enable-ibus-for-OSK-purposes.patch
44@@ -0,0 +1,199 @@
45+From: Carlos Garnacho <carlosg@gnome.org>
46+Date: Tue, 25 Sep 2018 20:19:39 +0200
47+Subject: keyboard: Enable ibus for OSK purposes
48+
49+As gnome-shell relies on IBus for focus tracking, enable this IM whenever
50+the conditions for OSK popping up might arise.
51+
52+Closes: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/95
53+
54+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/1760399
55+Bug-GNOME: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/95
56+Origin: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/commit/b7e1d69593
57+---
58+ plugins/keyboard/gsd-keyboard-manager.c | 82 +++++++++++++++++++++++++++------
59+ 1 file changed, 69 insertions(+), 13 deletions(-)
60+
61+diff --git a/plugins/keyboard/gsd-keyboard-manager.c b/plugins/keyboard/gsd-keyboard-manager.c
62+index 343b049..480e735 100644
63+--- a/plugins/keyboard/gsd-keyboard-manager.c
64++++ b/plugins/keyboard/gsd-keyboard-manager.c
65+@@ -80,11 +80,15 @@
66+
67+ #define DEFAULT_LAYOUT "us"
68+
69++#define GNOME_A11Y_APPLICATIONS_INTERFACE_DIR "org.gnome.desktop.a11y.applications"
70++#define KEY_OSK_ENABLED "screen-keyboard-enabled"
71++
72+ struct GsdKeyboardManagerPrivate
73+ {
74+ guint start_idle_id;
75+ GSettings *settings;
76+ GSettings *input_sources_settings;
77++ GSettings *a11y_settings;
78+ GDBusProxy *localed;
79+ GCancellable *cancellable;
80+
81+@@ -92,12 +96,15 @@ struct GsdKeyboardManagerPrivate
82+ GsdNumLockState old_state;
83+ GdkDeviceManager *device_manager;
84+ guint device_added_id;
85++ guint device_removed_id;
86+ };
87+
88+ static void gsd_keyboard_manager_class_init (GsdKeyboardManagerClass *klass);
89+ static void gsd_keyboard_manager_init (GsdKeyboardManager *keyboard_manager);
90+ static void gsd_keyboard_manager_finalize (GObject *object);
91+
92++static void update_gtk_im_module (GsdKeyboardManager *manager);
93++
94+ G_DEFINE_TYPE (GsdKeyboardManager, gsd_keyboard_manager, G_TYPE_OBJECT)
95+
96+ static gpointer manager_object = NULL;
97+@@ -417,9 +424,23 @@ device_added_cb (GdkDeviceManager *device_manager,
98+ if (source == GDK_SOURCE_KEYBOARD) {
99+ g_debug ("New keyboard plugged in, applying all settings");
100+ apply_numlock (manager);
101++ } else if (source == GDK_SOURCE_TOUCHSCREEN) {
102++ update_gtk_im_module (manager);
103+ }
104+ }
105+
106++static void
107++device_removed_cb (GdkDeviceManager *device_manager,
108++ GdkDevice *device,
109++ GsdKeyboardManager *manager)
110++{
111++ GdkInputSource source;
112++
113++ source = gdk_device_get_source (device);
114++ if (source == GDK_SOURCE_TOUCHSCREEN)
115++ update_gtk_im_module (manager);
116++}
117++
118+ static void
119+ set_devicepresence_handler (GsdKeyboardManager *manager)
120+ {
121+@@ -432,6 +453,8 @@ set_devicepresence_handler (GsdKeyboardManager *manager)
122+
123+ manager->priv->device_added_id = g_signal_connect (G_OBJECT (device_manager), "device-added",
124+ G_CALLBACK (device_added_cb), manager);
125++ manager->priv->device_removed_id = g_signal_connect (G_OBJECT (device_manager), "device-removed",
126++ G_CALLBACK (device_removed_cb), manager);
127+ manager->priv->device_manager = device_manager;
128+ }
129+
130+@@ -449,14 +472,37 @@ need_ibus (GVariant *sources)
131+ return FALSE;
132+ }
133+
134++static gboolean
135++need_osk (GsdKeyboardManager *manager)
136++{
137++ GSettings *a11y_settings;
138++ gboolean has_touchscreen = FALSE;
139++ GList *devices, *l;
140++ GdkSeat *seat;
141++
142++ if (g_settings_get_boolean (manager->priv->a11y_settings,
143++ KEY_OSK_ENABLED))
144++ return TRUE;
145++
146++ seat = gdk_display_get_default_seat (gdk_display_get_default ());
147++ devices = gdk_seat_get_slaves (seat, GDK_SEAT_CAPABILITY_TOUCH);
148++
149++ has_touchscreen = devices != NULL;
150++
151++ g_list_free (devices);
152++
153++ return has_touchscreen;
154++}
155++
156+ static void
157+-set_gtk_im_module (GSettings *settings,
158+- GVariant *sources)
159++set_gtk_im_module (GsdKeyboardManager *manager,
160++ GSettings *settings,
161++ GVariant *sources)
162+ {
163+ const gchar *new_module;
164+ gchar *current_module;
165+
166+- if (need_ibus (sources))
167++ if (need_ibus (sources) || need_osk (manager))
168+ new_module = GTK_IM_MODULE_IBUS;
169+ else
170+ new_module = GTK_IM_MODULE_SIMPLE;
171+@@ -528,32 +574,33 @@ manager_notify_is_loaded_cb (GObject *object,
172+ }
173+ }
174+
175+-static void
176+-input_sources_changed (GSettings *settings,
177+- const char *key,
178+- GsdKeyboardManager *manager)
179++update_gtk_im_module (GsdKeyboardManager *manager)
180+ {
181+ GSettings *interface_settings;
182+ GVariant *sources;
183+ ActUserManager *user_manager;
184+ gboolean user_manager_loaded;
185++
186+ /* Gtk+ uses the IM module advertised in XSETTINGS so, if we
187+ * have IBus input sources, we want it to load that
188+ * module. Otherwise we can use the default "simple" module
189+ * which is builtin gtk+
190+ */
191+- sources = g_settings_get_value (settings, KEY_INPUT_SOURCES);
192+ interface_settings = g_settings_new (GNOME_DESKTOP_INTERFACE_DIR);
193+- set_gtk_im_module (interface_settings, sources);
194++ sources = g_settings_get_value (manager->priv->input_sources_settings,
195++ KEY_INPUT_SOURCES);
196++ set_gtk_im_module (manager, interface_settings, sources);
197+ g_object_unref (interface_settings);
198+ g_variant_unref (sources);
199+
200+ user_manager = act_user_manager_get_default ();
201+ g_object_get (user_manager, "is-loaded", &user_manager_loaded, NULL);
202+ if (user_manager_loaded)
203+- manager_notify_is_loaded_cb (G_OBJECT (user_manager), NULL, settings);
204++ manager_notify_is_loaded_cb (G_OBJECT (user_manager), NULL,
205++ manager->priv->input_sources_settings);
206+ else
207+- g_signal_connect (user_manager, "notify::is-loaded", G_CALLBACK (manager_notify_is_loaded_cb), settings);
208++ g_signal_connect (user_manager, "notify::is-loaded", G_CALLBACK (manager_notify_is_loaded_cb),
209++ manager->priv->input_sources_settings);
210+ }
211+
212+ static void
213+@@ -812,8 +859,15 @@ start_keyboard_idle_cb (GsdKeyboardManager *manager)
214+ set_devicepresence_handler (manager);
215+
216+ manager->priv->input_sources_settings = g_settings_new (GNOME_DESKTOP_INPUT_SOURCES_DIR);
217+- g_signal_connect (manager->priv->input_sources_settings, "changed::"KEY_INPUT_SOURCES,
218+- G_CALLBACK (input_sources_changed), manager);
219++ g_signal_connect_swapped (manager->priv->input_sources_settings,
220++ "changed::" KEY_INPUT_SOURCES,
221++ G_CALLBACK (update_gtk_im_module), manager);
222++
223++ manager->priv->a11y_settings = g_settings_new (GNOME_A11Y_APPLICATIONS_INTERFACE_DIR);
224++ g_signal_connect_swapped (manager->priv->a11y_settings,
225++ "changed::" KEY_OSK_ENABLED,
226++ G_CALLBACK (update_gtk_im_module), manager);
227++ update_gtk_im_module (manager);
228+
229+ manager->priv->cancellable = g_cancellable_new ();
230+
231+@@ -876,10 +930,12 @@ gsd_keyboard_manager_stop (GsdKeyboardManager *manager)
232+
233+ g_clear_object (&p->settings);
234+ g_clear_object (&p->input_sources_settings);
235++ g_clear_object (&p->a11y_settings);
236+ g_clear_object (&p->localed);
237+
238+ if (p->device_manager != NULL) {
239+ g_signal_handler_disconnect (p->device_manager, p->device_added_id);
240++ g_signal_handler_disconnect (p->device_manager, p->device_removed_id);
241+ p->device_manager = NULL;
242+ }
243+
244diff --git a/debian/patches/series b/debian/patches/series
245index 9791d9b..291dbcd 100644
246--- a/debian/patches/series
247+++ b/debian/patches/series
248@@ -9,3 +9,4 @@ revert-gsettings-removals.patch
249 revert-mediakeys-dbus-interface-drop.patch
250 ubuntu_ibus_configs.patch
251 git_binary_encoding.patch
252+keyboard-Enable-ibus-for-OSK-purposes.patch

Subscribers

People subscribed via source and target branches