summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2022-01-17 22:23:07 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2022-01-17 22:23:07 +0000
commit29e1a12da323a25a7421ca50823b6c0953ee2411 (patch)
treecf914bed5840bf73090107055095917057890f91
parent58462390be5bba36f2c3f37b56e58605073e7f11 (diff)
downloadenlightenment-29e1a12da323a25a7421ca50823b6c0953ee2411.tar.gz
backlight - add option for ddc to work or not
just because libddcutil is installed doesnt mean someone always wants backlight on monitors controlled, so allow an option.
-rw-r--r--data/config/default/e.src3
-rw-r--r--data/config/standard/e.src3
-rw-r--r--data/config/tiling/e.src3
-rw-r--r--src/bin/e_backlight.c3
-rw-r--r--src/bin/e_config.c8
-rw-r--r--src/bin/e_config.h3
-rw-r--r--src/modules/conf_display/e_int_config_dpms.c9
7 files changed, 26 insertions, 6 deletions
diff --git a/data/config/default/e.src b/data/config/default/e.src
index 1487564c1c..73a362c77a 100644
--- a/data/config/default/e.src
+++ b/data/config/default/e.src
@@ -1,5 +1,5 @@
group "E_Config" struct {
- value "config_version" int: 1000033;
+ value "config_version" int: 1000035;
value "config_type" uint: 0; // this profile seems to just be super minimalist
value "desktop_default_name" string: "%i-%i";
value "desktop_default_window_profile" string: "";
@@ -207,6 +207,7 @@ group "E_Config" struct {
value "backlight.timer" double: 30.0;
value "backlight.battery_timer" double: 20.0;
value "backlight.idle_dim" uchar: 1;
+ value "backlight.ddc" uchar: 0;
value "device_desktop" int: 0;
value "device_auto_mount" int: 0;
value "device_auto_open" int: 0;
diff --git a/data/config/standard/e.src b/data/config/standard/e.src
index 26a23bf82d..ec8e7865eb 100644
--- a/data/config/standard/e.src
+++ b/data/config/standard/e.src
@@ -1,5 +1,5 @@
group "E_Config" struct {
- value "config_version" int: 1000033;
+ value "config_version" int: 1000035;
value "config_type" uint: 3;
value "desktop_default_name" string: "%i-%i";
value "desktop_default_window_profile" string: "standard";
@@ -200,6 +200,7 @@ group "E_Config" struct {
value "backlight.timer" double: 30.0;
value "backlight.battery_timer" double: 20.0;
value "backlight.idle_dim" uchar: 1;
+ value "backlight.ddc" uchar: 1;
value "deskenv.load_xrdb" uchar: 1;
value "deskenv.load_xmodmap" uchar: 1;
value "deskenv.load_gnome" uchar: 0;
diff --git a/data/config/tiling/e.src b/data/config/tiling/e.src
index 810e3e5ad3..87bf6c3470 100644
--- a/data/config/tiling/e.src
+++ b/data/config/tiling/e.src
@@ -1,5 +1,5 @@
group "E_Config" struct {
- value "config_version" int: 1000033;
+ value "config_version" int: 1000035;
value "config_type" uint: 3;
value "desktop_default_name" string: "%i-%i";
value "desktop_default_window_profile" string: "standard";
@@ -200,6 +200,7 @@ group "E_Config" struct {
value "backlight.timer" double: 30.0;
value "backlight.battery_timer" double: 20.0;
value "backlight.idle_dim" uchar: 1;
+ value "backlight.ddc" uchar: 1;
value "deskenv.load_xrdb" uchar: 1;
value "deskenv.load_xmodmap" uchar: 1;
value "deskenv.load_gnome" uchar: 0;
diff --git a/src/bin/e_backlight.c b/src/bin/e_backlight.c
index 0b0a86b85a..e788e04dd5 100644
--- a/src/bin/e_backlight.c
+++ b/src/bin/e_backlight.c
@@ -254,7 +254,8 @@ _backlight_devices_device_set(Backlight_Device *bd, double val)
// fprintf(stderr, "BL: ddc bklight %1.3f @ %1.3f\n", bd->val, ecore_time_get());
if (bd->ddc_max) fval = bd->val * (double)bd->ddc_max;
else fval = bd->val * 100.0;
- e_system_send("ddc-val-set", "%s %i %i", bd->dev + 4, 0x10, (int)(fval)); // backlight val in e_system_ddc.c
+ if (e_config->backlight.ddc)
+ e_system_send("ddc-val-set", "%s %i %i", bd->dev + 4, 0x10, (int)(fval)); // backlight val in e_system_ddc.c
ecore_event_add(E_EVENT_BACKLIGHT_CHANGE, NULL, NULL, NULL);
}
else
diff --git a/src/bin/e_config.c b/src/bin/e_config.c
index 9588e1d3cd..8c15101f32 100644
--- a/src/bin/e_config.c
+++ b/src/bin/e_config.c
@@ -942,6 +942,7 @@ _e_config_edd_init(Eina_Bool old)
E_CONFIG_VAL(D, T, backlight.battery_timer, DOUBLE);
E_CONFIG_VAL(D, T, backlight.sysdev, STR);
E_CONFIG_VAL(D, T, backlight.idle_dim, UCHAR);
+ E_CONFIG_VAL(D, T, backlight.ddc, UCHAR);
E_CONFIG_VAL(D, T, deskenv.load_xrdb, UCHAR);
E_CONFIG_VAL(D, T, deskenv.load_xmodmap, UCHAR);
@@ -1808,6 +1809,12 @@ e_config_load(void)
e_config->scale.set_xapp_dpi = 1;
e_config_save_queue();
}
+ CONFIG_VERSION_CHECK(35)
+ {
+ CONFIG_VERSION_UPDATE_INFO(35);
+ e_config->backlight.ddc = 1;
+ e_config_save_queue();
+ }
}
elm_config_profile_set(_e_config_profile);
if (!e_config->remember_internal_fm_windows)
@@ -1992,6 +1999,7 @@ e_config_load(void)
E_CONFIG_LIMIT(e_config->backlight.normal, 0.05, 1.0);
E_CONFIG_LIMIT(e_config->backlight.dim, 0.05, 1.0);
E_CONFIG_LIMIT(e_config->backlight.idle_dim, 0, 1);
+ E_CONFIG_LIMIT(e_config->backlight.ddc, 0, 1);
E_CONFIG_LIMIT(e_config->keyboard.repeat_delay, -1, 1000); // 1 second
E_CONFIG_LIMIT(e_config->keyboard.repeat_rate, -1, 1000); // 1 second
diff --git a/src/bin/e_config.h b/src/bin/e_config.h
index d1a3e4662d..1d287de1aa 100644
--- a/src/bin/e_config.h
+++ b/src/bin/e_config.h
@@ -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 34
+#define E_CONFIG_FILE_GENERATION 35
#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!!!!!
@@ -371,6 +371,7 @@ struct _E_Config
double battery_timer; // GUI
const char *sysdev; // GUI
unsigned char idle_dim; // GUI
+ unsigned char ddc; // GUI
} backlight;
struct
diff --git a/src/modules/conf_display/e_int_config_dpms.c b/src/modules/conf_display/e_int_config_dpms.c
index 5b4fa89558..f05d252382 100644
--- a/src/modules/conf_display/e_int_config_dpms.c
+++ b/src/modules/conf_display/e_int_config_dpms.c
@@ -17,6 +17,7 @@ struct _E_Config_Dialog_Data
Evas_Object *backlight_slider_fade;
int enable_idle_dim;
+ int ddc;
double backlight_normal;
double backlight_dim;
@@ -56,6 +57,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
cfdata->backlight_dim = e_config->backlight.dim * 100.0;
cfdata->backlight_transition = e_config->backlight.transition;
cfdata->enable_idle_dim = e_config->backlight.idle_dim;
+ cfdata->ddc = e_config->backlight.ddc;
cfdata->backlight_timeout = e_config->backlight.timer;
cfdata->backlight_battery_timeout = e_config->backlight.battery_timer;
}
@@ -87,6 +89,7 @@ _apply_data(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata)
e_config->backlight.timer = lround(cfdata->backlight_timeout);
e_config->backlight.battery_timer = lround(cfdata->backlight_battery_timeout);
e_config->backlight.idle_dim = cfdata->enable_idle_dim;
+ e_config->backlight.ddc = cfdata->ddc;
e_backlight_mode_set(NULL, E_BACKLIGHT_MODE_NORMAL);
e_backlight_level_set(NULL, e_config->backlight.normal, -1.0);
@@ -121,7 +124,8 @@ _advanced_check_changed(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *
(!EINA_DBL_EQ(e_config->backlight.transition, cfdata->backlight_transition)) ||
(!EINA_DBL_EQ(e_config->backlight.timer, cfdata->backlight_timeout)) ||
(!EINA_DBL_EQ(e_config->backlight.battery_timer, cfdata->backlight_battery_timeout)) ||
- (e_config->backlight.idle_dim != cfdata->enable_idle_dim);
+ (e_config->backlight.idle_dim != cfdata->enable_idle_dim) ||
+ (e_config->backlight.ddc != cfdata->ddc);
}
static int
@@ -152,6 +156,9 @@ _advanced_create_widgets(E_Config_Dialog *cfd EINA_UNUSED, Evas *evas, E_Config_
&(cfdata->backlight_dim), NULL, 100);
e_widget_list_object_append(o, ob, 1, 1, 0.5);
+ ob = e_widget_check_add(evas, _("Desktop Monitor Support (DDC)"), &(cfdata->ddc));
+ e_widget_list_object_append(o, ob, 1, 1, 0.5);
+
ob = e_widget_check_add(evas, _("Idle Fade Time"), &(cfdata->enable_idle_dim));
e_widget_list_object_append(o, ob, 1, 1, 0.5);
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f second(s)"), 5.0, 300.0, 1.0, 0,