Merge lp:~3v1n0/unity-control-center/unity-lowgfx-support into lp:unity-control-center

Proposed by Marco Trevisan (Treviño) on 2017-04-04
Status: Superseded
Proposed branch: lp:~3v1n0/unity-control-center/unity-lowgfx-support
Merge into: lp:unity-control-center
Diff against target: 1108 lines (+576/-118)
2 files modified
panels/appearance/appearance.ui (+143/-35)
panels/appearance/cc-appearance-panel.c (+433/-83)
To merge this branch: bzr merge lp:~3v1n0/unity-control-center/unity-lowgfx-support
Reviewer Review Type Date Requested Status
Sebastien Bacher 2017-04-27 Approve on 2017-06-26
Matthew Paul Thomas 2017-06-26 Pending
Unity Control Center development team 2017-04-04 Pending
Review via email: mp+321827@code.launchpad.net

This proposal has been superseded by a proposal from 2017-06-26.

Commit message

appearance: support multiple compiz setting profiles, and update lowgfx key accordingly

We only control the value of the "lowgfx" key here, and monitor changes.
The actual change of the profile is up to the unity components.

We monitor the current used profile by looking at org.compiz settings.

I've created a small utility class, GroupedGSettings, that allows to easily
manage multiple settings that share the same schema, but that have different paths.
It allows to set a default path and get value changes from that, while setting
parameters for every value.

So now, when you change any compiz parameter, it will apply to both 'unity' and
'unity-lowgfx' profiles. While we'll just monitor the current one for changes.

Description of the change

To post a comment you must log in.
Sebastien Bacher (seb128) wrote :

Looks good, did we get input from design on the layout though?

review: Approve
Marco Trevisan (Treviño) (3v1n0) wrote :

Nope... As I just fixed the work that was done previously in UI side, so not sure there was some interaction in that side.

Anyway,let me split this in the two parts though, so in case we can just backport the non-UI side.

Marco Trevisan (Treviño) (3v1n0) wrote :

For design, this is the look so far... http://i.imgur.com/A0LqSBe.png

Matthew Paul Thomas (mpt) wrote :

There are many language and layout problems here, but some of them are not new. Unfortunately the diff is too long for me to tell exactly which ones. Please provide a Before screenshot to compare with the After screenshot. Thanks!

Matthew Paul Thomas (mpt) wrote :

Thanks.

Unfortunately I can’t tell what “Appearance and other effects” refers to.

Last year another option was introduced in exactly the same place, labelled “Low graphics mode”. <http://www.omgubuntu.co.uk/2017/04/unity-low-gfx-mode-toggle> That was also a mysterious name, but I was told we had to use it because users were already familiar with it.

Is this the same option? What happened to the previous implementation?

Marco Trevisan (Treviño) (3v1n0) wrote :

It's the same option, but that option actually never landed because of other non-UI problems with that implementation.

I'm feel to change the wording to what you prefer, though.

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

appearance: remove unneded includes

12905. By Marco Trevisan (Treviño) on 2017-04-06

go back to use INCLUDES in Makefile.am it still works fine

12906. By Marco Trevisan (Treviño) on 2017-06-26

appearance.ui: revert changes, as we only care to low level changes for now

12907. By Marco Trevisan (Treviño) on 2017-06-26

Appearance: remove UI that controls the GFX mode option

12908. By Marco Trevisan (Treviño) on 2017-06-26

Appearance: add UI for controlling the unity gfx-mode

12909. By Marco Trevisan (Treviño) on 2017-06-27

appearance.ui: redesign the look of the visual effects section

mpt gave a good input on this.

12910. By Marco Trevisan (Treviño) on 2017-06-27

appearance: ensure we also hide the related separators when needed

12911. By Marco Trevisan (Treviño) on 2017-06-27

appearance: hide lowgfx parameters if gsetting or profiles aren't there

12912. By Marco Trevisan (Treviño) on 2017-06-27

appearance: remove unneeded nested boxes

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'panels/appearance/appearance.ui'
2--- panels/appearance/appearance.ui 2016-01-28 16:15:49 +0000
3+++ panels/appearance/appearance.ui 2017-06-26 16:25:30 +0000
4@@ -1,7 +1,10 @@
5 <?xml version="1.0" encoding="UTF-8"?>
6-<!-- Generated with glade 3.16.1 -->
7+<!-- Generated with glade 3.20.0 -->
8 <interface>
9 <requires lib="gtk+" version="3.0"/>
10+ <object class="GtkSizeGroup" id="sizegroup">
11+ <property name="mode">vertical</property>
12+ </object>
13 <object class="GtkListStore" id="sources-liststore">
14 <columns>
15 <!-- column-name source-name -->
16@@ -84,9 +87,9 @@
17 <object class="GtkLabel" id="label1">
18 <property name="visible">True</property>
19 <property name="can_focus">False</property>
20- <property name="xalign">0</property>
21 <property name="label" translatable="yes">&lt;b&gt;Background&lt;/b&gt;</property>
22 <property name="use_markup">True</property>
23+ <property name="xalign">0</property>
24 </object>
25 <packing>
26 <property name="expand">False</property>
27@@ -175,6 +178,19 @@
28 </packing>
29 </child>
30 <child>
31+ <object class="GtkLabel" id="slide-label">
32+ <property name="visible">True</property>
33+ <property name="can_focus">False</property>
34+ <property name="label" translatable="yes" comments="This refers to a slideshow background">Changes throughout the day</property>
35+ <property name="xalign">0</property>
36+ </object>
37+ <packing>
38+ <property name="expand">False</property>
39+ <property name="fill">True</property>
40+ <property name="position">1</property>
41+ </packing>
42+ </child>
43+ <child>
44 <object class="GtkLabel" id="strut">
45 <property name="visible">True</property>
46 <property name="can_focus">False</property>
47@@ -186,19 +202,6 @@
48 <property name="position">1</property>
49 </packing>
50 </child>
51- <child>
52- <object class="GtkLabel" id="slide-label">
53- <property name="visible">True</property>
54- <property name="can_focus">False</property>
55- <property name="xalign">0</property>
56- <property name="label" translatable="yes" comments="This refers to a slideshow background">Changes throughout the day</property>
57- </object>
58- <packing>
59- <property name="expand">False</property>
60- <property name="fill">True</property>
61- <property name="position">1</property>
62- </packing>
63- </child>
64 </object>
65 <packing>
66 <property name="expand">True</property>
67@@ -454,10 +457,10 @@
68 <object class="GtkLabel" id="theme-label">
69 <property name="visible">True</property>
70 <property name="can_focus">False</property>
71- <property name="xalign">0</property>
72 <property name="xpad">6</property>
73 <property name="label" translatable="yes">&lt;b&gt;Theme&lt;/b&gt;</property>
74 <property name="use_markup">True</property>
75+ <property name="xalign">0</property>
76 <accessibility>
77 <relation type="label-for" target="theme-selector"/>
78 </accessibility>
79@@ -521,10 +524,10 @@
80 <object class="GtkLabel" id="unity-iconsize-label">
81 <property name="visible">True</property>
82 <property name="can_focus">False</property>
83- <property name="xalign">0</property>
84 <property name="xpad">6</property>
85 <property name="label" translatable="yes">&lt;b&gt;Launcher icon size&lt;/b&gt;</property>
86 <property name="use_markup">True</property>
87+ <property name="xalign">0</property>
88 <accessibility>
89 <relation type="label-for" target="unity-iconsize-scale"/>
90 </accessibility>
91@@ -602,9 +605,9 @@
92 <object class="GtkLabel" id="label4">
93 <property name="visible">True</property>
94 <property name="can_focus">False</property>
95- <property name="xalign">0</property>
96 <property name="label" translatable="yes">&lt;b&gt;Auto-hide the Launcher&lt;/b&gt;</property>
97 <property name="use_markup">True</property>
98+ <property name="xalign">0</property>
99 <accessibility>
100 <relation type="label-for" target="unity_launcher_autohide"/>
101 </accessibility>
102@@ -619,9 +622,9 @@
103 <object class="GtkLabel" id="label2">
104 <property name="visible">True</property>
105 <property name="can_focus">False</property>
106- <property name="xalign">0</property>
107 <property name="label" translatable="yes">&lt;span size="small"&gt;The launcher will reveal when moving the pointer to the defined hot spot.&lt;/span&gt;</property>
108 <property name="use_markup">True</property>
109+ <property name="xalign">0</property>
110 </object>
111 <packing>
112 <property name="expand">False</property>
113@@ -640,8 +643,8 @@
114 <object class="GtkLabel" id="unity_reveal_label">
115 <property name="visible">True</property>
116 <property name="can_focus">False</property>
117- <property name="xalign">0</property>
118 <property name="label" translatable="yes">Reveal location:</property>
119+ <property name="xalign">0</property>
120 <accessibility>
121 <relation type="label-for" target="unity_reveal_spot_left"/>
122 <relation type="label-for" target="unity_reveal_spot_topleft"/>
123@@ -829,10 +832,10 @@
124 <child>
125 <object class="GtkLabel" id="unity-label-external-tool">
126 <property name="can_focus">False</property>
127- <property name="xalign">0</property>
128 <property name="xpad">12</property>
129 <property name="label" translatable="yes">Some settings have been overriden by an external program, press "Restore Default Behaviors" to reset the behavior and return control to this panel.</property>
130 <property name="wrap">True</property>
131+ <property name="xalign">0</property>
132 </object>
133 <packing>
134 <property name="expand">False</property>
135@@ -936,9 +939,9 @@
136 <object class="GtkLabel" id="label3">
137 <property name="visible">True</property>
138 <property name="can_focus">False</property>
139- <property name="xalign">0</property>
140 <property name="label" translatable="yes">&lt;b&gt;Show the menus for a window&lt;/b&gt;</property>
141 <property name="use_markup">True</property>
142+ <property name="xalign">0</property>
143 <accessibility>
144 <relation type="label-for" target="unity_global_menus"/>
145 <relation type="label-for" target="unity_local_menus"/>
146@@ -1012,12 +1015,12 @@
147 <object class="GtkLabel" id="label5">
148 <property name="visible">True</property>
149 <property name="can_focus">False</property>
150- <property name="xalign">0</property>
151 <property name="label" translatable="yes">&lt;b&gt;Menus visibility&lt;/b&gt;</property>
152 <property name="use_markup">True</property>
153+ <property name="xalign">0</property>
154 <accessibility>
155- <relation type="label-for" target="unity_global_menus"/>
156- <relation type="label-for" target="unity_local_menus"/>
157+ <relation type="label-for" target="unity_auto_hide_menus"/>
158+ <relation type="label-for" target="unity_always_show_menus"/>
159 </accessibility>
160 </object>
161 <packing>
162@@ -1106,6 +1109,120 @@
163 </packing>
164 </child>
165 <child>
166+ <object class="GtkBox" id="unity_gfx_mode_box">
167+ <property name="visible">True</property>
168+ <property name="can_focus">False</property>
169+ <property name="orientation">vertical</property>
170+ <child>
171+ <object class="GtkBox" id="box9">
172+ <property name="visible">True</property>
173+ <property name="can_focus">False</property>
174+ <property name="margin_left">10</property>
175+ <property name="margin_right">10</property>
176+ <property name="homogeneous">True</property>
177+ <child>
178+ <object class="GtkBox" id="unity_gfx_mode_selector_box">
179+ <property name="visible">True</property>
180+ <property name="can_focus">False</property>
181+ <property name="orientation">vertical</property>
182+ <child>
183+ <object class="GtkLabel" id="label_gfx_mode">
184+ <property name="visible">True</property>
185+ <property name="can_focus">False</property>
186+ <property name="label" translatable="yes">&lt;b&gt;Appearance and other effects&lt;/b&gt;</property>
187+ <property name="use_markup">True</property>
188+ <property name="xalign">0</property>
189+ <accessibility>
190+ <relation type="label-for" target="unity_gfx_mode_full_enable"/>
191+ <relation type="label-for" target="unity_gfx_mode_low_enable"/>
192+ </accessibility>
193+ </object>
194+ <packing>
195+ <property name="expand">False</property>
196+ <property name="fill">True</property>
197+ <property name="position">0</property>
198+ </packing>
199+ </child>
200+ <child>
201+ <object class="GtkBox" id="gfx_mode_selectors_box">
202+ <property name="visible">True</property>
203+ <property name="can_focus">False</property>
204+ <property name="margin_left">10</property>
205+ <property name="margin_top">9</property>
206+ <property name="orientation">vertical</property>
207+ <child>
208+ <object class="GtkRadioButton" id="unity_gfx_mode_full_enable">
209+ <property name="label" translatable="yes">Full effects</property>
210+ <property name="visible">True</property>
211+ <property name="can_focus">True</property>
212+ <property name="receives_default">False</property>
213+ <property name="xalign">0</property>
214+ <property name="draw_indicator">True</property>
215+ <property name="group">unity_gfx_mode_low_enable</property>
216+ </object>
217+ <packing>
218+ <property name="expand">False</property>
219+ <property name="fill">True</property>
220+ <property name="position">1</property>
221+ </packing>
222+ </child>
223+ <child>
224+ <object class="GtkRadioButton" id="unity_gfx_mode_low_enable">
225+ <property name="label" translatable="yes">Limited effects</property>
226+ <property name="visible">True</property>
227+ <property name="can_focus">True</property>
228+ <property name="receives_default">False</property>
229+ <property name="xalign">0</property>
230+ <property name="draw_indicator">True</property>
231+ <property name="group">unity_gfx_mode_full_enable</property>
232+ </object>
233+ <packing>
234+ <property name="expand">False</property>
235+ <property name="fill">True</property>
236+ <property name="position">2</property>
237+ </packing>
238+ </child>
239+ </object>
240+ <packing>
241+ <property name="expand">False</property>
242+ <property name="fill">True</property>
243+ <property name="position">1</property>
244+ </packing>
245+ </child>
246+ </object>
247+ <packing>
248+ <property name="expand">False</property>
249+ <property name="fill">True</property>
250+ <property name="position">0</property>
251+ </packing>
252+ </child>
253+ </object>
254+ <packing>
255+ <property name="expand">False</property>
256+ <property name="fill">True</property>
257+ <property name="padding">5</property>
258+ <property name="position">0</property>
259+ </packing>
260+ </child>
261+ <child>
262+ <object class="GtkSeparator" id="gfx_mode_separator">
263+ <property name="visible">True</property>
264+ <property name="can_focus">False</property>
265+ </object>
266+ <packing>
267+ <property name="expand">False</property>
268+ <property name="fill">True</property>
269+ <property name="position">1</property>
270+ </packing>
271+ </child>
272+ </object>
273+ <packing>
274+ <property name="expand">False</property>
275+ <property name="fill">True</property>
276+ <property name="position">5</property>
277+ </packing>
278+ </child>
279+ <child>
280 <object class="GtkBox" id="box5">
281 <property name="height_request">36</property>
282 <property name="visible">True</property>
283@@ -1133,7 +1250,7 @@
284 <packing>
285 <property name="expand">False</property>
286 <property name="fill">True</property>
287- <property name="position">7</property>
288+ <property name="position">8</property>
289 </packing>
290 </child>
291 </object>
292@@ -1155,13 +1272,4 @@
293 </object>
294 </child>
295 </object>
296- <object class="GtkSizeGroup" id="sizegroup">
297- <property name="mode">vertical</property>
298- <widgets>
299- <widget name="sources-combobox"/>
300- <widget name="heading-hbox"/>
301- <widget name="slide-label"/>
302- <widget name="strut"/>
303- </widgets>
304- </object>
305 </interface>
306
307=== modified file 'panels/appearance/cc-appearance-panel.c'
308--- panels/appearance/cc-appearance-panel.c 2016-07-05 14:26:25 +0000
309+++ panels/appearance/cc-appearance-panel.c 2017-06-26 16:25:30 +0000
310@@ -5,15 +5,15 @@
311 * it under the terms of the GNU General Public License as published by
312 * the Free Software Foundation, either version 2 of the License, or
313 * (at your option) any later version.
314- *
315+ *
316 * This program is distributed in the hope that it will be useful,
317 * but WITHOUT ANY WARRANTY; without even the implied warranty of
318 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
319 * GNU General Public License for more details.
320- *
321+ *
322 * You should have received a copy of the GNU General Public License
323 * along with this program. If not, see <http://www.gnu.org/licenses/>.
324- *
325+ *
326 * Author: Thomas Wood <thomas.wood@intel.com>
327 *
328 */
329@@ -55,6 +55,10 @@
330 #define APPEARANCE_PANEL_PRIVATE(o) \
331 (G_TYPE_INSTANCE_GET_PRIVATE ((o), CC_TYPE_APPEARANCE_PANEL, CcAppearancePanelPrivate))
332
333+typedef struct _GroupedGSettings GroupedGSettings;
334+typedef struct _GroupedGSettingsClass GroupedGSettingsClass;
335+typedef struct _GroupedGSettingsPrivate GroupedGSettingsPrivate;
336+
337 struct _CcAppearancePanelPrivate
338 {
339 GtkBuilder *builder;
340@@ -70,11 +74,15 @@
341 GSettings *settings;
342 GSettings *interface_settings;
343 GSettings *wm_theme_settings;
344- GSettings *unity_settings;
345- GSettings *compizcore_settings;
346 GSettings *unity_own_settings;
347 GSettings *unity_launcher_settings;
348
349+ GroupedGSettings *unity_compiz_gs;
350+ GroupedGSettings *compizcore_compiz_gs;
351+ GSettings *compiz_settings;
352+ GSettings *compizcore_settings;
353+ GSettings *unity_settings;
354+
355 GnomeDesktopThumbnailFactory *thumb_factory;
356
357 CcAppearanceItem *current_background;
358@@ -98,7 +106,13 @@
359 #endif
360 };
361
362-#define UNITY_GSETTINGS_SCHEMA "org.compiz.unityshell"
363+#define COMPIZ_GSETTINGS_SCHEMA "org.compiz"
364+#define COMPIZ_CURRENT_PROFILE_KEY "current-profile"
365+
366+#define UNITY_NORMAL_PROFILE "unity"
367+#define UNITY_LOWGFX_PROFILE "unity-lowgfx"
368+
369+#define UNITY_GSETTINGS_SCHEMA COMPIZ_GSETTINGS_SCHEMA ".unityshell"
370 #define UNITY_PROFILE_PATH "/org/compiz/profiles/%s/plugins/"
371 #define UNITY_GSETTINGS_PATH UNITY_PROFILE_PATH"unityshell/"
372 #define UNITY_ICONSIZE_KEY "icon-size"
373@@ -107,7 +121,7 @@
374 #define UNITY_LAUNCHERREVEAL_KEY "reveal-trigger"
375 #define CANONICAL_DESKTOP_INTERFACE "com.canonical.desktop.interface"
376
377-#define COMPIZCORE_GSETTINGS_SCHEMA "org.compiz.core"
378+#define COMPIZCORE_GSETTINGS_SCHEMA COMPIZ_GSETTINGS_SCHEMA ".core"
379 #define COMPIZCORE_GSETTINGS_PATH UNITY_PROFILE_PATH"core/"
380 #define COMPIZCORE_HSIZE_KEY "hsize"
381 #define COMPIZCORE_VSIZE_KEY "vsize"
382@@ -117,6 +131,7 @@
383 #define UNITY_FAVORITES_KEY "favorites"
384 #define UNITY_INTEGRATED_MENUS_KEY "integrated-menus"
385 #define UNITY_ALWAYS_SHOW_MENUS_KEY "always-show-menus"
386+#define UNITY_LOWGFX_KEY "lowgfx"
387 #define SHOW_DESKTOP_UNITY_FAVORITE_STR "unity://desktop-icon"
388
389 #define MIN_ICONSIZE 16.0
390@@ -211,12 +226,30 @@
391 priv->wm_theme_settings = NULL;
392 }
393
394+ if (priv->unity_compiz_gs)
395+ {
396+ g_object_unref (priv->unity_compiz_gs);
397+ priv->unity_compiz_gs = NULL;
398+ }
399+
400+ if (priv->compizcore_compiz_gs)
401+ {
402+ g_object_unref (priv->compizcore_compiz_gs);
403+ priv->compizcore_compiz_gs = NULL;
404+ }
405+
406 if (priv->unity_settings)
407 {
408 g_object_unref (priv->unity_settings);
409 priv->unity_settings = NULL;
410 }
411
412+ if (priv->compiz_settings)
413+ {
414+ g_object_unref (priv->compiz_settings);
415+ priv->compiz_settings = NULL;
416+ }
417+
418 if (priv->compizcore_settings)
419 {
420 g_object_unref (priv->compizcore_settings);
421@@ -291,6 +324,239 @@
422 {
423 }
424
425+/* Implementation of GroupedGSettings a class to manage multiple gsettings
426+ * who share schema but with different paths
427+ */
428+#define IS_GSETTINGS_GROUPED(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), \
429+ grouped_gsettings_get_type ()))
430+
431+GType grouped_gsettings_get_type (void) G_GNUC_CONST;
432+
433+struct _GroupedGSettings {
434+ GObject parent_instance;
435+ GroupedGSettingsPrivate *priv;
436+};
437+
438+struct _GroupedGSettingsClass {
439+ GObjectClass parent_class;
440+};
441+
442+struct _GroupedGSettingsPrivate
443+{
444+ GList *settings_list;
445+ GSettings *default_gs;
446+ GSettings **remote_gs;
447+};
448+
449+G_DEFINE_TYPE (GroupedGSettings, grouped_gsettings, G_TYPE_OBJECT)
450+
451+static void
452+grouped_gsettings_dispose (GObject *object)
453+{
454+ GroupedGSettings *self = (GroupedGSettings *) object;
455+
456+ if (self->priv->settings_list)
457+ {
458+ g_list_free_full (self->priv->settings_list, g_object_unref);
459+ self->priv->settings_list = NULL;
460+ }
461+
462+ if (G_OBJECT_CLASS (grouped_gsettings_parent_class))
463+ G_OBJECT_CLASS (grouped_gsettings_parent_class)->dispose (object);
464+}
465+
466+static void
467+grouped_gsettings_class_init (GroupedGSettingsClass *klass)
468+{
469+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
470+
471+ g_type_class_add_private (klass, sizeof (GroupedGSettingsPrivate));
472+
473+ gobject_class->dispose = grouped_gsettings_dispose;
474+
475+ g_signal_new ("changed", G_TYPE_FROM_CLASS (klass),
476+ G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0,
477+ NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE,
478+ 1, G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE);
479+}
480+
481+static void
482+grouped_gsettings_init (GroupedGSettings *self)
483+{
484+ self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, grouped_gsettings_get_type (),
485+ GroupedGSettingsPrivate);
486+}
487+
488+static void
489+on_default_settings_changed (GSettings *settings,
490+ gchar *key,
491+ GroupedGSettings *self)
492+{
493+ gchar *signal = g_strdup_printf ("changed::%s", key);
494+ g_signal_emit_by_name (self, signal, key);
495+ g_free (signal);
496+}
497+
498+static GSettings *
499+grouped_gsettings_peek_default (GroupedGSettings *self)
500+{
501+ g_return_val_if_fail (IS_GSETTINGS_GROUPED (self), NULL);
502+ return self->priv->default_gs;
503+}
504+
505+static void
506+grouped_gsettings_set_default_profile (GroupedGSettings *self,
507+ const gchar *profile)
508+{
509+ GList *l;
510+ GroupedGSettingsPrivate *priv;
511+
512+ g_return_if_fail (IS_GSETTINGS_GROUPED (self));
513+ g_return_if_fail (profile);
514+
515+ priv = self->priv;
516+
517+ for (l = priv->settings_list; l; l = l->next)
518+ {
519+ GSettings *settings;
520+ const gchar *settings_profile;
521+
522+ settings = l->data;
523+ settings_profile = g_object_get_data (G_OBJECT (settings), "profile");
524+
525+ if (g_strcmp0 (settings_profile, profile) == 0)
526+ {
527+ if (priv->default_gs == settings)
528+ {
529+ return;
530+ }
531+
532+ if (priv->default_gs)
533+ {
534+ g_signal_handlers_block_by_func (priv->default_gs,
535+ on_default_settings_changed, self);
536+ }
537+
538+ priv->default_gs = settings;
539+ g_signal_handlers_unblock_by_func (settings,
540+ on_default_settings_changed, self);
541+
542+ if (priv->remote_gs)
543+ {
544+ if (G_IS_SETTINGS (*priv->remote_gs))
545+ g_object_unref (*priv->remote_gs);
546+
547+ *priv->remote_gs = g_object_ref (settings);
548+ }
549+
550+ return;
551+ }
552+ }
553+}
554+
555+static void
556+grouped_gsettings_reset (GroupedGSettings *self, const gchar *key)
557+{
558+ g_return_if_fail (IS_GSETTINGS_GROUPED (self));
559+ g_list_foreach (self->priv->settings_list,
560+ (GFunc) g_settings_reset, (gpointer) key);
561+}
562+
563+static void
564+grouped_gsettings_set_value (GroupedGSettings *self,
565+ const gchar *key,
566+ GVariant *value)
567+{
568+ GList *l;
569+ g_return_if_fail (IS_GSETTINGS_GROUPED (self));
570+
571+ for (l = self->priv->settings_list; l; l = l->next)
572+ g_settings_set_value (G_SETTINGS (l->data), key, value);
573+}
574+
575+static GSettings *
576+grouped_gsettings_add (GroupedGSettings *self,
577+ GSettingsSchema *settings_schema,
578+ const gchar *settings_path,
579+ const gchar *profile,
580+ GSettings **remote_settings)
581+{
582+ GSettings *settings;
583+
584+ g_return_val_if_fail (IS_GSETTINGS_GROUPED (self), NULL);
585+
586+ settings = g_settings_new_full (settings_schema, /*backend*/ NULL, settings_path);
587+ self->priv->settings_list = g_list_prepend (self->priv->settings_list, settings);
588+ self->priv->remote_gs = remote_settings;
589+
590+ g_signal_connect (settings, "changed", G_CALLBACK (on_default_settings_changed), self);
591+ g_signal_handlers_block_by_func (settings, on_default_settings_changed, self);
592+
593+ if (!profile)
594+ {
595+ profile = settings_path;
596+ }
597+
598+ g_object_set_data_full (G_OBJECT (settings), "profile",
599+ (gpointer) g_strdup (profile), g_free);
600+
601+ if (!self->priv->default_gs)
602+ {
603+ grouped_gsettings_set_default_profile (self, profile);
604+ }
605+
606+ return settings;
607+}
608+
609+
610+static GSettings *
611+compiz_grouped_gsettings_add (GroupedGSettings *self,
612+ GSettingsSchema *settings_schema,
613+ const gchar *settings_base_path,
614+ const gchar *compiz_profile,
615+ GSettings **remote_settings)
616+{
617+ GSettings *settings;
618+ gchar *settings_path;
619+
620+ compiz_profile = compiz_profile ? compiz_profile : UNITY_NORMAL_PROFILE;
621+ settings_path = g_strdup_printf (settings_base_path, compiz_profile);
622+ settings = grouped_gsettings_add (self, settings_schema, settings_path,
623+ compiz_profile, remote_settings);
624+ g_free (settings_path);
625+
626+ return settings;
627+}
628+
629+GroupedGSettings *
630+compiz_grouped_gsettings_new (GSettingsSchema *settings_schema,
631+ GSettings *compiz_settings,
632+ const gchar *settings_base_path,
633+ GSettings **remote_settings)
634+{
635+ GroupedGSettings *ggs;
636+ GSettings *settings;
637+ gchar *compiz_profile;
638+
639+ g_return_val_if_fail (settings_base_path, NULL);
640+
641+ ggs = g_object_new (grouped_gsettings_get_type (), NULL);
642+ compiz_profile = g_settings_get_string (compiz_settings,
643+ COMPIZ_CURRENT_PROFILE_KEY);
644+
645+ compiz_grouped_gsettings_add (ggs, settings_schema, settings_base_path,
646+ UNITY_NORMAL_PROFILE, remote_settings);
647+ compiz_grouped_gsettings_add (ggs, settings_schema, settings_base_path,
648+ UNITY_LOWGFX_PROFILE, remote_settings);
649+
650+ grouped_gsettings_set_default_profile (ggs, compiz_profile);
651+ g_free (compiz_profile);
652+
653+ return ggs;
654+}
655+
656+/* GroupedGSettings definition end */
657+
658 static void
659 source_update_edit_box (CcAppearancePanelPrivate *priv,
660 gboolean initial)
661@@ -1387,11 +1653,11 @@
662 }
663
664 static void
665-ext_iconsize_changed_callback (GSettings* settings,
666- guint key,
667+ext_iconsize_changed_callback (GroupedGSettings* compiz_gs,
668+ gchar *key,
669 gpointer user_data)
670 {
671- iconsize_widget_refresh (GTK_ADJUSTMENT (user_data), settings);
672+ iconsize_widget_refresh (GTK_ADJUSTMENT (user_data), grouped_gsettings_peek_default (compiz_gs));
673 }
674
675 static gchar *
676@@ -1401,9 +1667,9 @@
677 }
678
679 static void
680-on_iconsize_changed (GtkAdjustment *adj, GSettings *unity_settings)
681+on_iconsize_changed (GtkAdjustment *adj, CcAppearancePanel *self)
682 {
683- g_settings_set_int (unity_settings, UNITY_ICONSIZE_KEY, (gint)gtk_adjustment_get_value (adj) * 2);
684+ grouped_gsettings_set_value (self->priv->unity_compiz_gs, UNITY_ICONSIZE_KEY, g_variant_new_int32 ((gint) gtk_adjustment_get_value (adj) * 2));
685 }
686
687 static void
688@@ -1459,8 +1725,8 @@
689 }
690
691 static void
692-ext_hidelauncher_changed_callback (GSettings* settings,
693- guint key,
694+ext_hidelauncher_changed_callback (GroupedGSettings* compiz_gs,
695+ gchar *key,
696 gpointer user_data)
697 {
698 hidelauncher_widget_refresh (CC_APPEARANCE_PANEL (user_data));
699@@ -1485,7 +1751,7 @@
700 }
701
702 /* 3d */
703- g_settings_set_int (self->priv->unity_settings, UNITY_LAUNCHERHIDE_KEY, value);
704+ grouped_gsettings_set_value (self->priv->unity_compiz_gs, UNITY_LAUNCHERHIDE_KEY, g_variant_new_int32 (value));
705 hidelauncher_set_sensitivity_reveal (self, (value != -1));
706 }
707
708@@ -1507,8 +1773,8 @@
709 }
710
711 static void
712-ext_reveallauncher_changed_callback (GSettings* settings,
713- guint key,
714+ext_reveallauncher_changed_callback (GroupedGSettings* compiz_gs,
715+ gchar *key,
716 gpointer user_data)
717 {
718 reveallauncher_widget_refresh (CC_APPEARANCE_PANEL (user_data));
719@@ -1526,7 +1792,7 @@
720 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (WID ("unity_reveal_spot_left"))))
721 reveal_spot = 0;
722
723- g_settings_set_int (priv->unity_settings, UNITY_LAUNCHERREVEAL_KEY, reveal_spot);
724+ grouped_gsettings_set_value (priv->unity_compiz_gs, UNITY_LAUNCHERREVEAL_KEY, g_variant_new_int32 (reveal_spot));
725 reveallauncher_widget_refresh (self);
726 }
727
728@@ -1538,11 +1804,11 @@
729 }
730
731 static void
732-ext_launchersensitivity_changed_callback (GSettings* settings,
733- guint key,
734+ext_launchersensitivity_changed_callback (GroupedGSettings* compiz_gs,
735+ gchar *key,
736 gpointer user_data)
737 {
738- launcher_sensitivity_widget_refresh (GTK_ADJUSTMENT (user_data), settings);
739+ launcher_sensitivity_widget_refresh (GTK_ADJUSTMENT (user_data), grouped_gsettings_peek_default (compiz_gs));
740 }
741
742 static void
743@@ -1552,7 +1818,7 @@
744 CcAppearancePanelPrivate *priv = self->priv;
745 gdouble value = gtk_adjustment_get_value (adj);
746
747- g_settings_set_double (priv->unity_settings, UNITY_LAUNCHERSENSITIVITY_KEY, value);
748+ grouped_gsettings_set_value (priv->unity_compiz_gs, UNITY_LAUNCHERSENSITIVITY_KEY, g_variant_new_double (value));
749 }
750
751 gboolean
752@@ -1577,12 +1843,12 @@
753 }
754
755 static void
756-ext_enableworkspaces_changed_callback (GSettings* settings,
757- guint key,
758+ext_enableworkspaces_changed_callback (GroupedGSettings* compiz_gs,
759+ gchar *key,
760 gpointer user_data)
761 {
762 g_idle_add((GSourceFunc) enable_workspaces_widget_refresh, user_data);
763-}
764+}
765
766 static void
767 on_enable_workspaces_changed (GtkToggleButton *button, gpointer user_data)
768@@ -1597,8 +1863,8 @@
769 hsize = vsize = 2;
770 }
771
772- g_settings_set_int (priv->compizcore_settings, COMPIZCORE_HSIZE_KEY, hsize);
773- g_settings_set_int (priv->compizcore_settings, COMPIZCORE_VSIZE_KEY, hsize);
774+ grouped_gsettings_set_value (priv->compizcore_compiz_gs, COMPIZCORE_HSIZE_KEY, g_variant_new_int32 (hsize));
775+ grouped_gsettings_set_value (priv->compizcore_compiz_gs, COMPIZCORE_VSIZE_KEY, g_variant_new_int32 (hsize));
776 }
777
778 static void
779@@ -1625,8 +1891,8 @@
780 }
781
782 static void
783-ext_enableshowdesktop_changed_callback (GSettings* settings,
784- guint key,
785+ext_enableshowdesktop_changed_callback (GroupedGSettings* compiz_gs,
786+ gchar *key,
787 gpointer user_data)
788 {
789 enable_showdesktop_widget_refresh (user_data);
790@@ -1691,19 +1957,15 @@
791 if (!self->priv->unity_own_settings)
792 return FALSE;
793
794- gchar** unity_keys;
795- gchar** key;
796-
797- unity_keys = g_settings_list_keys (self->priv->unity_own_settings);
798-
799- for (key = unity_keys; *key; ++key)
800- {
801- if (g_strcmp0 (*key, key_name) == 0)
802- return TRUE;
803- }
804-
805- g_strfreev (unity_keys);
806- return FALSE;
807+ GSettingsSchema *unity_schema;
808+ gboolean has_key;
809+
810+ g_object_get (self->priv->unity_own_settings,
811+ "settings-schema", &unity_schema, NULL);
812+ has_key = g_settings_schema_has_key (unity_schema, key_name);
813+ g_settings_schema_unref (unity_schema);
814+
815+ return has_key;
816 }
817
818 static void
819@@ -1728,8 +1990,8 @@
820 }
821
822 static void
823-ext_menulocation_changed_callback (GSettings* settings,
824- guint key,
825+ext_menulocation_changed_callback (GroupedGSettings* compiz_gs,
826+ gchar *key,
827 gpointer user_data)
828 {
829 menulocation_widget_refresh (CC_APPEARANCE_PANEL (user_data));
830@@ -1768,9 +2030,9 @@
831 }
832
833 static void
834-ext_menuvisibility_changed_callback (GSettings* settings,
835- guint key,
836- gpointer user_data)
837+ext_menuvisibility_changed_callback (GroupedGSettings* compiz_gs,
838+ gchar *key,
839+ gpointer user_data)
840 {
841 menuvisibility_widget_refresh (CC_APPEARANCE_PANEL (user_data));
842 }
843@@ -1786,6 +2048,85 @@
844 menuvisibility_widget_refresh (self);
845 }
846
847+static gboolean
848+is_compiz_profile_available (const gchar *profile)
849+{
850+ gboolean is_available;
851+ gchar *profile_path;
852+
853+ profile_path = g_strdup_printf ("%s/compiz-1/compizconfig/%s.ini",
854+ g_get_user_config_dir (), profile);
855+ is_available = g_file_test (profile_path, G_FILE_TEST_EXISTS);
856+ g_free (profile_path);
857+
858+ if (!is_available)
859+ {
860+ profile_path = g_strdup_printf ("/etc/compizconfig/%s.ini", profile);
861+ is_available = g_file_test (profile_path, G_FILE_TEST_EXISTS);
862+ g_free (profile_path);
863+ }
864+
865+ return is_available;
866+}
867+
868+static void
869+gfx_mode_widget_refresh (CcAppearancePanel *self)
870+{
871+ CcAppearancePanelPrivate *priv = self->priv;
872+ gboolean has_setting = unity_own_setting_exists (self, UNITY_LOWGFX_KEY);
873+
874+ gtk_widget_set_visible (WID ("unity_gfx_mode_box"), has_setting);
875+ gboolean enable_lowgfx = g_settings_get_boolean (priv->unity_own_settings, UNITY_LOWGFX_KEY);
876+
877+ if (enable_lowgfx == FALSE)
878+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("unity_gfx_mode_full_enable")), TRUE);
879+ else
880+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("unity_gfx_mode_low_enable")), TRUE);
881+}
882+
883+static void
884+on_gfx_mode_changed (GtkToggleButton *button,
885+ gpointer user_data)
886+{
887+ CcAppearancePanel *self = CC_APPEARANCE_PANEL (user_data);
888+ CcAppearancePanelPrivate *priv = self->priv;
889+
890+ gboolean low_enabled = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (WID ("unity_gfx_mode_low_enable")));
891+ g_settings_set_boolean (priv->unity_own_settings, UNITY_LOWGFX_KEY, low_enabled);
892+}
893+
894+static void
895+ext_lowgfx_changed_callback (GroupedGSettings* compiz_gs,
896+ gchar *key,
897+ gpointer user_data)
898+{
899+ gfx_mode_widget_refresh (CC_APPEARANCE_PANEL (user_data));
900+}
901+
902+static void
903+ext_compiz_profile_changed_callback (GSettings* compiz_settings,
904+ gchar *key,
905+ gpointer user_data)
906+{
907+ CcAppearancePanel *self = user_data;
908+ gchar *compiz_profile;
909+ gboolean low_enabled;
910+
911+ compiz_profile = g_settings_get_string (compiz_settings, COMPIZ_CURRENT_PROFILE_KEY);
912+
913+ if (g_strcmp0 (compiz_profile, UNITY_NORMAL_PROFILE) != 0 &&
914+ g_strcmp0 (compiz_profile, UNITY_LOWGFX_PROFILE) != 0)
915+ {
916+ g_free (compiz_profile);
917+ return;
918+ }
919+
920+ grouped_gsettings_set_default_profile (self->priv->unity_compiz_gs, compiz_profile);
921+ grouped_gsettings_set_default_profile (self->priv->compizcore_compiz_gs, compiz_profile);
922+
923+ g_free (compiz_profile);
924+}
925+
926 static void
927 on_restore_defaults_page2_clicked (GtkButton *button, gpointer user_data)
928 {
929@@ -1793,11 +2134,11 @@
930 CcAppearancePanelPrivate *priv = self->priv;
931
932 /* reset defaut for the profile and get the default */
933- g_settings_reset (priv->unity_settings, UNITY_LAUNCHERHIDE_KEY);
934- g_settings_reset (priv->unity_settings, UNITY_LAUNCHERSENSITIVITY_KEY);
935- g_settings_reset (priv->unity_settings, UNITY_LAUNCHERREVEAL_KEY);
936- g_settings_reset (priv->compizcore_settings, COMPIZCORE_HSIZE_KEY);
937- g_settings_reset (priv->compizcore_settings, COMPIZCORE_VSIZE_KEY);
938+ grouped_gsettings_reset (priv->unity_compiz_gs, UNITY_LAUNCHERHIDE_KEY);
939+ grouped_gsettings_reset (priv->unity_compiz_gs, UNITY_LAUNCHERSENSITIVITY_KEY);
940+ grouped_gsettings_reset (priv->unity_compiz_gs, UNITY_LAUNCHERREVEAL_KEY);
941+ grouped_gsettings_reset (priv->compizcore_compiz_gs, COMPIZCORE_HSIZE_KEY);
942+ grouped_gsettings_reset (priv->compizcore_compiz_gs, COMPIZCORE_VSIZE_KEY);
943
944 if (unity_own_setting_exists (self, UNITY_INTEGRATED_MENUS_KEY))
945 g_settings_reset (priv->unity_own_settings, UNITY_INTEGRATED_MENUS_KEY);
946@@ -1805,6 +2146,9 @@
947 if (unity_own_setting_exists (self, UNITY_ALWAYS_SHOW_MENUS_KEY))
948 g_settings_reset (priv->unity_own_settings, UNITY_ALWAYS_SHOW_MENUS_KEY);
949
950+ if (unity_own_setting_exists (self, UNITY_LOWGFX_KEY))
951+ g_settings_reset (priv->unity_own_settings, UNITY_LOWGFX_KEY);
952+
953 GtkToggleButton *showdesktop = GTK_TOGGLE_BUTTON (WID ("check_showdesktop_in_launcher"));
954 gtk_toggle_button_set_active(showdesktop, TRUE);
955 }
956@@ -1847,20 +2191,6 @@
957 }
958
959 /* </hacks> */
960-
961-static gchar *
962-compiz_profile_gsettings_path (const gchar *path)
963-{
964- const gchar *profile = "unity";
965-
966- if (g_strcmp0 (g_getenv ("COMPIZ_CONFIG_PROFILE"), "ubuntu-lowgfx") == 0)
967- {
968- profile = "unity-lowgfx";
969- }
970-
971- return g_strdup_printf (path, profile);
972-}
973-
974 static void
975 setup_unity_settings (CcAppearancePanel *self)
976 {
977@@ -1871,59 +2201,69 @@
978 GtkScale* launcher_sensitivity_scale;
979 GSettingsSchema *schema;
980 GSettingsSchemaSource* source;
981- gchar *settings_path;
982
983 source = g_settings_schema_source_get_default ();
984 schema = g_settings_schema_source_lookup (source, UNITY_OWN_GSETTINGS_SCHEMA, TRUE);
985 if (schema)
986 {
987- priv->unity_own_settings = g_settings_new (UNITY_OWN_GSETTINGS_SCHEMA);
988+ priv->unity_own_settings = g_settings_new_full (schema, /*backend*/ NULL, /*path*/ NULL);
989+ g_settings_schema_unref (schema);
990+ }
991+ schema = g_settings_schema_source_lookup (source, COMPIZ_GSETTINGS_SCHEMA, TRUE);
992+ if (schema)
993+ {
994+ priv->compiz_settings = g_settings_new_full (schema, /*backend*/ NULL, /*path*/ NULL);
995 g_settings_schema_unref (schema);
996 }
997 schema = g_settings_schema_source_lookup (source, UNITY_LAUNCHER_GSETTINGS_SCHEMA, TRUE);
998 if (schema)
999 {
1000- priv->unity_launcher_settings = g_settings_new (UNITY_LAUNCHER_GSETTINGS_SCHEMA);
1001+ priv->unity_launcher_settings = g_settings_new_full (schema, /*backend*/ NULL, /*path*/ NULL);
1002 g_settings_schema_unref (schema);
1003 }
1004 schema = g_settings_schema_source_lookup (source, UNITY_GSETTINGS_SCHEMA, TRUE);
1005 if (schema)
1006 {
1007- settings_path = compiz_profile_gsettings_path (UNITY_GSETTINGS_PATH);
1008- priv->unity_settings = g_settings_new_with_path (UNITY_GSETTINGS_SCHEMA, settings_path);
1009+ priv->unity_compiz_gs = compiz_grouped_gsettings_new (schema,
1010+ priv->compiz_settings,
1011+ UNITY_GSETTINGS_PATH,
1012+ &priv->unity_settings);
1013 g_settings_schema_unref (schema);
1014- g_free (settings_path);
1015 }
1016 schema = g_settings_schema_source_lookup (source, COMPIZCORE_GSETTINGS_SCHEMA, TRUE);
1017 if (schema)
1018 {
1019- settings_path = compiz_profile_gsettings_path (COMPIZCORE_GSETTINGS_PATH);
1020- priv->compizcore_settings = g_settings_new_with_path (COMPIZCORE_GSETTINGS_SCHEMA, settings_path);
1021+ priv->compizcore_compiz_gs = compiz_grouped_gsettings_new (schema,
1022+ priv->compiz_settings,
1023+ COMPIZCORE_GSETTINGS_PATH,
1024+ &priv->compizcore_settings);
1025 g_settings_schema_unref (schema);
1026- g_free (settings_path);
1027 }
1028
1029- if (!priv->unity_settings || !priv->compizcore_settings || !priv->unity_own_settings || !priv->unity_launcher_settings)
1030+ if (!priv->unity_compiz_gs || !priv->compizcore_compiz_gs || !priv->unity_own_settings || !priv->unity_launcher_settings)
1031 return;
1032
1033+ g_signal_connect (priv->compiz_settings, "changed::" COMPIZ_CURRENT_PROFILE_KEY,
1034+ G_CALLBACK (ext_compiz_profile_changed_callback), self);
1035+
1036 /* Icon size change - we halve the sizes so we can only get even values*/
1037 iconsize_adj = gtk_adjustment_new (DEFAULT_ICONSIZE / 2, MIN_ICONSIZE / 2, MAX_ICONSIZE / 2, 1, 4, 0);
1038 iconsize_scale = GTK_SCALE (WID ("unity-iconsize-scale"));
1039 gtk_range_set_adjustment (GTK_RANGE (iconsize_scale), iconsize_adj);
1040 gtk_scale_add_mark (iconsize_scale, DEFAULT_ICONSIZE / 2, GTK_POS_BOTTOM, NULL);
1041- g_signal_connect (priv->unity_settings, "changed::" UNITY_ICONSIZE_KEY,
1042+ g_signal_connect (priv->unity_compiz_gs, "changed::" UNITY_ICONSIZE_KEY,
1043 G_CALLBACK (ext_iconsize_changed_callback), iconsize_adj);
1044
1045 g_signal_connect (G_OBJECT (iconsize_scale), "format-value",
1046 G_CALLBACK (on_iconsize_format_value), NULL);
1047 g_signal_connect (iconsize_adj, "value_changed",
1048- G_CALLBACK (on_iconsize_changed), priv->unity_settings);
1049+ G_CALLBACK (on_iconsize_changed), self);
1050 g_signal_connect (G_OBJECT (iconsize_scale), "scroll-event",
1051 G_CALLBACK (on_scale_scroll_event), NULL);
1052 iconsize_widget_refresh (iconsize_adj, priv->unity_settings);
1053
1054 /* Reveal spot setting */
1055- g_signal_connect (priv->unity_settings, "changed::" UNITY_LAUNCHERREVEAL_KEY,
1056+ g_signal_connect (priv->unity_compiz_gs, "changed::" UNITY_LAUNCHERREVEAL_KEY,
1057 G_CALLBACK (ext_reveallauncher_changed_callback), self);
1058 g_signal_connect (WID ("unity_reveal_spot_topleft"), "toggled",
1059 G_CALLBACK (on_reveallauncher_changed), self);
1060@@ -1936,7 +2276,7 @@
1061 launcher_sensitivity_scale = GTK_SCALE (WID ("unity-launcher-sensitivity"));
1062 gtk_range_set_adjustment (GTK_RANGE (launcher_sensitivity_scale), launcher_sensitivity_adj);
1063 gtk_scale_add_mark (launcher_sensitivity_scale, 2, GTK_POS_BOTTOM, NULL);
1064- g_signal_connect (priv->unity_settings, "changed::" UNITY_LAUNCHERSENSITIVITY_KEY,
1065+ g_signal_connect (priv->unity_compiz_gs, "changed::" UNITY_LAUNCHERSENSITIVITY_KEY,
1066 G_CALLBACK (ext_launchersensitivity_changed_callback), launcher_sensitivity_adj);
1067 g_signal_connect (launcher_sensitivity_adj, "value_changed",
1068 G_CALLBACK (on_launchersensitivity_changed), self);
1069@@ -1945,16 +2285,16 @@
1070 launcher_sensitivity_widget_refresh (launcher_sensitivity_adj, priv->unity_settings);
1071
1072 /* Autohide launcher setting */
1073- g_signal_connect (priv->unity_settings, "changed::" UNITY_LAUNCHERHIDE_KEY,
1074+ g_signal_connect (priv->unity_compiz_gs, "changed::" UNITY_LAUNCHERHIDE_KEY,
1075 G_CALLBACK (ext_hidelauncher_changed_callback), self);
1076 g_signal_connect (WID ("unity_launcher_autohide"), "notify::active",
1077 G_CALLBACK (on_hidelauncher_changed), self);
1078 hidelauncher_widget_refresh (self);
1079
1080 /* Enabling workspaces */
1081- g_signal_connect (priv->compizcore_settings, "changed::" COMPIZCORE_HSIZE_KEY,
1082+ g_signal_connect (priv->compizcore_compiz_gs, "changed::" COMPIZCORE_HSIZE_KEY,
1083 G_CALLBACK (ext_enableworkspaces_changed_callback), self);
1084- g_signal_connect (priv->compizcore_settings, "changed::" COMPIZCORE_VSIZE_KEY,
1085+ g_signal_connect (priv->compizcore_compiz_gs, "changed::" COMPIZCORE_VSIZE_KEY,
1086 G_CALLBACK (ext_enableworkspaces_changed_callback), self);
1087 g_signal_connect (WID ("check_enable_workspaces"), "toggled",
1088 G_CALLBACK (on_enable_workspaces_changed), self);
1089@@ -1985,9 +2325,19 @@
1090 G_CALLBACK (on_menuvisibility_changed), self);
1091 menuvisibility_widget_refresh (self);
1092
1093+ /* Low gfx */
1094+ g_signal_connect (priv->unity_own_settings, "changed::" UNITY_LOWGFX_KEY,
1095+ G_CALLBACK (ext_lowgfx_changed_callback), self);
1096+ g_signal_connect (WID ("unity_gfx_mode_full_enable"), "toggled",
1097+ G_CALLBACK (on_gfx_mode_changed), self);
1098+ g_signal_connect (WID ("unity_gfx_mode_low_enable"), "toggled",
1099+ G_CALLBACK (on_gfx_mode_changed), self);
1100+ gfx_mode_widget_refresh (self);
1101+
1102 /* Restore defaut on second page */
1103 g_signal_connect (WID ("button-restore-unitybehavior"), "clicked",
1104 G_CALLBACK (on_restore_defaults_page2_clicked), self);
1105+
1106 }
1107
1108 static void

Subscribers

People subscribed via source and target branches