Merge lp:~muktupavels/compiz/button-layout into lp:compiz/0.9.13

Proposed by Alberts Muktupāvels
Status: Merged
Approved by: Dmitry Shachnev
Approved revision: 4203
Merged at revision: 4203
Proposed branch: lp:~muktupavels/compiz/button-layout
Merge into: lp:compiz/0.9.13
Diff against target: 108 lines (+0/-63)
1 file modified
gtk/window-decorator/gwd-settings-storage.c (+0/-63)
To merge this branch: bzr merge lp:~muktupavels/compiz/button-layout
Reviewer Review Type Date Requested Status
Dmitry Shachnev Approve
Review via email: mp+362829@code.launchpad.net

Commit message

Remove no longer needed button-layout workaround.

Description of the change

GNOME Flashback now is installing GSettings override file.

To post a comment you must log in.
Revision history for this message
Dmitry Shachnev (mitya57) :
review: Approve
lp:~muktupavels/compiz/button-layout updated
4203. By Alberts Muktupāvels

Remove no longer needed workaround.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'gtk/window-decorator/gwd-settings-storage.c'
--- gtk/window-decorator/gwd-settings-storage.c 2016-11-14 17:25:27 +0000
+++ gtk/window-decorator/gwd-settings-storage.c 2019-02-07 14:25:27 +0000
@@ -84,7 +84,6 @@
84 GSettings *metacity;84 GSettings *metacity;
85 GSettings *marco;85 GSettings *marco;
8686
87 gulong gtk_decoration_layout_id;
88 gulong gtk_theme_name_id;87 gulong gtk_theme_name_id;
89};88};
9089
@@ -101,43 +100,6 @@
101100
102G_DEFINE_TYPE (GWDSettingsStorage, gwd_settings_storage, G_TYPE_OBJECT)101G_DEFINE_TYPE (GWDSettingsStorage, gwd_settings_storage, G_TYPE_OBJECT)
103102
104static gchar *
105button_layout_from_gtk_decoration_layout (const gchar *gtk_decoration_layout)
106{
107 gchar **sides = g_strsplit (gtk_decoration_layout, ":", -1);
108 gchar *button_layout;
109 gint i;
110
111 for (i = 0; sides[i]; i++) {
112 gchar **buttons = g_strsplit (sides[i], ",", -1);
113 gint j;
114
115 for (j = 0; buttons[j]; j++) {
116 const gchar *button = NULL;
117
118 if (g_strcmp0 (buttons[j], "icon") == 0)
119 button = "menu";
120 else if (g_strcmp0 (buttons[j], "menu") == 0)
121 button = "appmenu";
122
123 if (button) {
124 g_free (buttons[j]);
125 buttons[j] = g_strdup (button);
126 }
127 }
128
129 g_free (sides[i]);
130 sides[i] = g_strjoinv (",", buttons);
131
132 g_strfreev (buttons);
133 }
134
135 button_layout = g_strjoinv (":", sides);
136 g_strfreev (sides);
137
138 return button_layout;
139}
140
141static inline GSettings *103static inline GSettings *
142get_settings_no_abort (const gchar *schema)104get_settings_no_abort (const gchar *schema)
143{105{
@@ -253,14 +215,6 @@
253215
254 if (storage->current_desktop == GWD_DESKTOP_MATE && storage->marco) {216 if (storage->current_desktop == GWD_DESKTOP_MATE && storage->marco) {
255 button_layout = g_settings_get_string (storage->marco, ORG_MATE_MARCO_GENERAL_BUTTON_LAYOUT);217 button_layout = g_settings_get_string (storage->marco, ORG_MATE_MARCO_GENERAL_BUTTON_LAYOUT);
256 } else if (storage->current_desktop == GWD_DESKTOP_GNOME_FLASHBACK) {
257 GtkSettings *settings = gtk_settings_get_default ();
258 gchar *gtk_decoration_layout = NULL;
259
260 g_object_get (settings, "gtk-decoration-layout", &gtk_decoration_layout, NULL);
261
262 button_layout = button_layout_from_gtk_decoration_layout (gtk_decoration_layout);
263 g_free (gtk_decoration_layout);
264 } else if (storage->desktop) {218 } else if (storage->desktop) {
265 button_layout = g_settings_get_string (storage->desktop, ORG_GNOME_DESKTOP_WM_PREFERENCES_BUTTON_LAYOUT);219 button_layout = g_settings_get_string (storage->desktop, ORG_GNOME_DESKTOP_WM_PREFERENCES_BUTTON_LAYOUT);
266 } else {220 } else {
@@ -401,14 +355,6 @@
401}355}
402356
403static void357static void
404gtk_decoration_layout_changed (GtkSettings *settings,
405 GParamSpec *pspec,
406 GWDSettingsStorage *storage)
407{
408 update_button_layout (storage);
409}
410
411static void
412gtk_theme_name_changed (GtkSettings *settings,358gtk_theme_name_changed (GtkSettings *settings,
413 GParamSpec *pspec,359 GParamSpec *pspec,
414 GWDSettingsStorage *storage)360 GWDSettingsStorage *storage)
@@ -479,11 +425,6 @@
479 g_clear_object (&storage->metacity);425 g_clear_object (&storage->metacity);
480 g_clear_object (&storage->marco);426 g_clear_object (&storage->marco);
481427
482 if (storage->gtk_decoration_layout_id > 0) {
483 g_signal_handler_disconnect (settings, storage->gtk_decoration_layout_id);
484 storage->gtk_decoration_layout_id = 0;
485 }
486
487 if (storage->gtk_theme_name_id > 0) {428 if (storage->gtk_theme_name_id > 0) {
488 g_signal_handler_disconnect (settings, storage->gtk_theme_name_id);429 g_signal_handler_disconnect (settings, storage->gtk_theme_name_id);
489 storage->gtk_theme_name_id = 0;430 storage->gtk_theme_name_id = 0;
@@ -560,10 +501,6 @@
560 storage->desktop = get_settings_no_abort (ORG_GNOME_DESKTOP_WM_PREFERENCES);501 storage->desktop = get_settings_no_abort (ORG_GNOME_DESKTOP_WM_PREFERENCES);
561 storage->metacity = get_settings_no_abort (ORG_GNOME_METACITY_THEME);502 storage->metacity = get_settings_no_abort (ORG_GNOME_METACITY_THEME);
562503
563 storage->gtk_decoration_layout_id =
564 g_signal_connect (gtk_settings_get_default (), "notify::gtk-decoration-layout",
565 G_CALLBACK (gtk_decoration_layout_changed), storage);
566
567 storage->gtk_theme_name_id =504 storage->gtk_theme_name_id =
568 g_signal_connect (gtk_settings_get_default (), "notify::gtk-theme-name",505 g_signal_connect (gtk_settings_get_default (), "notify::gtk-theme-name",
569 G_CALLBACK (gtk_theme_name_changed), storage);506 G_CALLBACK (gtk_theme_name_changed), storage);

Subscribers

People subscribed via source and target branches