Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master Closes #3048 See merge request GNOME/gtk!2419
This commit is contained in:
@@ -296,6 +296,7 @@ _gtk_bookmarks_manager_new (GtkBookmarksChangedFunc changed_func, gpointer chang
|
||||
manager->bookmarks_monitor_changed_id = g_signal_connect (manager->bookmarks_monitor, "changed",
|
||||
G_CALLBACK (bookmarks_file_changed), manager);
|
||||
|
||||
|
||||
g_object_unref (bookmarks_file);
|
||||
|
||||
return manager;
|
||||
|
||||
@@ -108,10 +108,12 @@ gtk_text_util_create_drag_icon (GtkWidget *widget,
|
||||
GtkCssStyle *style;
|
||||
GtkSnapshot *snapshot;
|
||||
PangoContext *context;
|
||||
PangoLayout *layout;
|
||||
PangoLayout *layout;
|
||||
GdkPaintable *paintable;
|
||||
int layout_width;
|
||||
int layout_width;
|
||||
int layout_height;
|
||||
const GdkRGBA *color;
|
||||
GdkDisplay *display;
|
||||
|
||||
g_return_val_if_fail (widget != NULL, NULL);
|
||||
g_return_val_if_fail (text != NULL, NULL);
|
||||
@@ -133,6 +135,24 @@ gtk_text_util_create_drag_icon (GtkWidget *widget,
|
||||
style = gtk_css_node_get_style (gtk_widget_get_css_node (widget));
|
||||
color = gtk_css_color_value_get_rgba (style->core->color);
|
||||
|
||||
display = gtk_widget_get_display (widget);
|
||||
|
||||
if (!gdk_display_is_rgba (display) ||
|
||||
!gdk_display_is_composited (display))
|
||||
{
|
||||
GtkWidget *bg_widget;
|
||||
|
||||
if (GTK_IS_TEXT (widget))
|
||||
bg_widget = gtk_widget_get_parent (widget);
|
||||
else
|
||||
bg_widget = widget;
|
||||
pango_layout_get_size (layout, &layout_width, &layout_height);
|
||||
gtk_snapshot_render_background (snapshot,
|
||||
gtk_widget_get_style_context (bg_widget),
|
||||
0, 0, layout_width / PANGO_SCALE,
|
||||
layout_height / PANGO_SCALE);
|
||||
}
|
||||
|
||||
gtk_snapshot_append_layout (snapshot, layout, color);
|
||||
|
||||
paintable = gtk_snapshot_free_to_paintable (snapshot, NULL);
|
||||
@@ -194,6 +214,7 @@ gtk_text_util_create_rich_drag_icon (GtkWidget *widget,
|
||||
GtkTextAttributes *style;
|
||||
PangoContext *ltr_context, *rtl_context;
|
||||
GtkTextIter iter;
|
||||
GdkDisplay *display;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
|
||||
g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), NULL);
|
||||
@@ -251,6 +272,16 @@ gtk_text_util_create_rich_drag_icon (GtkWidget *widget,
|
||||
|
||||
snapshot = gtk_snapshot_new ();
|
||||
|
||||
display = gtk_widget_get_display (widget);
|
||||
|
||||
if (!gdk_display_is_rgba (display) ||
|
||||
!gdk_display_is_composited (display))
|
||||
{
|
||||
gtk_snapshot_render_background (snapshot,
|
||||
gtk_widget_get_style_context (widget),
|
||||
0, 0, layout_width, layout_height);
|
||||
}
|
||||
|
||||
gtk_text_layout_snapshot (layout, widget, snapshot, &(GdkRectangle) { 0, 0, layout_width, layout_height }, 1.0);
|
||||
|
||||
g_object_unref (layout);
|
||||
|
||||
@@ -510,7 +510,7 @@ theme_to_pos (GBinding *binding,
|
||||
for (i = 0, n = g_list_model_get_n_items (G_LIST_MODEL (names)); i < n; i++)
|
||||
{
|
||||
const char *name = gtk_string_list_get_string (names, i);
|
||||
if (strcmp (name, theme) == 0)
|
||||
if (g_strcmp0 (name, theme) == 0)
|
||||
{
|
||||
g_value_set_uint (to, i);
|
||||
return TRUE;
|
||||
|
||||
Reference in New Issue
Block a user