diff options
author | Christian Persch <chpe@src.gnome.org> | 2022-04-20 20:26:06 +0200 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2022-04-20 20:26:06 +0200 |
commit | 1398ac862fb10b3cb7cdfc8267be2df5d5f39eb5 (patch) | |
tree | 929acc472eecae484d8091d0aae688cbdd456693 /src | |
parent | 820bb7ba14f996d0f93172ccd37accb48be36054 (diff) | |
download | vte-1398ac862fb10b3cb7cdfc8267be2df5d5f39eb5.tar.gz |
fonts: gtk4: Create a new pango context
Don't use the widget's pango context, since it may contain weird font
description and attributes.
Fixes: https://gitlab.gnome.org/GNOME/vte/-/issues/2558
Diffstat (limited to 'src')
-rw-r--r-- | src/fonts-pangocairo.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/fonts-pangocairo.cc b/src/fonts-pangocairo.cc index 08da26db..8d0cb2a3 100644 --- a/src/fonts-pangocairo.cc +++ b/src/fonts-pangocairo.cc @@ -414,13 +414,11 @@ FontInfo::create_for_widget(GtkWidget* widget, auto screen = gtk_widget_get_screen(widget); return create_for_screen(screen, desc, nullptr); #elif VTE_GTK == 4 - auto context = gtk_widget_get_pango_context(widget); - auto display = gtk_widget_get_display(widget); auto settings = gtk_settings_get_for_display(display); auto fontconfig_timestamp = guint{}; g_object_get (settings, "gtk-fontconfig-timestamp", &fontconfig_timestamp, nullptr); - return create_for_context(vte::glib::make_ref(context), + return create_for_context(vte::glib::take_ref(gtk_widget_create_pango_context(widget)), desc, nullptr, fontconfig_timestamp); // FIXMEgtk4: this uses a per-widget context, while the gtk3 code uses a per-screen // one. That means there may be a lot less sharing and a lot more FontInfo's around? |