}
#endif /* defined(FEAT_CLIENTSERVER) */
+/*
+ * Handle changes to the "Xft/DPI" setting
+ */
+ static void
+gtk_settings_xft_dpi_changed_cb(GtkSettings *gtk_settings UNUSED,
+ GParamSpec *pspec UNUSED,
+ gpointer data UNUSED)
+{
+ // Create a new PangoContext for this screen, and initialize it
+ // with the current font if necessary.
+ if (gui.text_context != NULL)
+ g_object_unref(gui.text_context);
+
+ gui.text_context = gtk_widget_create_pango_context(gui.mainwin);
+ pango_context_set_base_dir(gui.text_context, PANGO_DIRECTION_LTR);
+
+ if (gui.norm_font != NULL)
+ {
+ // force default font
+ gui_mch_init_font(*p_guifont == NUL ? NULL : p_guifont, FALSE);
+ gui_set_shellsize(TRUE, FALSE, RESIZE_BOTH);
+ }
+}
#if GTK_CHECK_VERSION(3,0,0)
typedef gboolean timeout_cb_type;
/* Pretend we don't have input focus, we will get an event if we do. */
gui.in_focus = FALSE;
+ // Handle changes to the "Xft/DPI" setting.
+ {
+ GtkSettings *gtk_settings =
+ gtk_settings_get_for_screen(gdk_screen_get_default());
+
+ g_signal_connect(gtk_settings, "notify::gtk-xft-dpi",
+ G_CALLBACK(gtk_settings_xft_dpi_changed_cb), NULL);
+ }
+
return OK;
}