forked from AuroraMiddleware/gtk
stylecontext: Don't use bg image in gtk_style_context_set_background()
Old code tried to use the "background-image" proeprty for setting the default image background. While this used to work in the early days of GTK3, today it is grossly misleading as the backgronud image may be resized, repositioned and semi-translucent which causes very weird artifacts when rendering. So we use the background-color only instead.
This commit is contained in:
parent
c13efbf8b0
commit
16677bb85a
@ -3264,22 +3264,12 @@ gtk_style_context_set_background (GtkStyleContext *context,
|
||||
GdkWindow *window)
|
||||
{
|
||||
GtkStateFlags state;
|
||||
cairo_pattern_t *pattern;
|
||||
GdkRGBA *color;
|
||||
|
||||
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
state = gtk_style_context_get_state (context);
|
||||
gtk_style_context_get (context, state,
|
||||
"background-image", &pattern,
|
||||
NULL);
|
||||
if (pattern)
|
||||
{
|
||||
gdk_window_set_background_pattern (window, pattern);
|
||||
cairo_pattern_destroy (pattern);
|
||||
return;
|
||||
}
|
||||
|
||||
gtk_style_context_get (context, state,
|
||||
"background-color", &color,
|
||||
|
Loading…
Reference in New Issue
Block a user