Merge lp:~3v1n0/unity/use-scaling-ubuntu-schemas-settings into lp:unity

Proposed by Marco Trevisan (Treviño) on 2017-10-02
Status: Merged
Approved by: Andrea Azzarone on 2017-10-03
Approved revision: 4275
Merged at revision: 4260
Proposed branch: lp:~3v1n0/unity/use-scaling-ubuntu-schemas-settings
Merge into: lp:unity
Diff against target: 527 lines (+126/-159)
11 files modified
debian/control (+2/-1)
debian/unity.migrations (+1/-0)
tests/data/external.gschema.xml (+13/-0)
tests/test_em_converter.cpp (+7/-19)
tests/test_raw_pixel.cpp (+1/-2)
tools/migration-scripts/02_unity_setup_text_scale_factor (+3/-7)
tools/migration-scripts/04_unity_update_software_center_desktop_file (+7/-6)
tools/migration-scripts/05_unity_use_ubuntu_scaling_settings_schemas (+66/-0)
unity-shared/EMConverter.cpp (+8/-63)
unity-shared/EMConverter.h (+1/-16)
unity-shared/UnitySettings.cpp (+17/-45)
To merge this branch: bzr merge lp:~3v1n0/unity/use-scaling-ubuntu-schemas-settings
Reviewer Review Type Date Requested Status
Didier Roche Needs Fixing on 2017-10-03
Andrea Azzarone (community) 2017-10-02 Approve on 2017-10-03
Review via email: mp+331667@code.launchpad.net

Commit message

UnitySettings: use the ubuntu-schemas path for scaling settings

Also remove unused parts of EMConverter

To post a comment you must log in.
4273. By Marco Trevisan (Treviño) on 2017-10-02

02_unity_setup_text_scale_factor: don't use dconf anymore

4274. By Marco Trevisan (Treviño) on 2017-10-02

04_unity_update_software_center_desktop_file: sync settings instead of using dconf

4275. By Marco Trevisan (Treviño) on 2017-10-02

MigrationScript: add 05_unity_use_ubuntu_scaling_settings_schemas

This converts gnome desktop interface settings to ubuntu ones

Andrea Azzarone (azzar1) wrote :

+1

review: Approve
Andrea Azzarone (azzar1) wrote :

text-scaling is not correctly migrated doing an upgrade from Z to A using this ppa. But this improves the current behavior so +1 for me.

Didier Roche (didrocks) wrote :

The change looks good to me code-wise, there are 2 things on this and other merge proposals to do:
- please file a bug to explain why we are migrating those values. This is so that the release team understands the bug fix and reference it in each package impacted.
- on this one, we have a migration script for the scaling factor. However, we have another migration script to reset the scaling factor for GNOME. It means that if we run the ubuntu session before switching to the unity one, we need to ensure about the order (and having the migration script moving the key before the Ubuntu one). Another way is to move the reset from the other script to that one, after you migrated the settings. Mind doing that change?

review: Needs Fixing
4276. By Marco Trevisan (Treviño) on 2017-10-03

05_unity_use_ubuntu_scaling_settings_schemas: also reset gnome values after

4277. By Marco Trevisan (Treviño) on 2017-10-04

05_unity_use_ubuntu_scaling_settings_schemas: migrate keys if we know the values from unity

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2017-09-01 09:48:41 +0000
3+++ debian/control 2017-10-04 18:50:31 +0000
4@@ -12,7 +12,7 @@
5 dh-python,
6 google-mock (>= 1.6.0+svn437),
7 gsettings-desktop-schemas-dev,
8- gsettings-ubuntu-schemas (>= 0.0.1+14.04.20140219),
9+ gsettings-ubuntu-schemas (>= 0.0.7+17.10.20170922),
10 intltool (>= 0.35.0),
11 libappstream-glib-dev,
12 libatk1.0-dev,
13@@ -73,6 +73,7 @@
14 compiz-core, compiz-core-abiversion-${coreabiversion},
15 libnux-abiversion-${nuxabiversion},
16 compiz-plugins-default,
17+ gsettings-ubuntu-schemas (>= 0.0.7+17.10.20170922),
18 libglib2.0-bin,
19 nux-tools,
20 python3-gi,
21
22=== modified file 'debian/unity.migrations'
23--- debian/unity.migrations 2016-02-22 20:34:21 +0000
24+++ debian/unity.migrations 2017-10-04 18:50:31 +0000
25@@ -2,3 +2,4 @@
26 tools/migration-scripts/02_unity_setup_text_scale_factor
27 tools/migration-scripts/03_unity_first_run_stamp_move
28 tools/migration-scripts/04_unity_update_software_center_desktop_file
29+tools/migration-scripts/05_unity_use_ubuntu_scaling_settings_schemas
30\ No newline at end of file
31
32=== modified file 'tests/data/external.gschema.xml'
33--- tests/data/external.gschema.xml 2017-07-17 16:47:39 +0000
34+++ tests/data/external.gschema.xml 2017-10-04 18:50:31 +0000
35@@ -74,6 +74,19 @@
36 </key>
37 </schema>
38
39+ <schema path="/com/ubuntu/user-interface/desktop/" id="com.ubuntu.user-interface.desktop">
40+ <key type="u" name="scaling-factor">
41+ <default>0</default>
42+ </key>
43+ <key type="d" name="text-scaling-factor">
44+ <range min="0.5" max="3.0"/>
45+ <default>1.0</default>
46+ </key>
47+ <key type="i" name="cursor-size">
48+ <default>24</default>
49+ </key>
50+ </schema>
51+
52 <schema id="com.canonical.unity-greeter" path="/com/canonical/unity-greeter/">
53 <key type="s" name="logo">
54 <default>'/usr/share/unity-greeter/logo.png'</default>
55
56=== modified file 'tests/test_em_converter.cpp'
57--- tests/test_em_converter.cpp 2014-02-07 23:45:27 +0000
58+++ tests/test_em_converter.cpp 2017-10-04 18:50:31 +0000
59@@ -26,34 +26,19 @@
60 {
61
62 int const PIXEL_SIZE = 24;
63-int const FONT_SIZE = 13;
64 double const DPI = 96.0;
65
66 class TestEMConverter : public Test
67 {
68 public:
69 TestEMConverter()
70- : em_converter(FONT_SIZE, DPI)
71+ : em_converter(DPI)
72 {
73 }
74
75 EMConverter em_converter;
76 };
77
78-TEST_F(TestEMConverter, TestCtor)
79-{
80- EXPECT_EQ(FONT_SIZE, em_converter.GetFontSize());
81- EXPECT_EQ(DPI, em_converter.GetDPI());
82-}
83-
84-TEST_F(TestEMConverter, TestSetFontSize)
85-{
86- int const font_size = 15;
87-
88- em_converter.SetFontSize(font_size);
89- EXPECT_EQ(font_size, em_converter.GetFontSize());
90-}
91-
92 TEST_F(TestEMConverter, TestSetDPI)
93 {
94 int const dpi = 120.0;
95@@ -79,10 +64,13 @@
96 EXPECT_FLOAT_EQ(em_converter.DPIScale(), 2.0);
97 }
98
99-TEST_F(TestEMConverter, TestPtToPx)
100+TEST_F(TestEMConverter, TestConvertPixelScaled)
101 {
102- int pt = 12;
103- EXPECT_EQ(em_converter.PtToPx(pt), 16);
104+ for (double scale : std::vector<double>({1.0, 1.25, 1.5, 1.75, 2}))
105+ {
106+ em_converter.SetDPI(DPI * scale);
107+ EXPECT_EQ(std::round(PIXEL_SIZE * scale), em_converter.CP(PIXEL_SIZE));
108+ }
109 }
110
111 } // namespace unity
112
113=== modified file 'tests/test_raw_pixel.cpp'
114--- tests/test_raw_pixel.cpp 2014-02-26 00:01:21 +0000
115+++ tests/test_raw_pixel.cpp 2017-10-04 18:50:31 +0000
116@@ -25,14 +25,13 @@
117 namespace unity
118 {
119
120-int const FONT_SIZE = 13;
121 double const DPI = 96.0;
122
123 class TestRawPixel : public Test
124 {
125 public:
126 TestRawPixel()
127- : cv(std::make_shared<EMConverter>(FONT_SIZE, DPI))
128+ : cv(std::make_shared<EMConverter>(DPI))
129 , p_i(10_em)
130 , p_f(10.0_em)
131 {
132
133=== modified file 'tools/migration-scripts/02_unity_setup_text_scale_factor'
134--- tools/migration-scripts/02_unity_setup_text_scale_factor 2016-02-22 20:34:21 +0000
135+++ tools/migration-scripts/02_unity_setup_text_scale_factor 2017-10-04 18:50:31 +0000
136@@ -1,6 +1,6 @@
137 #!/usr/bin/python3
138 # -*- coding: utf-8 -*-
139-# Copyright (C) 2014-2015 Canonical
140+# Copyright (C) 2014-2017 Canonical
141 #
142 # Authors:
143 # Marco Trevisan <marco.trevisan@canonical.com>
144@@ -25,7 +25,6 @@
145 GNOME_TEXT_SCALE_FACTOR = "text-scaling-factor";
146
147 UNITY_UI_SETTINGS = "com.canonical.Unity.Interface";
148-UNITY_UI_SETTINGS_PATH = "/com/canonical/unity/interface/"
149 UNITY_TEXT_SCALE_FACTOR = "text-scale-factor";
150
151 gnome_ui_schema = Gio.SettingsSchemaSource.get_default().lookup(GNOME_UI_SETTINGS, recursive=False)
152@@ -35,8 +34,5 @@
153
154 text_scale_factor = Gio.Settings(settings_schema=gnome_ui_schema).get_double(GNOME_TEXT_SCALE_FACTOR)
155
156-# gsettings doesn't work directly, the key is somewhat reverted. Work one level under then: dconf!
157-# Gio.Settings(schema=UNITY_UI_SETTINGS).set_int(UNITY_TEXT_SCALE_FACTOR, text_scale_factor)
158-from subprocess import Popen, PIPE, STDOUT
159-p = Popen(("dconf load "+UNITY_UI_SETTINGS_PATH).split(), stdout=PIPE, stdin=PIPE, stderr=STDOUT)
160-p.communicate(input=bytes("[/]\n"+UNITY_TEXT_SCALE_FACTOR+"={}".format(text_scale_factor), 'utf-8'))
161+Gio.Settings.new(UNITY_UI_SETTINGS).set_double(UNITY_TEXT_SCALE_FACTOR, text_scale_factor)
162+Gio.Settings.sync()
163
164=== modified file 'tools/migration-scripts/04_unity_update_software_center_desktop_file' (properties changed: -x to +x)
165--- tools/migration-scripts/04_unity_update_software_center_desktop_file 2016-02-22 20:50:18 +0000
166+++ tools/migration-scripts/04_unity_update_software_center_desktop_file 2017-10-04 18:50:31 +0000
167@@ -21,16 +21,17 @@
168 from gi.repository import Gio
169
170 UNITY_LAUNCHER_SETTINGS = "com.canonical.Unity.Launcher";
171-UNITY_LAUNCHER_SETTINGS_PATH = "/com/canonical/unity/launcher/"
172 UNITY_LAUNCER_FAVORITES = "favorites";
173
174-favorites = Gio.Settings(schema=UNITY_LAUNCHER_SETTINGS).get_strv(UNITY_LAUNCER_FAVORITES)
175+launcher_settings = Gio.Settings.new(UNITY_LAUNCHER_SETTINGS)
176+favorites = launcher_settings.get_strv(UNITY_LAUNCER_FAVORITES)
177+replaced = False
178
179 for i in range(len(favorites)):
180 if 'ubuntu-software-center.desktop' in favorites[i]:
181 favorites[i] = favorites[i].replace('ubuntu-software-center', 'org.gnome.Software')
182+ replaced = True
183
184-# gsettings doesn't work directly, the key is somewhat reverted. Work one level under then: dconf!
185-from subprocess import Popen, PIPE, STDOUT
186-p = Popen(("dconf load "+UNITY_LAUNCHER_SETTINGS_PATH).split(), stdout=PIPE, stdin=PIPE, stderr=STDOUT)
187-p.communicate(input=bytes("[/]\n"+UNITY_LAUNCER_FAVORITES+"={}".format(favorites), 'utf-8'))
188+if replaced:
189+ launcher_settings.set_strv(UNITY_LAUNCER_FAVORITES, favorites)
190+ Gio.Settings.sync()
191
192=== added file 'tools/migration-scripts/05_unity_use_ubuntu_scaling_settings_schemas'
193--- tools/migration-scripts/05_unity_use_ubuntu_scaling_settings_schemas 1970-01-01 00:00:00 +0000
194+++ tools/migration-scripts/05_unity_use_ubuntu_scaling_settings_schemas 2017-10-04 18:50:31 +0000
195@@ -0,0 +1,66 @@
196+#!/usr/bin/python3
197+# -*- coding: utf-8 -*-
198+# Copyright (C) 2014-2017 Canonical
199+#
200+# Authors:
201+# Marco Trevisan <marco.trevisan@canonical.com>
202+#
203+# This program is free software; you can redistribute it and/or modify it under
204+# the terms of the GNU General Public License as published by the Free Software
205+# Foundation; version 3.
206+#
207+# This program is distributed in the hope that it will be useful, but WITHOUTa
208+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
209+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
210+# details.
211+#
212+# You should have received a copy of the GNU General Public License along with
213+# this program; if not, write to the Free Software Foundation, Inc.,
214+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
215+
216+from gi.repository import Gio
217+import os,sys
218+
219+GNOME_UI_SETTINGS = "org.gnome.desktop.interface";
220+UBUNTU_UI_SETTINGS = "com.ubuntu.user-interface.desktop";
221+UNITY_UI_SETTINGS = "com.canonical.Unity.Interface";
222+
223+KEYS_TO_TRANSLATE = { "text-scaling-factor": "text-scale-factor" }
224+KEYS_TO_MIGRATE = [ "cursor-size", "scaling-factor", "text-scaling-factor" ]
225+
226+gnome_ui_schema = Gio.SettingsSchemaSource.get_default().lookup(GNOME_UI_SETTINGS, recursive=False)
227+if not gnome_ui_schema:
228+ print("No gnome desktop interface schemas found, no migration needed")
229+ sys.exit(0)
230+
231+ubuntu_ui_schema = Gio.SettingsSchemaSource.get_default().lookup(UBUNTU_UI_SETTINGS, recursive=False)
232+if not ubuntu_ui_schema:
233+ print("No ubuntu desktop interface schemas found, no migration needed")
234+ sys.exit(0)
235+
236+gnome_settings = Gio.Settings(settings_schema=gnome_ui_schema)
237+ubuntu_settings = Gio.Settings(settings_schema=ubuntu_ui_schema)
238+
239+for key in KEYS_TO_MIGRATE:
240+ gnome_value = gnome_settings.get_value(key)
241+ ubuntu_value = ubuntu_settings.get_value(key)
242+
243+ # We reset the gnome values first
244+ if gnome_settings.is_writable(key):
245+ if key in KEYS_TO_TRANSLATE.keys():
246+ unity_value = Gio.Settings.new(UNITY_UI_SETTINGS).get_value(KEYS_TO_TRANSLATE[key])
247+ if unity_value != gnome_value:
248+ gnome_settings.set_value(key, unity_value)
249+ else:
250+ gnome_settings.reset(key)
251+ else:
252+ print("Can't reset or migrate key '{} {}': in read only.".format(GNOME_UI_SETTINGS, key))
253+
254+ # Then we migrate the settings, so that u-s-d proxy won't interfere
255+ if ubuntu_settings.is_writable(key):
256+ if ubuntu_value != gnome_value:
257+ ubuntu_settings.set_value(key, gnome_value)
258+ else:
259+ print("Can't migrate key '{} {}': in read only.".format(UBUNTU_UI_SETTINGS, key))
260+
261+Gio.Settings.sync()
262
263=== modified file 'unity-shared/EMConverter.cpp'
264--- unity-shared/EMConverter.cpp 2014-05-08 03:19:39 +0000
265+++ unity-shared/EMConverter.cpp 2017-10-04 18:50:31 +0000
266@@ -23,86 +23,31 @@
267 namespace unity
268 {
269
270-double const BASE_DPI = 96.0;
271-double const DEFAULT_PPE = 10.0;
272-double const PIXELS_PER_INCH = 72.0;
273-
274-EMConverter::EMConverter(int font_size, double dpi)
275- : pixels_per_em_(DEFAULT_PPE)
276- , base_pixels_per_em_(DEFAULT_PPE)
277- , dpi_(dpi)
278- , font_size_(font_size)
279-{
280- UpdatePixelsPerEM();
281- UpdateBasePixelsPerEM();
282-}
283-
284-double EMConverter::PtToPx(int pt)
285-{
286- return pt * dpi_ / PIXELS_PER_INCH;
287-}
288-
289-void EMConverter::UpdatePixelsPerEM()
290-{
291- pixels_per_em_ = font_size_ * dpi_ / PIXELS_PER_INCH;
292-
293- if (pixels_per_em_ == 0)
294- pixels_per_em_ = DEFAULT_PPE;
295-}
296-
297-void EMConverter::UpdateBasePixelsPerEM()
298-{
299- base_pixels_per_em_ = font_size_ * BASE_DPI / PIXELS_PER_INCH;
300-
301- if (base_pixels_per_em_ == 0)
302- base_pixels_per_em_ = DEFAULT_PPE;
303-}
304-
305-bool EMConverter::SetFontSize(int font_size)
306-{
307- if (font_size != font_size_)
308- {
309- font_size_ = font_size;
310- UpdatePixelsPerEM();
311- UpdateBasePixelsPerEM();
312- return true;
313- }
314-
315- return false;
316-}
317+namespace
318+{
319+const double BASE_DPI = 96.0;
320+}
321+
322+EMConverter::EMConverter(double dpi)
323+ : dpi_(dpi)
324+{}
325
326 bool EMConverter::SetDPI(double dpi)
327 {
328 if (dpi != dpi_)
329 {
330 dpi_ = dpi;
331- UpdatePixelsPerEM();
332 return true;
333 }
334
335 return false;
336 }
337
338-int EMConverter::GetFontSize() const
339-{
340- return font_size_;
341-}
342-
343 double EMConverter::GetDPI() const
344 {
345 return dpi_;
346 }
347
348-double EMConverter::EMToPixels(double em) const
349-{
350- return (em * pixels_per_em_);
351-}
352-
353-double EMConverter::PixelsToBaseEM(int pixels) const
354-{
355- return (pixels / base_pixels_per_em_);
356-}
357-
358 double EMConverter::CP(int pixels) const
359 {
360 return std::round(pixels * DPIScale());
361
362=== modified file 'unity-shared/EMConverter.h'
363--- unity-shared/EMConverter.h 2014-02-27 04:54:19 +0000
364+++ unity-shared/EMConverter.h 2017-10-04 18:50:31 +0000
365@@ -30,31 +30,16 @@
366 public:
367 typedef std::shared_ptr<EMConverter> Ptr;
368
369- EMConverter(int font_size = 0, double dpi = 96.0);
370+ EMConverter(double dpi = 96.0);
371
372- bool SetFontSize(int font_size);
373 bool SetDPI(double dpi);
374-
375- int GetFontSize() const;
376 double GetDPI() const;
377
378 double CP(int pixels) const;
379 double DPIScale() const;
380
381- double PtToPx(int pt);
382-
383 private:
384- void UpdatePixelsPerEM();
385- void UpdateBasePixelsPerEM();
386-
387- double EMToPixels(double em) const;
388- double PixelsToBaseEM(int pixels) const;
389-
390- double pixels_per_em_;
391- double base_pixels_per_em_;
392-
393 double dpi_;
394- int font_size_;
395 };
396
397 } // namespace unity
398
399=== modified file 'unity-shared/UnitySettings.cpp'
400--- unity-shared/UnitySettings.cpp 2017-07-17 10:33:25 +0000
401+++ unity-shared/UnitySettings.cpp 2017-10-04 18:50:31 +0000
402@@ -62,13 +62,12 @@
403 const std::string COMPIZ_PROFILE = "current-profile";
404
405 const std::string UBUNTU_UI_SETTINGS = "com.ubuntu.user-interface";
406+const std::string UBUNTU_DESKTOP_UI_SETTINGS = "com.ubuntu.user-interface.desktop";
407 const std::string SCALE_FACTOR = "scale-factor";
408
409-const std::string GNOME_UI_SETTINGS = "org.gnome.desktop.interface";
410-const std::string GNOME_FONT_NAME = "font-name";
411-const std::string GNOME_CURSOR_SIZE = "cursor-size";
412-const std::string GNOME_SCALE_FACTOR = "scaling-factor";
413-const std::string GNOME_TEXT_SCALE_FACTOR = "text-scaling-factor";
414+const std::string DESKTOP_CURSOR_SIZE = "cursor-size";
415+const std::string DESKTOP_SCALE_FACTOR = "scaling-factor";
416+const std::string DESKTOP_TEXT_SCALE_FACTOR = "text-scaling-factor";
417
418 const std::string REMOTE_CONTENT_SETTINGS = "com.canonical.Unity.Lenses";
419 const std::string REMOTE_CONTENT_KEY = "remote-content-search";
420@@ -84,7 +83,7 @@
421
422 const int DEFAULT_LAUNCHER_SIZE = 64;
423 const int MINIMUM_DESKTOP_HEIGHT = 800;
424-const int GNOME_SETTINGS_CHANGED_WAIT_SECONDS = 1;
425+const int DESKTOP_SETTINGS_CHANGED_WAIT_SECONDS = 1;
426 const double DEFAULT_DPI = 96.0f;
427 const double DPI_SCALING_LIMIT = 140.0f;
428 const int DPI_SCALING_STEP = 8;
429@@ -105,7 +104,7 @@
430 , gestures_settings_(g_settings_new(GESTURES_SETTINGS.c_str()))
431 , ui_settings_(g_settings_new(UI_SETTINGS.c_str()))
432 , ubuntu_ui_settings_(g_settings_new(UBUNTU_UI_SETTINGS.c_str()))
433- , gnome_ui_settings_(g_settings_new(GNOME_UI_SETTINGS.c_str()))
434+ , desktop_ui_settings_(g_settings_new(UBUNTU_DESKTOP_UI_SETTINGS.c_str()))
435 , remote_content_settings_(g_settings_new(REMOTE_CONTENT_SETTINGS.c_str()))
436 , launcher_sizes_(monitors::MAX, DEFAULT_LAUNCHER_SIZE)
437 , cached_launcher_position_(LauncherPosition::LEFT)
438@@ -174,13 +173,8 @@
439 UpdateDPI();
440 });
441
442- signals_.Add<void, GSettings*, const gchar*>(gnome_ui_settings_, "changed::" + GNOME_FONT_NAME, [this] (GSettings*, const gchar* t) {
443- UpdateFontSize();
444- UpdateDPI();
445- });
446-
447- signals_.Add<void, GSettings*, const gchar*>(gnome_ui_settings_, "changed::" + GNOME_TEXT_SCALE_FACTOR, [this] (GSettings*, const gchar* t) {
448- double new_scale_factor = g_settings_get_double(gnome_ui_settings_, GNOME_TEXT_SCALE_FACTOR.c_str());
449+ signals_.Add<void, GSettings*, const gchar*>(desktop_ui_settings_, "changed::" + DESKTOP_TEXT_SCALE_FACTOR, [this] (GSettings*, const gchar* t) {
450+ double new_scale_factor = g_settings_get_double(desktop_ui_settings_, DESKTOP_TEXT_SCALE_FACTOR.c_str());
451 g_settings_set_double(ui_settings_, TEXT_SCALE_FACTOR.c_str(), new_scale_factor);
452 });
453
454@@ -203,7 +197,6 @@
455 UpdateGesturesSetting();
456 UpdateTextScaleFactor();
457 UpdateCursorScaleFactor();
458- UpdateFontSize();
459 UpdateDPI();
460
461 CacheFormFactor();
462@@ -365,27 +358,6 @@
463 return g_settings_get_boolean(usettings_, PAM_CHECK_ACCOUNT_TYPE.c_str());
464 }
465
466- int GetFontSize() const
467- {
468- gint font_size;
469- PangoFontDescription* desc;
470-
471- glib::String font_name(g_settings_get_string(gnome_ui_settings_, GNOME_FONT_NAME.c_str()));
472- desc = pango_font_description_from_string(font_name);
473- font_size = pango_font_description_get_size(desc);
474- pango_font_description_free(desc);
475-
476- return font_size / 1024;
477- }
478-
479- void UpdateFontSize()
480- {
481- int font_size = GetFontSize();
482-
483- for (auto const& em : em_converters_)
484- em->SetFontSize(font_size);
485- }
486-
487 void UpdateTextScaleFactor()
488 {
489 parent_->font_scaling = g_settings_get_double(ui_settings_, TEXT_SCALE_FACTOR.c_str());
490@@ -505,18 +477,18 @@
491
492 void UpdateAppsScaling(double scale)
493 {
494- signals_.Block(gnome_ui_settings_);
495+ signals_.Block(desktop_ui_settings_);
496 unsigned integer_scaling = std::max<unsigned>(1, std::lround(scale));
497 double point_scaling = scale / static_cast<double>(integer_scaling);
498 double text_scale_factor = parent_->font_scaling() * point_scaling;
499- glib::Variant default_cursor_size(g_settings_get_default_value(gnome_ui_settings_, GNOME_CURSOR_SIZE.c_str()), glib::StealRef());
500+ glib::Variant default_cursor_size(g_settings_get_default_value(desktop_ui_settings_, DESKTOP_CURSOR_SIZE.c_str()), glib::StealRef());
501 int cursor_size = std::round(default_cursor_size.GetInt32() * point_scaling * cursor_scale_);
502- g_settings_set_int(gnome_ui_settings_, GNOME_CURSOR_SIZE.c_str(), cursor_size);
503- g_settings_set_uint(gnome_ui_settings_, GNOME_SCALE_FACTOR.c_str(), integer_scaling);
504- g_settings_set_double(gnome_ui_settings_, GNOME_TEXT_SCALE_FACTOR.c_str(), text_scale_factor);
505+ g_settings_set_int(desktop_ui_settings_, DESKTOP_CURSOR_SIZE.c_str(), cursor_size);
506+ g_settings_set_uint(desktop_ui_settings_, DESKTOP_SCALE_FACTOR.c_str(), integer_scaling);
507+ g_settings_set_double(desktop_ui_settings_, DESKTOP_TEXT_SCALE_FACTOR.c_str(), text_scale_factor);
508
509- changing_gnome_settings_timeout_.reset(new glib::TimeoutSeconds(GNOME_SETTINGS_CHANGED_WAIT_SECONDS, [this] {
510- signals_.Unblock(gnome_ui_settings_);
511+ changing_desktop_settings_timeout_.reset(new glib::TimeoutSeconds(DESKTOP_SETTINGS_CHANGED_WAIT_SECONDS, [this] {
512+ signals_.Unblock(desktop_ui_settings_);
513 return false;
514 }, glib::Source::Priority::LOW));
515 }
516@@ -546,9 +518,9 @@
517 glib::Object<GSettings> gestures_settings_;
518 glib::Object<GSettings> ui_settings_;
519 glib::Object<GSettings> ubuntu_ui_settings_;
520- glib::Object<GSettings> gnome_ui_settings_;
521+ glib::Object<GSettings> desktop_ui_settings_;
522 glib::Object<GSettings> remote_content_settings_;
523- glib::Source::UniquePtr changing_gnome_settings_timeout_;
524+ glib::Source::UniquePtr changing_desktop_settings_timeout_;
525 glib::SignalManager signals_;
526 std::vector<EMConverter::Ptr> em_converters_;
527 std::vector<int> launcher_sizes_;