[libhandy] main: Directly update themes on changes
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libhandy] main: Directly update themes on changes
- Date: Wed, 1 Jul 2020 13:56:30 +0000 (UTC)
commit 65ea0727eeaccd8013ecac839f14ce1ffe36fc41
Author: Adrien Plazas <kekun plazas laposte net>
Date: Wed Jul 1 14:43:16 2020 +0200
main: Directly update themes on changes
Fixes https://gitlab.gnome.org/GNOME/libhandy/-/issues/299
src/hdy-main.c | 29 ++---------------------------
1 file changed, 2 insertions(+), 27 deletions(-)
---
diff --git a/src/hdy-main.c b/src/hdy-main.c
index 7845b3d1..6c5df7b0 100644
--- a/src/hdy-main.c
+++ b/src/hdy-main.c
@@ -30,8 +30,6 @@ static gint hdy_initialized = FALSE;
#define HDY_THEMES_PATH "/sm/puri/handy/themes/"
-static guint queued_update;
-
static inline gboolean
hdy_resource_exists (const gchar *resource_path)
{
@@ -100,29 +98,6 @@ hdy_themes_update (GtkCssProvider *css_provider)
gtk_css_provider_load_from_resource (css_provider, resource_path);
}
-static gboolean
-hdy_themes_do_update (GtkCssProvider *css_provider)
-{
- g_assert (GTK_IS_CSS_PROVIDER (css_provider));
-
- queued_update = 0;
- hdy_themes_update (css_provider);
-
- return G_SOURCE_REMOVE;
-}
-
-static void
-hdy_themes_queue_update (GtkCssProvider *css_provider)
-{
- g_assert (GTK_IS_CSS_PROVIDER (css_provider));
-
- if (queued_update == 0)
- queued_update = g_idle_add_full (G_PRIORITY_LOW,
- (GSourceFunc) hdy_themes_do_update,
- css_provider,
- NULL);
-}
-
static void
load_fallback_style (void)
{
@@ -162,11 +137,11 @@ hdy_style_init (void)
settings = gtk_settings_get_default ();
g_signal_connect_swapped (settings,
"notify::gtk-theme-name",
- G_CALLBACK (hdy_themes_queue_update),
+ G_CALLBACK (hdy_themes_update),
css_provider);
g_signal_connect_swapped (settings,
"notify::gtk-application-prefer-dark-theme",
- G_CALLBACK (hdy_themes_queue_update),
+ G_CALLBACK (hdy_themes_update),
css_provider);
hdy_themes_update (css_provider);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]