raster pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=5311687e6de790c4f426a582559b71f7399b4571

commit 5311687e6de790c4f426a582559b71f7399b4571
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Sun Nov 22 21:29:01 2020 +0000

    scaling - set Xft.dpi and merge properly with .Xdefaults
    
    this uses new efl functions so ... you need a git efl now (and
    eventually 1.26). this sets Xft.dpi to match the xsettings dpi etc.
    etc. ... so it all matches up.
---
 meson.build         |  2 +-
 src/bin/e_deskenv.c | 25 +++++++++++++++++--------
 src/bin/e_scale.c   |  4 +++-
 3 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/meson.build b/meson.build
index 7cfc277e3..e470579b3 100644
--- a/meson.build
+++ b/meson.build
@@ -39,7 +39,7 @@ e_version_rev = '.'.join([ver, git_version])
 release = 'dev-0.24.99'
 ####
 
-efl_version = '>= 1.24.1'
+efl_version = '>= 1.25.99'
 
 add_global_arguments('-DHAVE_CONFIG_H=1', language: 'c')
 dir_prefix    = get_option('prefix')
diff --git a/src/bin/e_deskenv.c b/src/bin/e_deskenv.c
index c8844714f..296574da8 100644
--- a/src/bin/e_deskenv.c
+++ b/src/bin/e_deskenv.c
@@ -4,23 +4,32 @@ EINTERN int
 e_deskenv_init(void)
 {
 #ifndef HAVE_WAYLAND_ONLY
-   char buf[PATH_MAX], buf2[PATH_MAX + sizeof("xrdb -load ")];
+   char buf[PATH_MAX], buf2[PATH_MAX + sizeof("xrdb -override ")];
 
    // run xdrb -load .Xdefaults & .Xresources
    // NOTE: one day we should replace this with an e based config + service
    if (e_config->deskenv.load_xrdb)
      {
+        Eina_Bool exists = EINA_FALSE;
+
         e_user_homedir_concat(buf, sizeof(buf), ".Xdefaults");
-        if (ecore_file_exists(buf))
+        exists = ecore_file_exists(buf);
+        if (!exists)
           {
-             snprintf(buf2, sizeof(buf2), "xrdb -load %s", buf);
-             ecore_exe_run(buf2, NULL);
+             e_user_homedir_concat(buf, sizeof(buf), ".Xresources");
+             exists = ecore_file_exists(buf);
           }
-        e_user_homedir_concat(buf, sizeof(buf), ".Xresources");
-        if (ecore_file_exists(buf))
+        if (exists)
           {
-             snprintf(buf2, sizeof(buf2), "xrdb -load %s", buf);
-             ecore_exe_run(buf2, NULL);
+#if 1
+             snprintf(buf2, sizeof(buf2), "xrdb -override %s", buf);
+             system(buf2);
+#else
+             // while this SHOULD work.. it ends up with mysterious problems
+             // inside xlib that i seem to not be able to trap easily...
+             ecore_x_rersource_load(buf);
+             ecore_x_resource_db_flush();
+#endif
           }
      }
 
diff --git a/src/bin/e_scale.c b/src/bin/e_scale.c
index 15f10f278..4b869cb1c 100644
--- a/src/bin/e_scale.c
+++ b/src/bin/e_scale.c
@@ -93,6 +93,8 @@ e_scale_update(void)
    e_pointers_size_set(e_config->cursor_size);
 #ifndef HAVE_WAYLAND_ONLY
    e_xsettings_config_update();
+   snprintf(buf, sizeof(buf), "%i", (int)(75.0 * e_scale));
+   ecore_x_resource_db_string_set("Xft.dpi", buf);
+   ecore_x_resource_db_flush();
 #endif
 }
-

-- 


Reply via email to