From: Po Lu Date: Fri, 13 May 2022 11:18:17 +0000 (+0800) Subject: Rely solely on device scaling for fonts on PGTK X-Git-Tag: emacs-29.0.90~1910^2~737 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=77aba697683de8846c4a73b964e154182221ce67;p=emacs.git Rely solely on device scaling for fonts on PGTK * src/pgtkterm.c (pgtk_get_text_scaling_factor): Delete function. (pgtk_term_init): Stop multiplying dpi by text scale. (bug#55394) --- diff --git a/src/pgtkterm.c b/src/pgtkterm.c index 98567be18cd..11ab40a0d39 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c @@ -6281,40 +6281,6 @@ same_x_server (const char *name1, const char *name2) && (*name2 == '.' || *name2 == '\0')); } -#define GNOME_INTERFACE_SCHEMA "org.gnome.desktop.interface" - -static gdouble -pgtk_get_text_scaling_factor (void) -{ - GSettingsSchemaSource *schema_source; - GSettingsSchema *schema; - GSettings *settings; - double factor; - - schema_source = g_settings_schema_source_get_default (); - - if (schema_source != NULL) - { - schema = g_settings_schema_source_lookup (schema_source, - GNOME_INTERFACE_SCHEMA, - true); - - if (schema) - { - g_settings_schema_unref (schema); - - settings = g_settings_new (GNOME_INTERFACE_SCHEMA); - factor = g_settings_get_double (settings, - "text-scaling-factor"); - - g_object_unref (settings); - return factor; - } - } - return 1; -} - - /* Open a connection to X display DISPLAY_NAME, and return the structure that describes the open display. If we cannot contact the display, return null. */ @@ -6483,17 +6449,14 @@ pgtk_term_init (Lisp_Object display_name, char *resource_name) reset_mouse_highlight (&dpyinfo->mouse_highlight); - { - gscr = gdk_display_get_default_screen (dpyinfo->gdpy); - dpi = gdk_screen_get_resolution (gscr); + gscr = gdk_display_get_default_screen (dpyinfo->gdpy); + dpi = gdk_screen_get_resolution (gscr); - if (dpi < 0) - dpi = 96.0; + if (dpi < 0) + dpi = 96.0; - dpi *= pgtk_get_text_scaling_factor (); - dpyinfo->resx = dpi; - dpyinfo->resy = dpi; - } + dpyinfo->resx = dpi; + dpyinfo->resy = dpi; /* Set up scrolling increments. */ dpyinfo->scroll.x_per_char = 1;