]> git.eshelyaron.com Git - emacs.git/commitdiff
Rely solely on device scaling for fonts on PGTK
authorPo Lu <luangruo@yahoo.com>
Fri, 13 May 2022 11:18:17 +0000 (19:18 +0800)
committerPo Lu <luangruo@yahoo.com>
Fri, 13 May 2022 11:19:52 +0000 (19:19 +0800)
* src/pgtkterm.c (pgtk_get_text_scaling_factor): Delete
function.
(pgtk_term_init): Stop multiplying dpi by text scale.
(bug#55394)

src/pgtkterm.c

index 98567be18cd089dab40f13fed371e6a02f3e91f2..11ab40a0d390fe983923a8e10a084f5f7c3a553c 100644 (file)
@@ -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;