diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-03-19 19:56:15 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-03-19 19:56:15 +0100 |
commit | 1542c122b3672fe83e027411ad2445772e2d0ed3 (patch) | |
tree | e535bc621bd7ffa9d5ce89e0d495df5d1c4ab6fd /app/wlib/gtklib/font.c | |
parent | 773810e6583142d7d15263e6481c42aebed6d7f1 (diff) | |
parent | d1a8285f818eb7e5c3d6a05709ea21a808490b8c (diff) |
Update upstream source from tag 'upstream/5.1.0'
Update to upstream version '5.1.0'
with Debian dir 93ca74b8b4602fce4c9c7740e0cfdde25f086673
Diffstat (limited to 'app/wlib/gtklib/font.c')
-rw-r--r-- | app/wlib/gtklib/font.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/app/wlib/gtklib/font.c b/app/wlib/gtklib/font.c index c54f7de..68ba87b 100644 --- a/app/wlib/gtklib/font.c +++ b/app/wlib/gtklib/font.c @@ -86,7 +86,7 @@ static void fontSelectionDialogCallback(GtkFontSelectionDialog *fontSelectionDialog, gint response, gpointer data) { if (response == GTK_RESPONSE_APPLY || response == GTK_RESPONSE_OK) { - gchar *fontName; + gchar *fontName; fontName = gtk_font_selection_dialog_get_font_name(fontSelectionDialog); wPrefSetString("font", "name", fontName); @@ -215,12 +215,14 @@ PangoLayout *wlibFontCreatePangoLayout(GtkWidget *widget, pango_layout_set_font_description(layout, fontDescription); /* get layout measures */ pango_layout_get_pixel_size(layout, width_p, height_p); - context = gtk_widget_get_pango_context(widget); + context = gtk_widget_create_pango_context(widget); metrics = pango_context_get_metrics(context, fontDescription, pango_context_get_language(context)); *ascent_p = PANGO_PIXELS(pango_font_metrics_get_ascent(metrics)); *descent_p = PANGO_PIXELS(pango_font_metrics_get_descent(metrics)); pango_font_metrics_unref(metrics); + g_object_ref_sink(context); + g_object_unref(context); #if WLIB_FONT_DEBUG >= 3 fprintf(stderr, "font layout created:\n"); fprintf(stderr, " widget: %p\n", widget); @@ -242,7 +244,8 @@ PangoLayout *wlibFontCreatePangoLayout(GtkWidget *widget, void wlibFontDestroyPangoLayout(PangoLayout *layout) { - g_object_unref(G_OBJECT(layout)); + g_object_ref_sink(layout); + g_object_unref(layout); } /** @@ -286,7 +289,7 @@ void wSelectFont( gtk_window_set_title(GTK_WINDOW(fontSelectionDialog), title); if (curFont != NULL) { - gchar *fontName; + gchar *fontName; /* the curFont description contains the latest font info * which is depended on the current scale |