diff options
author | Matthias Clasen <mclasen@redhat.com> | 2005-08-15 04:41:42 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2005-08-15 04:41:42 +0000 |
commit | cd62896f35deacbd8ae8762f5065e982b8da41b7 (patch) | |
tree | cb038e0ccb1b6ec1d968a7b5a19069b350ea4946 | |
parent | a1ba1599241cd739d509ad1ba304759c4777ef1a (diff) | |
download | gdk-pixbuf-cd62896f35deacbd8ae8762f5065e982b8da41b7.tar.gz |
Backported fix from 2.8:
2005-08-15 Matthias Clasen <mclasen@redhat.com>
Backported fix from 2.8:
* gtk/gtkicontheme.c: When changing the icon theme, defer
the resetting of rc styles to an idle, so that it does
not happen e.g during expose handling (which is problematic,
since some widgets, like the toolbar, are changing the
hierarchy in response to style changes). (#300539, reported
by many people, analyzed by Owen Taylor)
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 11 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 11 | ||||
-rw-r--r-- | gtk/gtkicontheme.c | 40 |
4 files changed, 68 insertions, 5 deletions
@@ -1,3 +1,14 @@ +2005-08-15 Matthias Clasen <mclasen@redhat.com> + + Backported fix from 2.8: + + * gtk/gtkicontheme.c: When changing the icon theme, defer + the resetting of rc styles to an idle, so that it does + not happen e.g during expose handling (which is problematic, + since some widgets, like the toolbar, are changing the + hierarchy in response to style changes). (#300539, reported + by many people, analyzed by Owen Taylor) + Fri Aug 5 16:54:19 2005 Søren Sandmann <sandmann@redhat.com> * gtk/gtkmenutoolbutton.c diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index e35fedc38..aeeab5fd8 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,14 @@ +2005-08-15 Matthias Clasen <mclasen@redhat.com> + + Backported fix from 2.8: + + * gtk/gtkicontheme.c: When changing the icon theme, defer + the resetting of rc styles to an idle, so that it does + not happen e.g during expose handling (which is problematic, + since some widgets, like the toolbar, are changing the + hierarchy in response to style changes). (#300539, reported + by many people, analyzed by Owen Taylor) + Fri Aug 5 16:54:19 2005 Søren Sandmann <sandmann@redhat.com> * gtk/gtkmenutoolbutton.c diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index e35fedc38..aeeab5fd8 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,14 @@ +2005-08-15 Matthias Clasen <mclasen@redhat.com> + + Backported fix from 2.8: + + * gtk/gtkicontheme.c: When changing the icon theme, defer + the resetting of rc styles to an idle, so that it does + not happen e.g during expose handling (which is problematic, + since some widgets, like the toolbar, are changing the + hierarchy in response to style changes). (#300539, reported + by many people, analyzed by Owen Taylor) + Fri Aug 5 16:54:19 2005 Søren Sandmann <sandmann@redhat.com> * gtk/gtkmenutoolbutton.c diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index 92c92b929..bc409d6b1 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -96,6 +96,8 @@ struct _GtkIconThemePrivate /* time when we last stat:ed for theme changes */ long last_stat_time; GList *dir_mtimes; + + gulong reset_styles_idle; }; struct _GtkIconInfo @@ -595,6 +597,30 @@ free_dir_mtime (IconThemeDirMtime *dir_mtime) } +static gboolean +reset_styles_idle (gpointer user_data) +{ + GtkIconTheme *icon_theme; + GtkIconThemePrivate *priv; + + GDK_THREADS_ENTER (); + + icon_theme = GTK_ICON_THEME (user_data); + priv = icon_theme->priv; + + if (priv->screen && priv->is_screen_singleton) + { + GtkSettings *settings = gtk_settings_get_for_screen (priv->screen); + gtk_rc_reset_styles (settings); + } + + priv->reset_styles_idle = 0; + + GDK_THREADS_LEAVE (); + + return FALSE; +} + static void do_theme_change (GtkIconTheme *icon_theme) { @@ -605,11 +631,9 @@ do_theme_change (GtkIconTheme *icon_theme) blow_themes (icon_theme); g_signal_emit (icon_theme, signal_changed, 0); - if (priv->screen && priv->is_screen_singleton) - { - GtkSettings *settings = gtk_settings_get_for_screen (priv->screen); - gtk_rc_reset_styles (settings); - } + if (!priv->reset_styles_idle) + priv->reset_styles_idle = + g_idle_add (reset_styles_idle, icon_theme); } static void @@ -643,6 +667,12 @@ gtk_icon_theme_finalize (GObject *object) icon_theme = GTK_ICON_THEME (object); priv = icon_theme->priv; + if (priv->reset_styles_idle) + { + g_source_remove (priv->reset_styles_idle); + priv->reset_styles_idle = 0; + } + unset_screen (icon_theme); g_free (priv->current_theme); |