Merge lp:~khurshid-alam/unity-settings-daemon/use-usd-schemas into lp:unity-settings-daemon

Proposed by Khurshid Alam on 2019-09-02
Status: Merged
Approved by: Marco Trevisan (Treviño) on 2019-09-07
Approved revision: 4199
Merged at revision: 4196
Proposed branch: lp:~khurshid-alam/unity-settings-daemon/use-usd-schemas
Merge into: lp:unity-settings-daemon
Diff against target: 409 lines (+265/-12)
7 files modified
data/Makefile.am (+12/-1)
data/com.canonical.unity.settings-daemon.plugins.media-keys.gschema.xml.in.in (+228/-0)
debian/control (+10/-0)
debian/unity-settings-daemon-schemas.install (+1/-0)
plugins/keyboard/gsd-keyboard-manager.c (+5/-4)
plugins/media-keys/shortcuts-list.h (+1/-1)
plugins/mouse/gsd-mouse-manager.c (+8/-6)
To merge this branch: bzr merge lp:~khurshid-alam/unity-settings-daemon/use-usd-schemas
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve on 2019-09-07
Sebastien Bacher 2019-09-02 Pending
Review via email: mp+372154@code.launchpad.net

Commit message

* Port media keys to use com.canonical.unity.settings-daemon
  u-s-d will still use org.gnome.settings-daemon in dbus. LP: #1842324

* Use new gsettings key location for mouse & keyboard.

  https://gitlab.gnome.org/GNOME/gnome-settings-daemon/commit/6dff93a0dfa80db3f481eed5d6ed689bf469aa1b

  https://gitlab.gnome.org/GNOME/gnome-settings-daemon/commit/710a4c4e7828828cb35ea14333882354ae73264f

To post a comment you must log in.
Marco Trevisan (Treviño) (3v1n0) wrote :

Looks good to me, would have been nice in a further iteration to change the settings/gsettings naming to something clearer, but not a fault of this MR.

review: Approve
Marco Trevisan (Treviño) (3v1n0) wrote :
review: Needs Fixing
4199. By Khurshid Alam on 2019-09-06

Use <Control><Alt>l to lock the screen

Khurshid Alam (khurshid-alam) wrote :

Ok. Done.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/Makefile.am'
2--- data/Makefile.am 2014-08-29 10:24:00 +0000
3+++ data/Makefile.am 2019-09-06 22:29:15 +0000
4@@ -3,6 +3,14 @@
5 apidir = $(includedir)/unity-settings-daemon-$(GSD_API_VERSION)/unity-settings-daemon
6 api_DATA = gsd-enums.h
7
8+gschema_in_files = com.canonical.unity.settings-daemon.plugins.media-keys.gschema.xml.in.in
9+gsettings_SCHEMAS = $(gschema_in_files:.xml.in.in=.xml)
10+
11+gsettingsdir = $(datadir)/glib-2.0/schemas
12+
13+%.gschema.xml.in: %.gschema.xml.in.in
14+ $(AM_V_GEN) sed -e "s|\@GETTEXT_PACKAGE\@|$(GETTEXT_PACKAGE)|g" $< > $@
15+
16 @INTLTOOL_XML_NOMERGE_RULE@
17
18 @GSETTINGS_RULES@
19@@ -22,6 +30,7 @@
20
21 EXTRA_DIST = \
22 $(convert_DATA) \
23+ $(gschema_in_files) \
24 $(desktop_in_files) \
25 $(gsettings_ENUM_FILES) \
26 unity-settings-daemon.pc.in \
27@@ -36,4 +45,6 @@
28
29 MAINTAINERCLEANFILES = \
30 *~ \
31- Makefile.in
32+ Makefile.in \
33+ $(gsettings_SCHEMAS:.xml=.valid)
34+
35
36=== added file 'data/com.canonical.unity.settings-daemon.plugins.media-keys.gschema.xml.in.in'
37--- data/com.canonical.unity.settings-daemon.plugins.media-keys.gschema.xml.in.in 1970-01-01 00:00:00 +0000
38+++ data/com.canonical.unity.settings-daemon.plugins.media-keys.gschema.xml.in.in 2019-09-06 22:29:15 +0000
39@@ -0,0 +1,228 @@
40+<?xml version="1.0" encoding="UTF-8"?>
41+<schemalist>
42+ <schema gettext-domain="@GETTEXT_PACKAGE@" id="com.canonical.unity.settings-daemon.plugins.media-keys" path="/com/canonical/unity/settings-daemon/plugins/media-keys/">
43+ <key name="priority" type="i">
44+ <default>0</default>
45+ <summary>Priority to use for this plugin</summary>
46+ <description>Priority to use for this plugin in unity-settings-daemon startup queue</description>
47+ </key>
48+ <key name="active" type="b">
49+ <default>true</default>
50+ <summary>Activation of this plugin</summary>
51+ <description>Whether this plugin would be activated by unity-settings-daemon or not</description>
52+ </key>
53+ <key name="custom-keybindings" type="as">
54+ <default>[]</default>
55+ <summary>Custom keybindings</summary>
56+ <description>List of custom keybindings</description>
57+ </key>
58+ <key name="calculator" type="s">
59+ <default>'XF86Calculator'</default>
60+ <summary>Launch calculator</summary>
61+ <description>Binding to launch the calculator.</description>
62+ </key>
63+ <key name="control-center" type="s">
64+ <default>'XF86Tools'</default>
65+ <summary>Launch settings</summary>
66+ <description>Binding to launch GNOME settings.</description>
67+ </key>
68+ <key name="email" type="s">
69+ <default>'XF86Mail'</default>
70+ <summary>Launch email client</summary>
71+ <description>Binding to launch the email client.</description>
72+ </key>
73+ <key name="eject" type="s">
74+ <default>'XF86Eject'</default>
75+ <summary>Eject</summary>
76+ <description>Binding to eject an optical disc.</description>
77+ </key>
78+ <key name="help" type="s">
79+ <default>''</default>
80+ <summary>Launch help browser</summary>
81+ <description>Binding to launch the help browser.</description>
82+ </key>
83+ <key name="home" type="s">
84+ <default>'XF86Explorer'</default>
85+ <summary>Home folder</summary>
86+ <description>Binding to open the Home folder.</description>
87+ </key>
88+ <key name="media" type="s">
89+ <default>'XF86AudioMedia'</default>
90+ <summary>Launch media player</summary>
91+ <description>Binding to launch the media player.</description>
92+ </key>
93+ <key name="next" type="s">
94+ <default>'XF86AudioNext'</default>
95+ <summary>Next track</summary>
96+ <description>Binding to skip to next track.</description>
97+ </key>
98+ <key name="pause" type="s">
99+ <default>'XF86AudioPause'</default>
100+ <summary>Pause playback</summary>
101+ <description>Binding to pause playback.</description>
102+ </key>
103+ <key name="play" type="s">
104+ <default>'XF86AudioPlay'</default>
105+ <summary>Play (or play/pause)</summary>
106+ <description>Binding to start playback (or toggle play/pause).</description>
107+ </key>
108+ <key name="logout" type="s">
109+ <default>'&lt;Control&gt;&lt;Alt&gt;Delete'</default>
110+ <summary>Log out</summary>
111+ <description>Binding to log out.</description>
112+ </key>
113+ <key name="previous" type="s">
114+ <default>'XF86AudioPrev'</default>
115+ <summary>Previous track</summary>
116+ <description>Binding to skip to previous track.</description>
117+ </key>
118+ <key name="screensaver" type="s">
119+ <default>'&lt;Control&gt;&lt;Alt&gt;l'</default>
120+ <summary>Lock screen</summary>
121+ <description>Binding to lock the screen.</description>
122+ </key>
123+ <key name="search" type="s">
124+ <default>'XF86Search'</default>
125+ <summary>Search</summary>
126+ <description>Binding to launch the search tool.</description>
127+ </key>
128+ <key name="stop" type="s">
129+ <default>'XF86AudioStop'</default>
130+ <summary>Stop playback</summary>
131+ <description>Binding to stop playback.</description>
132+ </key>
133+ <key name="video-out" type="s">
134+ <default>'&lt;Super&gt;p'</default>
135+ <summary>Video output</summary>
136+ <description>Binding to switch the video output device.</description>
137+ </key>
138+ <key name="volume-down" type="s">
139+ <default>'XF86AudioLowerVolume'</default>
140+ <summary>Volume down</summary>
141+ <description>Binding to lower the volume.</description>
142+ </key>
143+ <key name="volume-mute" type="s">
144+ <default>'XF86AudioMute'</default>
145+ <summary>Volume mute/unmute</summary>
146+ <description>Binding to mute/unmute the volume.</description>
147+ </key>
148+ <key name="volume-up" type="s">
149+ <default>'XF86AudioRaiseVolume'</default>
150+ <summary>Volume up</summary>
151+ <description>Binding to raise the volume.</description>
152+ </key>
153+ <key name="mic-mute" type="s">
154+ <default>'XF86AudioMicMute'</default>
155+ <summary>Microphone mute/unmute</summary>
156+ <description>Binding to mute/unmute the microphone.</description>
157+ </key>
158+ <key name="screenshot" type="s">
159+ <default>'Print'</default>
160+ <summary>Take a screenshot</summary>
161+ <description>Binding to take a screenshot.</description>
162+ </key>
163+ <key name="window-screenshot" type="s">
164+ <default>'&lt;Alt&gt;Print'</default>
165+ <summary>Take a screenshot of a window</summary>
166+ <description>Binding to take a screenshot of a window.</description>
167+ </key>
168+ <key name="area-screenshot" type="s">
169+ <default>'&lt;Shift&gt;Print'</default>
170+ <summary>Take a screenshot of an area</summary>
171+ <description>Binding to take a screenshot of an area.</description>
172+ </key>
173+ <key name="screenshot-clip" type="s">
174+ <default>'&lt;Ctrl&gt;Print'</default>
175+ <summary>Copy a screenshot to clipboard</summary>
176+ <description>Binding to copy a screenshot to clipboard.</description>
177+ </key>
178+ <key name="window-screenshot-clip" type="s">
179+ <default>'&lt;Ctrl&gt;&lt;Alt&gt;Print'</default>
180+ <summary>Copy a screenshot of a window to clipboard</summary>
181+ <description>Binding to copy a screenshot of a window to clipboard.</description>
182+ </key>
183+ <key name="area-screenshot-clip" type="s">
184+ <default>'&lt;Ctrl&gt;&lt;Shift&gt;Print'</default>
185+ <summary>Copy a screenshot of an area to clipboard</summary>
186+ <description>Binding to copy a screenshot of an area to clipboard.</description>
187+ </key>
188+ <key name="screencast" type="s">
189+ <default>'&lt;Ctrl&gt;&lt;Shift&gt;&lt;Alt&gt;R'</default>
190+ <summary>Record a short video of the screen</summary>
191+ <description>Binding to record a short video of the screen</description>
192+ </key>
193+ <key name="terminal" type="s">
194+ <default>'&lt;Primary&gt;&lt;Alt&gt;t'</default>
195+ <summary>Launch terminal</summary>
196+ <description>Binding to launch the terminal.</description>
197+ </key>
198+ <key name="www" type="s">
199+ <default>'XF86WWW'</default>
200+ <summary>Launch web browser</summary>
201+ <description>Binding to launch the web browser.</description>
202+ </key>
203+ <key name="magnifier" type="s">
204+ <default>'&lt;Alt&gt;&lt;Super&gt;8'</default>
205+ <summary>Toggle magnifier</summary>
206+ <description>Binding to show the screen magnifier</description>
207+ </key>
208+ <key name="screenreader" type="s">
209+ <default>'&lt;Alt&gt;&lt;Super&gt;s'</default>
210+ <summary>Toggle screen reader</summary>
211+ <description>Binding to start the screen reader</description>
212+ </key>
213+ <key name="on-screen-keyboard" type="s">
214+ <default>''</default>
215+ <summary>Toggle on-screen keyboard</summary>
216+ <description>Binding to show the on-screen keyboard</description>
217+ </key>
218+ <key name="increase-text-size" type="s">
219+ <default>''</default>
220+ <summary>Increase text size</summary>
221+ <description>Binding to increase the text size</description>
222+ </key>
223+ <key name="decrease-text-size" type="s">
224+ <default>''</default>
225+ <summary>Decrease text size</summary>
226+ <description>Binding to decrease the text size</description>
227+ </key>
228+ <key name="toggle-contrast" type="s">
229+ <default>''</default>
230+ <summary>Toggle contrast</summary>
231+ <description>Binding to toggle the interface contrast</description>
232+ </key>
233+ <key name="magnifier-zoom-in" type="s">
234+ <default>'&lt;Alt&gt;&lt;Super&gt;equal'</default>
235+ <summary>Magnifier zoom in</summary>
236+ <description>Binding for the magnifier to zoom in</description>
237+ </key>
238+ <key name="magnifier-zoom-out" type="s">
239+ <default>'&lt;Alt&gt;&lt;Super&gt;minus'</default>
240+ <summary>Magnifier zoom out</summary>
241+ <description>Binding for the magnifier to zoom out</description>
242+ </key>
243+ <key name="max-screencast-length" type="u">
244+ <default>30</default>
245+ <summary>Maximum length of screen recordings</summary>
246+ <description>The maximum length of single screen cast recordings in seconds or 0 for unlimited</description>
247+ </key>
248+ </schema>
249+
250+ <schema gettext-domain="@GETTEXT_PACKAGE@" id="com.canonical.unity.settings-daemon.plugins.media-keys.custom-keybinding">
251+ <key name="name" type="s">
252+ <default>''</default>
253+ <summary>Name</summary>
254+ <description>Name of the custom binding</description>
255+ </key>
256+ <key name="binding" type="s">
257+ <default>''</default>
258+ <summary>Binding</summary>
259+ <description>Binding for the custom binding</description>
260+ </key>
261+ <key name="command" type="s">
262+ <default>''</default>
263+ <summary>Command</summary>
264+ <description>Command to run when the binding is invoked</description>
265+ </key>
266+ </schema>
267+</schemalist>
268
269=== modified file 'debian/control'
270--- debian/control 2019-01-09 16:46:14 +0000
271+++ debian/control 2019-09-06 22:29:15 +0000
272@@ -58,6 +58,7 @@
273 accountsservice (>= 0.6.34),
274 gsettings-desktop-schemas (>= 3.15.4),
275 nautilus-data (>= 2.91.3-1),
276+ unity-settings-daemon-schemas (>= ${source:Version}),
277 gnome-settings-daemon-common (>= 3.16),
278 gsettings-ubuntu-schemas (>= 0.0.7+17.10.20170922),
279 Recommends: ibus (>= 1.5.0),
280@@ -103,6 +104,15 @@
281 Description: Headers for building applications communicating with unity-settings-daemon
282 This package contains header files required to build applications that
283 communicate with the Unity settings daemon over D-Bus.
284+
285+Package: unity-settings-daemon-schemas
286+Architecture: all
287+Depends: ${misc:Depends}
288+Replaces: gnome-settings-daemon (<< 3.20.1-2ubuntu1~)
289+Breaks: gnome-settings-daemon (<< 3.20.1-2ubuntu1~)
290+Description: Shared schemas for gnome-settings-daemon
291+ This package contains the gsettings schemas used by
292+ unity-settings-daemon.
293
294 Package: libunity-settings-daemon1
295 Architecture: any
296
297=== added file 'debian/unity-settings-daemon-schemas.install'
298--- debian/unity-settings-daemon-schemas.install 1970-01-01 00:00:00 +0000
299+++ debian/unity-settings-daemon-schemas.install 2019-09-06 22:29:15 +0000
300@@ -0,0 +1,1 @@
301+debian/*/usr/share/glib-*/schemas/*
302
303=== modified file 'plugins/keyboard/gsd-keyboard-manager.c'
304--- plugins/keyboard/gsd-keyboard-manager.c 2016-10-03 09:57:23 +0000
305+++ plugins/keyboard/gsd-keyboard-manager.c 2019-09-06 22:29:15 +0000
306@@ -685,7 +685,7 @@
307 g_debug ("New num-lock state '%s' != Old num-lock state '%s'",
308 num_lock_state_to_string (numlock_state),
309 num_lock_state_to_string (manager->priv->old_state));
310- g_settings_set_enum (manager->priv->settings,
311+ g_settings_set_enum (manager->priv->gsettings,
312 KEY_NUMLOCK_STATE,
313 numlock_state);
314 manager->priv->old_state = numlock_state;
315@@ -1793,9 +1793,9 @@
316 gboolean rnumlock;
317
318 g_debug ("Applying the num-lock settings");
319- settings = manager->priv->settings;
320+ settings = manager->priv->gsettings;
321 rnumlock = g_settings_get_boolean (settings, KEY_REMEMBER_NUMLOCK_STATE);
322- manager->priv->old_state = g_settings_get_enum (manager->priv->settings, KEY_NUMLOCK_STATE);
323+ manager->priv->old_state = g_settings_get_enum (manager->priv->gsettings, KEY_NUMLOCK_STATE);
324
325 gdk_error_trap_push ();
326 if (rnumlock) {
327@@ -2629,7 +2629,8 @@
328 GsdSettingsMigrateEntry entries[] = {
329 { "repeat", "repeat", NULL },
330 { "repeat-interval", "repeat-interval", NULL },
331- { "delay", "delay", NULL }
332+ { "delay", "delay", NULL },
333+ { "remember-numlock-state", "remember-numlock-state", NULL },
334 };
335
336 gsd_settings_migrate_check ("org.gnome.settings-daemon.peripherals.keyboard.deprecated",
337
338=== modified file 'plugins/media-keys/shortcuts-list.h'
339--- plugins/media-keys/shortcuts-list.h 2014-03-14 06:27:10 +0000
340+++ plugins/media-keys/shortcuts-list.h 2019-09-06 22:29:15 +0000
341@@ -24,7 +24,7 @@
342 #include "shell-keybinding-modes.h"
343 #include "gsd-keygrab.h"
344
345-#define SETTINGS_BINDING_DIR "org.gnome.settings-daemon.plugins.media-keys"
346+#define SETTINGS_BINDING_DIR "com.canonical.unity.settings-daemon.plugins.media-keys"
347 #define INPUT_SETTINGS_BINDING_DIR "org.gnome.desktop.wm.keybindings"
348
349 typedef enum {
350
351=== modified file 'plugins/mouse/gsd-mouse-manager.c'
352--- plugins/mouse/gsd-mouse-manager.c 2015-10-07 16:32:40 +0000
353+++ plugins/mouse/gsd-mouse-manager.c 2019-09-06 22:29:15 +0000
354@@ -57,7 +57,7 @@
355
356 #define GSD_MOUSE_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_MOUSE_MANAGER, GsdMouseManagerPrivate))
357
358-#define GSD_SETTINGS_MOUSE_SCHEMA "org.gnome.settings-daemon.peripherals.mouse"
359+#define GNOME_DESKTOP_INTERFACE_DIR "org.gnome.desktop.interface"
360 #define GSETTINGS_MOUSE_SCHEMA "org.gnome.desktop.peripherals.mouse"
361 #define GSETTINGS_TOUCHPAD_SCHEMA "org.gnome.desktop.peripherals.touchpad"
362
363@@ -82,7 +82,7 @@
364 GSettings *touchpad_settings;
365 GSettings *mouse_settings;
366 GSettings *mouse_a11y_settings;
367- GSettings *gsd_mouse_settings;
368+ GSettings *interface_settings;
369 GdkDeviceManager *device_manager;
370 guint device_added_id;
371 guint device_removed_id;
372@@ -851,7 +851,7 @@
373 manager->priv->locate_pointer_spawned = (error == NULL);
374
375 if (error) {
376- g_settings_set_boolean (manager->priv->gsd_mouse_settings, KEY_LOCATE_POINTER, FALSE);
377+ g_settings_set_boolean (manager->priv->interface_settings, KEY_LOCATE_POINTER, FALSE);
378 g_error_free (error);
379 }
380
381@@ -1223,8 +1223,8 @@
382
383 set_devicepresence_handler (manager);
384
385- manager->priv->gsd_mouse_settings = g_settings_new (GSD_SETTINGS_MOUSE_SCHEMA);
386- g_signal_connect (manager->priv->gsd_mouse_settings, "changed",
387+ manager->priv->interface_settings = g_settings_new (GNOME_DESKTOP_INTERFACE_DIR);
388+ g_signal_connect (manager->priv->interface_settings, "changed",
389 G_CALLBACK (mouse_callback), manager);
390
391 manager->priv->mouse_a11y_settings = g_settings_new ("org.gnome.desktop.a11y.mouse");
392@@ -1241,7 +1241,7 @@
393
394 manager->priv->syndaemon_spawned = FALSE;
395
396- set_locate_pointer (manager, g_settings_get_boolean (manager->priv->gsd_mouse_settings, KEY_LOCATE_POINTER));
397+ set_locate_pointer (manager, g_settings_get_boolean (manager->priv->interface_settings, KEY_LOCATE_POINTER));
398 set_mousetweaks_daemon (manager,
399 g_settings_get_boolean (manager->priv->mouse_a11y_settings, KEY_DWELL_CLICK_ENABLED),
400 g_settings_get_boolean (manager->priv->mouse_a11y_settings, KEY_SECONDARY_CLICK_ENABLED));
401@@ -1326,6 +1326,8 @@
402 g_clear_object (&p->touchpad_settings);
403
404 set_locate_pointer (manager, FALSE);
405+
406+ g_clear_object (&p->interface_settings);
407 }
408
409 static void

Subscribers

People subscribed via source and target branches