mate.mate-control-center: 1.22.2 -> 1.24.0

Also the patches have been integrated upstream.
This commit is contained in:
José Romildo Malaquias 2020-02-12 14:51:20 -03:00
parent 6ba2a2c04f
commit 97fec8cfbb
3 changed files with 5 additions and 198 deletions

View file

@ -1,81 +0,0 @@
From 74fb65a2574c93a2b20a51875a5e336f727ff4bc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= <malaquias@gmail.com>
Date: Wed, 25 Dec 2019 18:48:38 -0300
Subject: [PATCH] Search system themes in system data dirs
---
capplets/common/gtkrc-utils.c | 20 ++++++++++++--------
capplets/common/mate-theme-info.c | 18 +++++++++++-------
2 files changed, 23 insertions(+), 15 deletions(-)
diff --git a/capplets/common/gtkrc-utils.c b/capplets/common/gtkrc-utils.c
index 011c8a1..27e01da 100644
--- a/capplets/common/gtkrc-utils.c
+++ b/capplets/common/gtkrc-utils.c
@@ -60,15 +60,19 @@ gchar* gtkrc_find_named(const gchar* name)
if (!path)
{
- gchar* theme_dir = gtk_rc_get_theme_dir();
- path = g_build_filename(theme_dir, name, subpath, NULL);
- g_free(theme_dir);
+ const gchar * const * dirs = g_get_system_data_dirs();
- if (!g_file_test(path, G_FILE_TEST_EXISTS))
- {
- g_free (path);
- path = NULL;
- }
+ if (dirs != NULL)
+ for (; !path && *dirs != NULL; ++dirs)
+ {
+ path = g_build_filename(*dirs, "themes", name, subpath, NULL);
+
+ if (!g_file_test(path, G_FILE_TEST_EXISTS))
+ {
+ g_free (path);
+ path = NULL;
+ }
+ }
}
return path;
diff --git a/capplets/common/mate-theme-info.c b/capplets/common/mate-theme-info.c
index 54ae3ae..a738f0b 100644
--- a/capplets/common/mate-theme-info.c
+++ b/capplets/common/mate-theme-info.c
@@ -1763,6 +1763,7 @@ mate_theme_color_scheme_equal (const gchar *s1, const gchar *s2)
void
mate_theme_init ()
{
+ const gchar * const * dirs;
GFile *top_theme_dir;
gchar *top_theme_dir_string;
static gboolean initted = FALSE;
@@ -1783,13 +1784,16 @@ mate_theme_init ()
theme_hash_by_uri = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
theme_hash_by_name = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
- /* Add all the toplevel theme dirs. */
- /* $datadir/themes */
- top_theme_dir_string = gtk_rc_get_theme_dir ();
- top_theme_dir = g_file_new_for_path (top_theme_dir_string);
- g_free (top_theme_dir_string);
- add_top_theme_dir_monitor (top_theme_dir, 1, NULL);
- g_object_unref (top_theme_dir);
+ /* Add all the toplevel theme dirs following the XDG Base Directory Specification */
+ dirs = g_get_system_data_dirs ();
+ if (dirs != NULL)
+ for (; *dirs != NULL; ++dirs) {
+ top_theme_dir_string = g_build_filename (*dirs, "themes", NULL);
+ top_theme_dir = g_file_new_for_path (top_theme_dir_string);
+ g_free (top_theme_dir_string);
+ add_top_theme_dir_monitor (top_theme_dir, 1, NULL);
+ g_object_unref (top_theme_dir);
+ }
/* ~/.themes */
top_theme_dir_string = g_build_filename (g_get_home_dir (), ".themes", NULL);
--
2.24.1

View file

@ -1,15 +1,15 @@
{ stdenv, fetchurl, pkgconfig, intltool, itstool, libxml2, dbus-glib,
libxklavier, libcanberra-gtk3, librsvg, libappindicator-gtk3,
desktop-file-utils, dconf, gtk3, mate, hicolor-icon-theme, wrapGAppsHook
desktop-file-utils, dconf, gtk3, polkit, mate, hicolor-icon-theme, wrapGAppsHook
}:
stdenv.mkDerivation rec {
pname = "mate-control-center";
version = "1.22.2";
version = "1.24.0";
src = fetchurl {
url = "https://pub.mate-desktop.org/releases/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "1ybdjibi6wgqn3587a66ckxp2qkvl4mcvv2smhflyxksl5djrjgh";
sha256 = "192plsh83m2qz7jgakns2yvhqbj53v7i54iwb0z26i2awy0j9rcd";
};
nativeBuildInputs = [
@ -29,6 +29,7 @@ stdenv.mkDerivation rec {
libappindicator-gtk3
gtk3
dconf
polkit
hicolor-icon-theme
mate.mate-desktop
mate.libmatekbd
@ -37,13 +38,6 @@ stdenv.mkDerivation rec {
mate.mate-settings-daemon
];
patches = [
# see https://github.com/mate-desktop/mate-control-center/pull/528
./0001-Search-system-themes-in-system-data-dirs.patch
# look up keyboard shortcuts in system data dirs
./mate-control-center.keybindings-dir.patch
];
configureFlags = [ "--disable-update-mimedb" ];
preFixup = ''
@ -57,7 +51,7 @@ stdenv.mkDerivation rec {
meta = with stdenv.lib; {
description = "Utilities to configure the MATE desktop";
homepage = https://github.com/mate-desktop/mate-control-center;
homepage = "https://github.com/mate-desktop/mate-control-center";
license = licenses.gpl2;
platforms = platforms.unix;
maintainers = [ maintainers.romildo ];

View file

@ -1,106 +0,0 @@
From faeb322b01d3856f3cf163470cc38f4e88a8527c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= <malaquias@gmail.com>
Date: Sun, 28 Apr 2019 21:45:39 -0300
Subject: [PATCH] Use system data dirs to locate key bindings
---
capplets/keybindings/Makefile.am | 3 +-
.../keybindings/mate-keybinding-properties.c | 58 ++++++++++++-------
2 files changed, 39 insertions(+), 22 deletions(-)
diff --git a/capplets/keybindings/Makefile.am b/capplets/keybindings/Makefile.am
index e5efb109..9501dd8f 100644
--- a/capplets/keybindings/Makefile.am
+++ b/capplets/keybindings/Makefile.am
@@ -33,8 +33,7 @@ AM_CPPFLAGS = \
$(MATECC_CAPPLETS_CFLAGS) \
-DMATELOCALEDIR="\"$(datadir)/locale\"" \
-DMATECC_DATA_DIR="\"$(pkgdatadir)\"" \
- -DMATECC_UI_DIR="\"$(uidir)\"" \
- -DMATECC_KEYBINDINGS_DIR="\"$(pkgdatadir)/keybindings\""
+ -DMATECC_UI_DIR="\"$(uidir)\""
CLEANFILES = \
$(MATECC_CAPPLETS_CLEANFILES) \
$(desktop_DATA) \
diff --git a/capplets/keybindings/mate-keybinding-properties.c b/capplets/keybindings/mate-keybinding-properties.c
index 4f257333..cf1891d2 100644
--- a/capplets/keybindings/mate-keybinding-properties.c
+++ b/capplets/keybindings/mate-keybinding-properties.c
@@ -1033,39 +1033,57 @@ static void
reload_key_entries (GtkBuilder *builder)
{
gchar **wm_keybindings;
- GDir *dir;
- const char *name;
GList *list, *l;
+ const gchar * const * data_dirs;
+ GHashTable *loaded_files;
+ guint i;
wm_keybindings = wm_common_get_current_keybindings();
clear_old_model (builder);
- dir = g_dir_open (MATECC_KEYBINDINGS_DIR, 0, NULL);
- if (!dir)
- return;
-
- list = NULL;
- for (name = g_dir_read_name (dir) ; name ; name = g_dir_read_name (dir))
+ loaded_files = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
+ data_dirs = g_get_system_data_dirs ();
+ for (i = 0; data_dirs[i] != NULL; i++)
{
- if (g_str_has_suffix (name, ".xml"))
+ g_autofree gchar *dir_path = NULL;
+ GDir *dir;
+ const gchar *name;
+
+ dir_path = g_build_filename (data_dirs[i], "mate-control-center", "keybindings", NULL);
+ g_debug ("Keybinding dir: %s", dir_path);
+
+ dir = g_dir_open (dir_path, 0, NULL);
+ if (!dir)
+ continue;
+
+ for (name = g_dir_read_name (dir) ; name ; name = g_dir_read_name (dir))
{
- list = g_list_insert_sorted (list, g_strdup (name),
- (GCompareFunc) g_ascii_strcasecmp);
- }
- }
- g_dir_close (dir);
+ if (g_str_has_suffix (name, ".xml") == FALSE)
+ continue;
+
+ if (g_hash_table_lookup (loaded_files, name) != NULL)
+ {
+ g_debug ("Not loading %s, it was already loaded from another directory", name);
+ continue;
+ }
+ g_hash_table_insert (loaded_files, g_strdup (name), g_strdup (dir_path));
+ }
+
+ g_dir_close (dir);
+ }
+ list = g_hash_table_get_keys (loaded_files);
+ list = g_list_sort(list, (GCompareFunc) g_str_equal);
for (l = list; l != NULL; l = l->next)
{
- gchar *path;
-
- path = g_build_filename (MATECC_KEYBINDINGS_DIR, l->data, NULL);
- append_keys_to_tree_from_file (builder, path, wm_keybindings);
- g_free (l->data);
- g_free (path);
+ g_autofree gchar *path = NULL;
+ path = g_build_filename (g_hash_table_lookup (loaded_files, l->data), l->data, NULL);
+ g_debug ("Keybinding file: %s", path);
+ append_keys_to_tree_from_file (builder, path, wm_keybindings);
}
g_list_free (list);
+ g_hash_table_destroy (loaded_files);
/* Load custom shortcuts _after_ system-provided ones,
* since some of the custom shortcuts may also be listed