Bug 50226 - [GTK] Media icons are loaded again every time style-set signal is emitted on every widget
Summary: [GTK] Media icons are loaded again every time style-set signal is emitted on ...
Status: RESOLVED DUPLICATE of bug 50623
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-30 05:10 PST by Carlos Garcia Campos
Modified: 2010-12-07 04:43 PST (History)
2 users (show)

See Also:


Attachments
Patch that fixes the issue (3.97 KB, patch)
2010-11-30 05:15 PST, Carlos Garcia Campos
mrobinson: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2010-11-30 05:10:22 PST
We should change the colors when style-set is emitted, and load the icons only when the icon-theme changes.
Comment 1 Carlos Garcia Campos 2010-11-30 05:15:57 PST
Created attachment 75126 [details]
Patch that fixes the issue

This patch depends on the one attached to bug #50225
Comment 2 Martin Robinson 2010-12-01 06:55:46 PST
Comment on attachment 75126 [details]
Patch that fixes the issue

View in context: https://bugs.webkit.org/attachment.cgi?id=75126&action=review

Awesome patch. Just a couple issues outlined below.

> WebCore/platform/gtk/RenderThemeGtk.cpp:199
> +    g_signal_connect(gtk_icon_theme_get_default(), "changed", G_CALLBACK(gtkIconThemeChanged), const_cast<RenderThemeGtk*>(this));

Do you really need a const_cast here?

> WebCore/platform/gtk/RenderThemeGtk.cpp:794
> +    initMediaStyling(true);

This also reinitializes the media colors when the icon theme changes. Perhaps it would make sense to have two methods: initMediaColors and initMediaIcons.

> WebCore/platform/gtk/RenderThemeGtk.h:142
> +    virtual void initMediaColors(GtkStyle*);
>      virtual void initMediaStyling(bool force);

Why are these virtual? Does any subclass override them?
Comment 3 Carlos Garcia Campos 2010-12-01 07:08:54 PST
(In reply to comment #2)
> (From update of attachment 75126 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=75126&action=review
> 
> Awesome patch. Just a couple issues outlined below.
> 
> > WebCore/platform/gtk/RenderThemeGtk.cpp:199
> > +    g_signal_connect(gtk_icon_theme_get_default(), "changed", G_CALLBACK(gtkIconThemeChanged), const_cast<RenderThemeGtk*>(this));
> 
> Do you really need a const_cast here?

No idea, I copy-pasted from the "style-set" signal connection.

> > WebCore/platform/gtk/RenderThemeGtk.cpp:794
> > +    initMediaStyling(true);
> 
> This also reinitializes the media colors when the icon theme changes. Perhaps it would make sense to have two methods: initMediaColors and initMediaIcons.

Updating the colors is cheap, so I thought it didn't hurt.

> > WebCore/platform/gtk/RenderThemeGtk.h:142
> > +    virtual void initMediaColors(GtkStyle*);
> >      virtual void initMediaStyling(bool force);
> 
> Why are these virtual? Does any subclass override them?

No idea, initMediaStyling was already virtual and I added initMediaColors based on it.
Comment 4 Carlos Garcia Campos 2010-12-07 04:43:57 PST

*** This bug has been marked as a duplicate of bug 50623 ***