tile-preview: Fix crash when falling back to default style
gtk_rc_get_style_by_paths() returns NULL if no matching style was found and the default style should be used. Actually use the default style in this case. https://bugzilla.gnome.org/show_bug.cgi?id=630003
This commit is contained in:
parent
c2f894963a
commit
beb65f011d
@ -111,6 +111,11 @@ on_preview_window_style_set (GtkWidget *widget,
|
|||||||
"GtkWindow.GtkIconView",
|
"GtkWindow.GtkIconView",
|
||||||
GTK_TYPE_ICON_VIEW);
|
GTK_TYPE_ICON_VIEW);
|
||||||
|
|
||||||
|
if (style != NULL)
|
||||||
|
g_object_ref (style);
|
||||||
|
else
|
||||||
|
style = gtk_style_new ();
|
||||||
|
|
||||||
gtk_style_get (style, GTK_TYPE_ICON_VIEW,
|
gtk_style_get (style, GTK_TYPE_ICON_VIEW,
|
||||||
"selection-box-color", &preview->preview_color,
|
"selection-box-color", &preview->preview_color,
|
||||||
"selection-box-alpha", &preview->preview_alpha,
|
"selection-box-alpha", &preview->preview_alpha,
|
||||||
@ -120,6 +125,8 @@ on_preview_window_style_set (GtkWidget *widget,
|
|||||||
GdkColor selection = style->base[GTK_STATE_SELECTED];
|
GdkColor selection = style->base[GTK_STATE_SELECTED];
|
||||||
preview->preview_color = gdk_color_copy (&selection);
|
preview->preview_color = gdk_color_copy (&selection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_object_unref (style);
|
||||||
}
|
}
|
||||||
|
|
||||||
MetaTilePreview *
|
MetaTilePreview *
|
||||||
|
Loading…
Reference in New Issue
Block a user