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

Proposed by Alberts Muktupāvels on 2019-02-06
Status: Merged
Approved by: Dmitry Shachnev on 2019-02-07
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 2019-02-06 Approve on 2019-02-07
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.
Dmitry Shachnev (mitya57) :
review: Approve
lp:~muktupavels/compiz/button-layout updated on 2019-02-07
4203. By Alberts Muktupāvels on 2019-02-07

Remove no longer needed workaround.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'gtk/window-decorator/gwd-settings-storage.c'
2--- gtk/window-decorator/gwd-settings-storage.c 2016-11-14 17:25:27 +0000
3+++ gtk/window-decorator/gwd-settings-storage.c 2019-02-07 14:25:27 +0000
4@@ -84,7 +84,6 @@
5 GSettings *metacity;
6 GSettings *marco;
7
8- gulong gtk_decoration_layout_id;
9 gulong gtk_theme_name_id;
10 };
11
12@@ -101,43 +100,6 @@
13
14 G_DEFINE_TYPE (GWDSettingsStorage, gwd_settings_storage, G_TYPE_OBJECT)
15
16-static gchar *
17-button_layout_from_gtk_decoration_layout (const gchar *gtk_decoration_layout)
18-{
19- gchar **sides = g_strsplit (gtk_decoration_layout, ":", -1);
20- gchar *button_layout;
21- gint i;
22-
23- for (i = 0; sides[i]; i++) {
24- gchar **buttons = g_strsplit (sides[i], ",", -1);
25- gint j;
26-
27- for (j = 0; buttons[j]; j++) {
28- const gchar *button = NULL;
29-
30- if (g_strcmp0 (buttons[j], "icon") == 0)
31- button = "menu";
32- else if (g_strcmp0 (buttons[j], "menu") == 0)
33- button = "appmenu";
34-
35- if (button) {
36- g_free (buttons[j]);
37- buttons[j] = g_strdup (button);
38- }
39- }
40-
41- g_free (sides[i]);
42- sides[i] = g_strjoinv (",", buttons);
43-
44- g_strfreev (buttons);
45- }
46-
47- button_layout = g_strjoinv (":", sides);
48- g_strfreev (sides);
49-
50- return button_layout;
51-}
52-
53 static inline GSettings *
54 get_settings_no_abort (const gchar *schema)
55 {
56@@ -253,14 +215,6 @@
57
58 if (storage->current_desktop == GWD_DESKTOP_MATE && storage->marco) {
59 button_layout = g_settings_get_string (storage->marco, ORG_MATE_MARCO_GENERAL_BUTTON_LAYOUT);
60- } else if (storage->current_desktop == GWD_DESKTOP_GNOME_FLASHBACK) {
61- GtkSettings *settings = gtk_settings_get_default ();
62- gchar *gtk_decoration_layout = NULL;
63-
64- g_object_get (settings, "gtk-decoration-layout", &gtk_decoration_layout, NULL);
65-
66- button_layout = button_layout_from_gtk_decoration_layout (gtk_decoration_layout);
67- g_free (gtk_decoration_layout);
68 } else if (storage->desktop) {
69 button_layout = g_settings_get_string (storage->desktop, ORG_GNOME_DESKTOP_WM_PREFERENCES_BUTTON_LAYOUT);
70 } else {
71@@ -401,14 +355,6 @@
72 }
73
74 static void
75-gtk_decoration_layout_changed (GtkSettings *settings,
76- GParamSpec *pspec,
77- GWDSettingsStorage *storage)
78-{
79- update_button_layout (storage);
80-}
81-
82-static void
83 gtk_theme_name_changed (GtkSettings *settings,
84 GParamSpec *pspec,
85 GWDSettingsStorage *storage)
86@@ -479,11 +425,6 @@
87 g_clear_object (&storage->metacity);
88 g_clear_object (&storage->marco);
89
90- if (storage->gtk_decoration_layout_id > 0) {
91- g_signal_handler_disconnect (settings, storage->gtk_decoration_layout_id);
92- storage->gtk_decoration_layout_id = 0;
93- }
94-
95 if (storage->gtk_theme_name_id > 0) {
96 g_signal_handler_disconnect (settings, storage->gtk_theme_name_id);
97 storage->gtk_theme_name_id = 0;
98@@ -560,10 +501,6 @@
99 storage->desktop = get_settings_no_abort (ORG_GNOME_DESKTOP_WM_PREFERENCES);
100 storage->metacity = get_settings_no_abort (ORG_GNOME_METACITY_THEME);
101
102- storage->gtk_decoration_layout_id =
103- g_signal_connect (gtk_settings_get_default (), "notify::gtk-decoration-layout",
104- G_CALLBACK (gtk_decoration_layout_changed), storage);
105-
106 storage->gtk_theme_name_id =
107 g_signal_connect (gtk_settings_get_default (), "notify::gtk-theme-name",
108 G_CALLBACK (gtk_theme_name_changed), storage);

Subscribers

People subscribed via source and target branches