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.
devs/bu5hm4n/mixerfun
Carsten Haitzler 2 years ago
parent be1db92dbb
commit 5311687e6d
  1. 2
      meson.build
  2. 25
      src/bin/e_deskenv.c
  3. 4
      src/bin/e_scale.c

@ -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')

@ -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
}
}

@ -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
}

Loading…
Cancel
Save