scaling - remove custon x application dpi and move to central scaling

now have a base dpi (75) which is multiplied by the scale factor and
then set in both xft.dpi and xsettings. also a checkbox to turn
setting of this on or off so e can be told to not touch these at all.
devs/bu5hm4n/mixerfun
Carsten Haitzler 2 years ago
parent d9cffad0f8
commit 4b87781bae
  1. 4
      data/config/default/e.src
  2. 2
      data/config/standard/e.src
  3. 2
      data/config/tiling/e.src
  4. 17
      src/bin/e_config.c
  5. 9
      src/bin/e_config.h
  6. 10
      src/bin/e_scale.c
  7. 20
      src/bin/e_xsettings.c
  8. 26
      src/modules/conf_theme/e_int_config_scale.c
  9. 30
      src/modules/conf_theme/e_int_config_xsettings.c

@ -180,11 +180,13 @@ group "E_Config" struct {
value "border_keyboard.resize.dy" uchar: 5;
value "dbus_desktop" int: 1;
value "scale.min" double: 0.8;
value "scale.max" double: 3.0;
value "scale.max" double: 5.0;
value "scale.factor" double: 1.0;
value "scale.base_dpi" int: 90;
value "scale.use_dpi" uchar: 1;
value "scale.use_custom" uchar: 0;
value "scale.xapp_base_dpi" int: 75;
value "scale.set_xapp_dpi" uchar: 1;
value "show_cursor" uchar: 1;
value "idle_cursor" uchar: 1;
value "default_system_menu" string: "";

@ -178,6 +178,8 @@ group "E_Config" struct {
value "scale.base_dpi" int: 90;
value "scale.use_dpi" uchar: 0;
value "scale.use_custom" uchar: 0;
value "scale.xapp_base_dpi" int: 75;
value "scale.set_xapp_dpi" uchar: 1;
value "show_cursor" uchar: 1;
value "idle_cursor" uchar: 1;
value "default_system_menu" string: "";

@ -178,6 +178,8 @@ group "E_Config" struct {
value "scale.base_dpi" int: 90;
value "scale.use_dpi" uchar: 0;
value "scale.use_custom" uchar: 0;
value "scale.xapp_base_dpi" int: 75;
value "scale.set_xapp_dpi" uchar: 1;
value "show_cursor" uchar: 1;
value "idle_cursor" uchar: 1;
value "default_system_menu" string: "";

@ -907,8 +907,10 @@ _e_config_edd_init(Eina_Bool old)
E_CONFIG_VAL(D, T, scale.max, DOUBLE);
E_CONFIG_VAL(D, T, scale.factor, DOUBLE);
E_CONFIG_VAL(D, T, scale.base_dpi, INT);
E_CONFIG_VAL(D, T, scale.xapp_base_dpi, INT);
E_CONFIG_VAL(D, T, scale.use_dpi, UCHAR);
E_CONFIG_VAL(D, T, scale.use_custom, UCHAR);
E_CONFIG_VAL(D, T, scale.set_xapp_dpi, UCHAR);
E_CONFIG_VAL(D, T, show_cursor, UCHAR);
E_CONFIG_VAL(D, T, idle_cursor, UCHAR);
@ -960,8 +962,6 @@ _e_config_edd_init(Eina_Bool old)
E_CONFIG_VAL(D, T, xsettings.xft_hinting, INT);
E_CONFIG_VAL(D, T, xsettings.xft_hint_style, STR);
E_CONFIG_VAL(D, T, xsettings.xft_rgba, STR);
E_CONFIG_VAL(D, T, xsettings.xft_dpi.enabled, UCHAR);
E_CONFIG_VAL(D, T, xsettings.xft_dpi.value, INT);
E_CONFIG_VAL(D, T, xsettings.net_theme_name, STR);
E_CONFIG_VAL(D, T, xsettings.net_icon_theme_name, STR);
E_CONFIG_VAL(D, T, xsettings.gtk_font_name, STR);
@ -1799,6 +1799,13 @@ e_config_load(void)
e_config->touch_palm_detect = 1;
e_config_save_queue();
}
CONFIG_VERSION_CHECK(34)
{
CONFIG_VERSION_UPDATE_INFO(34);
e_config->scale.xapp_base_dpi = 75;
e_config->scale.set_xapp_dpi = 1;
e_config_save_queue();
}
}
elm_config_profile_set(_e_config_profile);
if (!e_config->remember_internal_fm_windows)
@ -1912,6 +1919,12 @@ e_config_load(void)
E_CONFIG_LIMIT(e_config->dpms_suspend_timeout, 30, 5400);
E_CONFIG_LIMIT(e_config->dpms_off_timeout, 30, 5400);
E_CONFIG_LIMIT(e_config->scale.min, 0.1, 40.0);
E_CONFIG_LIMIT(e_config->scale.max, 0.1, 40.0);
E_CONFIG_LIMIT(e_config->scale.factor, 0.1, 40.0);
E_CONFIG_LIMIT(e_config->scale.base_dpi, 10, 4000);
E_CONFIG_LIMIT(e_config->scale.xapp_base_dpi, 10, 4000);
E_CONFIG_LIMIT(e_config->backlight.timer, 1, 3600);
E_CONFIG_LIMIT(e_config->screensaver_timeout, 6, 5400);

@ -47,7 +47,7 @@ typedef enum
/* increment this whenever a new set of config values are added but the users
* config doesn't need to be wiped - simply new values need to be put in
*/
#define E_CONFIG_FILE_GENERATION 33
#define E_CONFIG_FILE_GENERATION 34
#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH * 1000000) + E_CONFIG_FILE_GENERATION)
#define E_CONFIG_BINDINGS_VERSION 0 // DO NOT INCREMENT UNLESS YOU WANT TO WIPE ALL BINDINGS!!!!!
@ -326,8 +326,10 @@ struct _E_Config
double max; // GUI
double factor; // GUI
int base_dpi; // GUI
int xapp_base_dpi; // GUI
unsigned char use_dpi; // GUI
unsigned char use_custom; // GUI
unsigned char set_xapp_dpi; // GUI
} scale;
unsigned char show_cursor; // GUI
@ -396,11 +398,6 @@ struct _E_Config
unsigned char match_e17_icon_theme; // GUI
int xft_antialias;
int xft_hinting;
struct
{
unsigned char enabled;
int value;
} xft_dpi; // GUI
const char *xft_hint_style;
const char *xft_rgba;
const char *net_theme_name; // GUI

@ -93,8 +93,12 @@ 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();
if (e_config->scale.set_xapp_dpi)
{
snprintf(buf, sizeof(buf), "%i",
(int)((double)e_config->scale.xapp_base_dpi * e_scale));
ecore_x_resource_db_string_set("Xft.dpi", buf);
ecore_x_resource_db_flush();
}
#endif
}

@ -589,26 +589,12 @@ _e_xsettings_font_set(void)
static void
_e_xsettings_dpi_set(void)
{
if ((e_config->xsettings.xft_dpi.enabled) &&
(e_config->xsettings.xft_dpi.value > 0))
_e_xsettings_int_set(_setting_xft_dpi, e_config->xsettings.xft_dpi.value * 1024, EINA_TRUE);
else
_e_xsettings_int_set(_setting_xft_dpi, 75.0 * e_scale * 1024, EINA_TRUE);
}
#if 0
static void
_e_xsettings_xft_set(void)
{
if (e_config->scale.use_dpi)
if (e_config->scale.set_xapp_dpi)
_e_xsettings_int_set(_setting_xft_dpi,
e_config->scale.base_dpi, EINA_TRUE); // set
else
_e_xsettings_int_set(_setting_xft_dpi, 0, EINA_FALSE); // remove
(double)e_config->scale.xapp_base_dpi * e_scale * 1024.0,
EINA_TRUE);
}
#endif
static void
_e_xsettings_cursor_path_set(void)
{

@ -16,6 +16,7 @@ struct _E_Config_Dialog_Data
int use_dpi;
double min, max, factor;
int use_mode, base_dpi, use_custom;
int xapp_base_dpi, set_xapp_dpi;
struct
{
struct
@ -58,14 +59,12 @@ _scale_preview_sel_set(Evas_Object *ob, int sel)
cfdata->use_dpi = EINA_TRUE;
cfdata->use_mode = 1;
cfdata->use_custom = 0;
fprintf(stderr, "custom 0\n");
}
else
{
cfdata->use_dpi = EINA_FALSE;
cfdata->use_mode = 2;
cfdata->use_custom = 1;
fprintf(stderr, "custom 1\n");
}
EINA_LIST_FOREACH(cfdata->obs, l, ob2)
{
@ -206,6 +205,8 @@ _fill_data(E_Config_Dialog_Data *cfdata)
cfdata->max = e_config->scale.max;
cfdata->factor = e_config->scale.factor;
cfdata->base_dpi = e_config->scale.base_dpi;
cfdata->xapp_base_dpi = e_config->scale.xapp_base_dpi;
cfdata->set_xapp_dpi = e_config->scale.set_xapp_dpi;
}
static void
@ -270,6 +271,8 @@ _basic_apply(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata)
e_config->scale.max = cfdata->max;
e_config->scale.factor = cfdata->factor;
e_config->scale.base_dpi = cfdata->base_dpi;
e_config->scale.xapp_base_dpi = cfdata->xapp_base_dpi;
e_config->scale.set_xapp_dpi = cfdata->set_xapp_dpi;
fprintf(stderr, "dpi: %i, custom: %i, min: %3.3f, max: %3.3f, sc: %3.3f: base: %i\n",
e_config->scale.use_dpi, e_config->scale.use_custom,
@ -329,7 +332,7 @@ _adv_create(E_Config_Dialog *cfd EINA_UNUSED, Evas *evas, E_Config_Dialog_Data *
ow = e_widget_label_add(evas, buff);
cfdata->gui.adv.dpi_lbl = ow;
e_widget_list_object_append(o, ow, 1, 1, 0.5);
ow = e_widget_slider_add(evas, 1, 0, _("%1.0f DPI"), 30, 600, 1, 0,
ow = e_widget_slider_add(evas, 1, 0, _("%1.0f DPI"), 20, 1000, 1, 0,
NULL, &(cfdata->base_dpi), 100);
cfdata->gui.adv.dpi_slider = ow;
e_widget_list_object_append(o, ow, 1, 1, 0.5);
@ -340,6 +343,17 @@ _adv_create(E_Config_Dialog *cfd EINA_UNUSED, Evas *evas, E_Config_Dialog_Data *
0, &(cfdata->factor), NULL, 100);
cfdata->gui.adv.custom_slider = ow;
e_widget_list_object_append(o, ow, 1, 1, 0.5);
ow = e_widget_label_add(evas, _("Application Base DPI"));
e_widget_list_object_append(o, ow, 1, 1, 0.5);
ow = e_widget_slider_add(evas, 1, 0, _("%1.0f DPI"), 20, 1000, 1, 0,
NULL, &(cfdata->xapp_base_dpi), 100);
e_widget_list_object_append(o, ow, 1, 1, 0.5);
ow = e_widget_check_add(evas, _("Set Appliocation DPI"),
&(cfdata->set_xapp_dpi));
e_widget_list_object_append(o, ow, 1, 1, 0.5);
e_widget_toolbook_page_append(otb, NULL, _("Policy"), o,
1, 0, 1, 0, 0.5, 0.0);
@ -385,6 +399,8 @@ _adv_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
e_config->scale.max = cfdata->max;
e_config->scale.factor = cfdata->factor;
e_config->scale.base_dpi = cfdata->base_dpi;
e_config->scale.xapp_base_dpi = cfdata->xapp_base_dpi;
e_config->scale.set_xapp_dpi = cfdata->set_xapp_dpi;
e_win_no_reopen_set(cfd->dia->win, 1);
e_remember_update(e_win_client_get(cfd->dia->win));
@ -411,7 +427,9 @@ _adv_changed(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata)
(!EINA_DBL_EQ(cfdata->min, e_config->scale.min)) ||
(!EINA_DBL_EQ(cfdata->max, e_config->scale.max)) ||
(!EINA_DBL_EQ(cfdata->factor, e_config->scale.factor)) ||
(cfdata->base_dpi != e_config->scale.base_dpi);
(cfdata->base_dpi != e_config->scale.base_dpi) ||
(cfdata->xapp_base_dpi != e_config->scale.xapp_base_dpi) ||
(e_config->scale.set_xapp_dpi != cfdata->set_xapp_dpi);
}
static void

@ -14,8 +14,6 @@ struct _E_Config_Dialog_Data
Eina_List *widget_themes;
const char *widget_theme;
int enable_xsettings;
int enable_xsettings_dpi;
int xsettings_dpi;
Eina_List *icon_themes;
int match_e17_theme;
int match_e17_icon_theme;
@ -77,8 +75,6 @@ _create_data(E_Config_Dialog *cfd)
cfdata->match_e17_icon_theme = e_config->xsettings.match_e17_icon_theme;
cfdata->match_e17_theme = e_config->xsettings.match_e17_theme;
cfdata->enable_xsettings = e_config->xsettings.enabled;
cfdata->enable_xsettings_dpi = e_config->xsettings.xft_dpi.enabled;
cfdata->xsettings_dpi = e_config->xsettings.xft_dpi.value;
cfdata->icon_theme = eina_stringshare_add(e_config->icon_theme);
cfdata->icon_overrides = e_config->icon_theme_overrides;
//cfdata->enable_icon_theme = !!(e_config->icon_theme);
@ -135,12 +131,6 @@ _basic_check_changed(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfd
(strcmp(cfdata->icon_theme, e_config->icon_theme) != 0))
return 1;
if (cfdata->enable_xsettings_dpi != e_config->xsettings.xft_dpi.enabled)
return 1;
if (cfdata->xsettings_dpi != e_config->xsettings.xft_dpi.value)
return 1;
return 0;
}
@ -158,8 +148,6 @@ _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
// e_config->xsettings.match_e17_icon_theme = cfdata->match_e17_icon_theme;
e_config->xsettings.match_e17_theme = cfdata->match_e17_theme;
e_config->xsettings.enabled = cfdata->enable_xsettings;
e_config->xsettings.xft_dpi.enabled = cfdata->enable_xsettings_dpi;
e_config->xsettings.xft_dpi.value = cfdata->xsettings_dpi;
eina_stringshare_del(e_config->icon_theme);
if (cfdata->icon_overrides || cfdata->match_e17_icon_theme)
@ -468,7 +456,7 @@ _icon_theme_changed(void *data, Evas_Object *o EINA_UNUSED)
static Evas_Object *
_basic_create(E_Config_Dialog *cfd EINA_UNUSED, Evas *evas, E_Config_Dialog_Data *cfdata)
{
Evas_Object *otb, *ol, *ilist, *of, *ow, *oc, *os;
Evas_Object *otb, *ol, *ilist, *of, *ow, *oc;
struct _fill_icon_themes_data *d;
unsigned int i;
@ -502,22 +490,6 @@ _basic_create(E_Config_Dialog *cfd EINA_UNUSED, Evas *evas, E_Config_Dialog_Data
e_widget_check_widget_disable_on_unchecked_add(oc, ilist);
e_widget_check_widget_disable_on_unchecked_add(oc, ow);
of = e_widget_framelist_add(evas, "X Application Settings", 0);
ow = e_widget_check_add(evas, _("Enable Custom DPI"), &(cfdata->enable_xsettings_dpi));
e_widget_framelist_object_append(of, ow);
e_widget_check_widget_disable_on_unchecked_add(oc, ow);
os = e_widget_slider_add(evas, 1, 0, _("%1.0f dpi"), 50, 400, 1, 0,
NULL, &(cfdata->xsettings_dpi), 90);
e_widget_framelist_object_append(of, os);
e_widget_check_widget_disable_on_unchecked_add(ow, os);
e_widget_check_widget_disable_on_unchecked_add(oc, os);
e_widget_list_object_append(ol, of, 1, 0, 0.5);
#endif
e_widget_toolbook_page_append(otb, NULL, _("GTK Applications"), ol,

Loading…
Cancel
Save