Closed Bug 393976 Opened 16 years ago Closed 5 years ago

GTK2 Gecko should support theme change on fly


(Core :: Widget: Gtk, defect)

Not set





(Reporter: romaxa, Unassigned)



(Keywords: mobile)


(1 file, 1 obsolete file)

"style_set"_cb signal listening has been removed from nsWindow because it has multiply call...

In this case text in buttons never changed in current GTK2 environment...
I did not found any gtk-theme-name signals in current GTK...
Attachment #278570 - Flags: review?(bryner)
I thought we did support dynamic theme changes already. Did this regress?
Comment on attachment 278570 [details] [diff] [review]
This patch supposed to fix problem with theme chaning in GTK2....

bryner's not doing reviews anymore
Attachment #278570 - Flags: review?(bryner)
(In reply to comment #1)
> I thought we did support dynamic theme changes already.
You mean this "gtk-theme-name" strange signal, which not declared anywhere?

> Did this regress?
We are not using gtk_paint_text for drawing text, and after theme change we have to reread Text Font color and other colors from GTK.... but it does not happens because only style_set signal emitted...

I'm confused

<google cache>

<local xref of gtk+2.0 2.10.12>

 670 gtk_rc_context_get (GtkSettings *settings)
 685       g_object_get (settings,
 686                     "gtk-theme-name", &context->theme_name,
 687                     "gtk-key-theme-name", &context->key_theme_name,
 688                     "gtk-font-name", &context->font_name,
 689                     "color-hash", &context->color_hash,
 690                     NULL);
 692       g_signal_connect (settings,
 693                         "notify::gtk-theme-name",
 694                         G_CALLBACK (gtk_rc_settings_changed),
 695                         context);
Using Gecko/2008012504 Minefield/3.0b3pre.

When changing the theme, most (if not all) widgets are updated correctly.
Those include input boxes, checkboxes and drop-down arrows.

However, icons, such as those in the navigation toolbar, are not updated.
Blocks: 401821
Attachment #278570 - Attachment is obsolete: true
Attachment #347186 - Flags: review?(roc)
+    if (mContainer)
+        g_signal_handlers_disconnect_by_func(G_OBJECT(mContainer),
+                                             (gpointer)G_CALLBACK(theme_changed_cb),
+                                             this);

Why do we need this? The other callbacks registered on mContainer don't need to be disconnected.

What's the purpose of the timeout? What was the bug that removed the style-set listener?
>Why do we need this? The other callbacks registered on mContainer don't need to
> be disconnected.
Ok, seems we can remove that.

While theme is changing we are getting too many "style_set" signals, and we need to filter them to avoid performance problems...
see:, and
That might not be needed anymore: see bug 352096 which was fixed after that. Try removing your timer stuff and retest performance during theme changes.
Keywords: mobile
Comment on attachment 347186 [details] [diff] [review]
Updated to trunk.

minusing until comment #9 is addressed
Attachment #347186 - Flags: review?(roc) → review-
Closing GTK2 related bugs since we removed GTK2 support at the beginning of 2018 in bug 1278282. Probably best to open a new bug in the unlikely event that any of these are still relevant.
Closed: 5 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.