diff options
author | Yaakov Selkowitz <yselkowi@redhat.com> | 2015-07-14 22:44:57 -0500 |
---|---|---|
committer | Yaakov Selkowitz <yselkowi@redhat.com> | 2015-07-14 22:44:57 -0500 |
commit | 2fbb7806519c9930a625fed2033c098299a55b9d (patch) | |
tree | a4417e8d4c165026b4dcefb863e7e43d67a70ba7 | |
parent | 9bfdc14e437c5a07262157d09dbd91a15e0efbaf (diff) | |
download | metacity-f21.tar.gz metacity-f21.tar.xz metacity-f21.zip |
Add upstream patch for GNOME bug 738562f21
-rw-r--r-- | metacity-3.14-bgo738562.patch | 167 | ||||
-rw-r--r-- | metacity.spec | 7 |
2 files changed, 173 insertions, 1 deletions
diff --git a/metacity-3.14-bgo738562.patch b/metacity-3.14-bgo738562.patch new file mode 100644 index 0000000..9209612 --- /dev/null +++ b/metacity-3.14-bgo738562.patch @@ -0,0 +1,167 @@ +From 5e694c3935c838bb2d1179d3cbb6da61f433a5c1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alberts=20Muktup=C4=81vels?= <alberts.muktupavels@gmail.com> +Date: Thu, 4 Jun 2015 17:04:51 +0300 +Subject: prefs: use button layout from GtkSettings + +This is needed to make sure that client-side and server-side +decorations have same button layout. + +GNOME Settings Daemon will update Gtk/DecorationLayout from +button-layout. At this point everything should be ok. + +But then it is possible to override Gtk/DecorationLayout from +xsettings plugin in GNOME Settings Daemon. At this point we can +end up with different button layouts between client-side and +server-side decorations. I can not think any reason why someone +would want different button layouts. + +diff --git a/src/core/prefs.c b/src/core/prefs.c +index 6278fdd..f404aff 100644 +--- a/src/core/prefs.c ++++ b/src/core/prefs.c +@@ -129,6 +129,7 @@ static gboolean button_layout_handler (GVariant*, gpointer*, gpointer); + static void init_bindings (void); + static void init_workspace_names (void); + ++static void update_button_layout (const gchar *string_value); + + typedef struct + { +@@ -759,6 +760,71 @@ queue_changed (MetaPreference pref) + changed_idle_handler, NULL, NULL); + } + ++static void ++gtk_decoration_layout_changed (GtkSettings *settings, ++ GParamSpec *pspec, ++ gpointer user_data) ++{ ++ gchar *layout; ++ gchar **sides; ++ gint i; ++ gint j; ++ ++ g_object_get (settings, "gtk-decoration-layout", &layout, NULL); ++ ++ sides = g_strsplit (layout, ":", -1); ++ g_free (layout); ++ ++ for (i = 0; sides[i]; i++) ++ { ++ gchar **buttons; ++ ++ buttons = g_strsplit (sides[i], ",", -1); ++ ++ for (j = 0; buttons[j]; j++) ++ { ++ const gchar *button; ++ ++ if (g_strcmp0 (buttons[j], "icon") == 0) ++ button = "menu"; ++ else if (g_strcmp0 (buttons[j], "menu") == 0) ++ button = "appmenu"; ++ else ++ button = NULL; ++ ++ if (button) ++ { ++ g_free (buttons[j]); ++ buttons[j] = g_strdup (button); ++ } ++ } ++ ++ g_free (sides[i]); ++ sides[i] = g_strjoinv (",", buttons); ++ ++ g_strfreev (buttons); ++ } ++ ++ layout = g_strjoinv (":", sides); ++ g_strfreev (sides); ++ ++ update_button_layout (layout); ++ g_free (layout); ++} ++ ++static void ++init_gtk_decoration_layout (void) ++{ ++ GtkSettings *settings; ++ ++ settings = gtk_settings_get_default (); ++ ++ g_signal_connect (settings, "notify::gtk-decoration-layout", ++ G_CALLBACK (gtk_decoration_layout_changed), NULL); ++ ++ gtk_decoration_layout_changed (settings, NULL, NULL); ++} ++ + /****************************************************************************/ + /* Initialisation. */ + /****************************************************************************/ +@@ -799,6 +865,8 @@ meta_prefs_init (void) + + init_bindings (); + init_workspace_names (); ++ ++ init_gtk_decoration_layout (); + } + + /****************************************************************************/ +@@ -1118,13 +1186,10 @@ button_opposite_function (MetaButtonFunction ofwhat) + } + } + +-static gboolean +-button_layout_handler (GVariant *value, +- gpointer *result, +- gpointer data) ++static void ++update_button_layout (const gchar *string_value) + { + MetaButtonLayout new_layout; +- const gchar *string_value; + char **sides = NULL; + int i; + +@@ -1132,12 +1197,7 @@ button_layout_handler (GVariant *value, + * compat with future versions + */ + +- *result = NULL; /* ignored */ +- string_value = g_variant_get_string (value, NULL); +- +- if (string_value) +- sides = g_strsplit (string_value, ":", 2); +- ++ sides = g_strsplit (string_value, ":", 2); + i = 0; + + if (sides != NULL && sides[0] != NULL) +@@ -1303,7 +1363,23 @@ button_layout_handler (GVariant *value, + button_layout = new_layout; + emit_changed (META_PREF_BUTTON_LAYOUT); + } ++} + ++static gboolean ++button_layout_handler (GVariant *value, ++ gpointer *result, ++ gpointer data) ++{ ++#if 0 ++ const gchar *string_value; ++ ++ string_value = g_variant_get_string (value, NULL); ++ ++ if (string_value) ++ update_button_layout (string_value); ++#endif ++ ++ *result = NULL; /* ignored */ + return TRUE; + } + +-- +cgit v0.10.2 + diff --git a/metacity.spec b/metacity.spec index c371667..44a8acf 100644 --- a/metacity.spec +++ b/metacity.spec @@ -1,7 +1,7 @@ Summary: Unobtrusive window manager Name: metacity Version: 3.14.3 -Release: 3%{?dist} +Release: 4%{?dist} URL: http://download.gnome.org/sources/metacity/ Source0: http://download.gnome.org/sources/metacity/3.14/metacity-%{version}.tar.xz # http://bugzilla.gnome.org/show_bug.cgi?id=558723 @@ -13,6 +13,7 @@ Patch4: stop-spamming-xsession-errors.patch Patch24: metacity-2.28-empty-keybindings.patch Patch100: metacity-3.14-bgo605678.patch +Patch101: metacity-3.14-bgo738562.patch License: GPLv2+ Group: User Interface/Desktops @@ -71,6 +72,7 @@ API. This package exists purely for technical reasons. %patch24 -p1 -b .empty-keybindings %patch100 -p1 +%patch101 -p1 # force regeneration rm -f src/org.gnome.metacity.gschema.valid @@ -148,6 +150,9 @@ fi %{_mandir}/man1/metacity-window-demo.1.gz %changelog +* Sun Jul 12 2015 Yaakov Selkowitz <yselkowi@redhat.com> - 3.14.3-4 +- Add upstream patch for GNOME bug 738562 + * Fri Feb 27 2015 Yaakov Selkowitz <yselkowi@redhat.com> - 3.14.3-3 - rebuilt |