forked from enlightenment/enlightenment
Added option for doing desklock, blanking or dimming even when showing fullscreen windows.
SVN revision: 82358
This commit is contained in:
parent
796317970a
commit
4034a15345
|
@ -1,4 +1,5 @@
|
|||
2013-01-07 Brian Miculcy
|
||||
* Added option for doing desklock, blanking or dimming even when showing fullscreen windows.
|
||||
* No backlight dimming when in presentation mode.
|
||||
* Backlight fade time only applies to dimming - undimming is fixed 0.5 .
|
||||
|
||||
|
|
|
@ -854,6 +854,7 @@ e_config_init(void)
|
|||
|
||||
E_CONFIG_VAL(D, T, desk_auto_switch, INT);
|
||||
|
||||
E_CONFIG_VAL(D, T, screen_actions_fullscreen_windows_ignore, UCHAR);
|
||||
E_CONFIG_VAL(D, T, screen_limits, INT);
|
||||
|
||||
E_CONFIG_VAL(D, T, thumb_nice, INT);
|
||||
|
@ -1188,6 +1189,7 @@ e_config_load(void)
|
|||
E_CONFIG_LIMIT(e_config->remember_internal_fm_windows, 0, 1);
|
||||
E_CONFIG_LIMIT(e_config->desk_auto_switch, 0, 1);
|
||||
|
||||
E_CONFIG_LIMIT(e_config->screen_actions_fullscreen_windows_ignore, 0, 1);
|
||||
E_CONFIG_LIMIT(e_config->screen_limits, 0, 2);
|
||||
|
||||
E_CONFIG_LIMIT(e_config->dpms_enable, 0, 1);
|
||||
|
|
|
@ -259,6 +259,7 @@ struct _E_Config
|
|||
Eina_List *mime_icons; // GUI
|
||||
int desk_auto_switch; // GUI;
|
||||
|
||||
int screen_actions_fullscreen_windows_ignore;
|
||||
int screen_limits;
|
||||
|
||||
int thumb_nice;
|
||||
|
|
|
@ -200,7 +200,9 @@ _user_wallpaper_get(E_Zone *zone)
|
|||
EAPI int
|
||||
e_desklock_show_autolocked(void)
|
||||
{
|
||||
if (e_util_fullscreen_current_any()) return 0;
|
||||
if ((e_config->screen_actions_fullscreen_windows_ignore) ||
|
||||
((!e_config->screen_actions_fullscreen_windows_ignore) && (!e_util_fullscreen_any())))
|
||||
return 0;
|
||||
if (_e_desklock_autolock_time < 1.0)
|
||||
_e_desklock_autolock_time = ecore_loop_time_get();
|
||||
return e_desklock_show(EINA_FALSE);
|
||||
|
@ -1190,7 +1192,8 @@ static Eina_Bool
|
|||
_e_desklock_cb_idle_poller(void *data __UNUSED__)
|
||||
{
|
||||
if ((e_config->desklock_autolock_idle) && (!e_config->mode.presentation) &&
|
||||
(!e_util_fullscreen_current_any()))
|
||||
((e_config->screen_actions_fullscreen_windows_ignore) ||
|
||||
((!e_config->screen_actions_fullscreen_windows_ignore) && (!e_util_fullscreen_any()))))
|
||||
{
|
||||
double idle, max;
|
||||
|
||||
|
|
|
@ -32,11 +32,13 @@ e_screensaver_timeout_get(Eina_Bool use_idle)
|
|||
int timeout = 0, count = (1 + _e_screensaver_ask_presentation_count);
|
||||
|
||||
if ((e_config->screensaver_enable) && (!e_config->mode.presentation) &&
|
||||
(!e_util_fullscreen_any()))
|
||||
((e_config->screen_actions_fullscreen_windows_ignore) ||
|
||||
((!e_config->screen_actions_fullscreen_windows_ignore) && (!e_util_fullscreen_any()))))
|
||||
timeout = e_config->screensaver_timeout * count;
|
||||
|
||||
if ((use_idle) && (!e_config->mode.presentation) &&
|
||||
(!e_util_fullscreen_any()))
|
||||
((e_config->screen_actions_fullscreen_windows_ignore) ||
|
||||
((!e_config->screen_actions_fullscreen_windows_ignore) && (!e_util_fullscreen_any()))))
|
||||
{
|
||||
if (e_config->backlight.idle_dim)
|
||||
{
|
||||
|
|
|
@ -45,6 +45,7 @@ struct _E_Config_Dialog_Data
|
|||
int bg_method_prev;
|
||||
Eina_List *bgs;
|
||||
int custom_lock;
|
||||
int fullscreen_windows_ignore;
|
||||
int ask_presentation;
|
||||
double ask_presentation_timeout;
|
||||
|
||||
|
@ -150,6 +151,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
|
|||
cfdata->zone = 0;
|
||||
}
|
||||
|
||||
cfdata->fullscreen_windows_ignore = e_config->screen_actions_fullscreen_windows_ignore;
|
||||
cfdata->ask_presentation = e_config->desklock_ask_presentation;
|
||||
cfdata->ask_presentation_timeout =
|
||||
e_config->desklock_ask_presentation_timeout;
|
||||
|
@ -333,6 +335,9 @@ _basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data
|
|||
|
||||
/* Presentation */
|
||||
ol = e_widget_list_add(evas, 0, 0);
|
||||
ow = e_widget_check_add(evas, _("Lock even on fullscreen windows"),
|
||||
&(cfdata->fullscreen_windows_ignore));
|
||||
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
|
||||
ow = e_widget_check_add(evas, _("Suggest if deactivated before"),
|
||||
&(cfdata->ask_presentation));
|
||||
e_widget_on_change_hook_set(ow, _cb_ask_presentation_changed, cfdata);
|
||||
|
@ -407,6 +412,7 @@ _basic_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
|||
e_config->desklock_post_screensaver_time = cfdata->post_screensaver_time;
|
||||
e_config->desklock_autolock_screensaver = cfdata->screensaver_lock;
|
||||
e_config->desklock_autolock_idle_timeout = (cfdata->idle_time * 60);
|
||||
e_config->screen_actions_fullscreen_windows_ignore = cfdata->fullscreen_windows_ignore;
|
||||
e_config->desklock_ask_presentation = cfdata->ask_presentation;
|
||||
e_config->desklock_ask_presentation_timeout = cfdata->ask_presentation_timeout;
|
||||
if (e_config->xkb.desklock_layout != cfdata->desklock_layout)
|
||||
|
@ -517,7 +523,8 @@ _basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfda
|
|||
else if (e_config->desklock_custom_desklock_cmd != cfdata->custom_lock_cmd)
|
||||
return 1;
|
||||
|
||||
return (e_config->desklock_ask_presentation != cfdata->ask_presentation) ||
|
||||
return (e_config->screen_actions_fullscreen_windows_ignore != cfdata->fullscreen_windows_ignore) ||
|
||||
(e_config->desklock_ask_presentation != cfdata->ask_presentation) ||
|
||||
(e_config->desklock_ask_presentation_timeout != cfdata->ask_presentation_timeout);
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,8 @@ struct _E_Config_Dialog_Data
|
|||
{
|
||||
E_Config_Dialog *cfd;
|
||||
|
||||
Evas_Object *backlight_slider;
|
||||
Evas_Object *backlight_slider_idle;
|
||||
Evas_Object *backlight_slider_fade;
|
||||
|
||||
char *bl_dev;
|
||||
|
||||
|
@ -21,6 +22,10 @@ struct _E_Config_Dialog_Data
|
|||
double backlight_dim;
|
||||
double backlight_timeout;
|
||||
double backlight_transition;
|
||||
|
||||
int fullscreen_windows_ignore;
|
||||
int ask_presentation;
|
||||
double ask_presentation_timeout;
|
||||
};
|
||||
|
||||
E_Config_Dialog *
|
||||
|
@ -55,6 +60,9 @@ _fill_data(E_Config_Dialog_Data *cfdata)
|
|||
cfdata->backlight_transition = e_config->backlight.transition;
|
||||
cfdata->enable_idle_dim = e_config->backlight.idle_dim;
|
||||
cfdata->backlight_timeout = e_config->backlight.timer;
|
||||
cfdata->ask_presentation = e_config->screensaver_ask_presentation;
|
||||
cfdata->fullscreen_windows_ignore = e_config->screen_actions_fullscreen_windows_ignore;
|
||||
cfdata->ask_presentation_timeout = e_config->screensaver_ask_presentation_timeout;
|
||||
}
|
||||
|
||||
static void *
|
||||
|
@ -83,6 +91,9 @@ _apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
|||
e_config->backlight.transition = cfdata->backlight_transition;
|
||||
e_config->backlight.timer = lround(cfdata->backlight_timeout);
|
||||
e_config->backlight.idle_dim = cfdata->enable_idle_dim;
|
||||
e_config->screensaver_ask_presentation = cfdata->ask_presentation;
|
||||
e_config->screen_actions_fullscreen_windows_ignore = cfdata->fullscreen_windows_ignore;
|
||||
e_config->screensaver_ask_presentation_timeout = cfdata->ask_presentation_timeout;
|
||||
|
||||
e_backlight_mode_set(NULL, E_BACKLIGHT_MODE_NORMAL);
|
||||
e_backlight_level_set(NULL, e_config->backlight.normal, -1.0);
|
||||
|
@ -106,12 +117,18 @@ _apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
|||
static int
|
||||
_advanced_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
e_widget_disabled_set(cfdata->backlight_slider, !cfdata->enable_idle_dim); // set state from saved config
|
||||
// set state from saved config
|
||||
e_widget_disabled_set(cfdata->backlight_slider_idle, !cfdata->enable_idle_dim);
|
||||
e_widget_disabled_set(cfdata->backlight_slider_fade, !cfdata->enable_idle_dim);
|
||||
|
||||
return (e_config->backlight.normal * 100.0 != cfdata->backlight_normal) ||
|
||||
(e_config->backlight.dim * 100.0 != cfdata->backlight_dim) ||
|
||||
(e_config->backlight.transition != cfdata->backlight_transition) ||
|
||||
(e_config->backlight.timer != cfdata->backlight_timeout) ||
|
||||
(e_config->backlight.idle_dim != cfdata->enable_idle_dim);
|
||||
(e_config->backlight.idle_dim != cfdata->enable_idle_dim) ||
|
||||
(e_config->screensaver_ask_presentation != cfdata->ask_presentation) ||
|
||||
(e_config->screen_actions_fullscreen_windows_ignore != cfdata->fullscreen_windows_ignore) ||
|
||||
(e_config->screensaver_ask_presentation_timeout != cfdata->ask_presentation_timeout);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -124,10 +141,13 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
|||
static Evas_Object *
|
||||
_advanced_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
Evas_Object *o, *ob;
|
||||
Evas_Object *otb, *o, *ob;
|
||||
Eina_List *devs, *l;
|
||||
const char *s, *label;
|
||||
|
||||
otb = e_widget_toolbook_add(evas, (24 * e_scale), (24 * e_scale));
|
||||
|
||||
/* Dimming */
|
||||
o = e_widget_list_add(evas, 0, 0);
|
||||
/*
|
||||
{
|
||||
|
@ -163,7 +183,7 @@ _advanced_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_D
|
|||
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,
|
||||
&(cfdata->backlight_timeout), NULL, 100);
|
||||
cfdata->backlight_slider = ob;
|
||||
cfdata->backlight_slider_idle = ob;
|
||||
e_widget_disabled_set(ob, !cfdata->enable_idle_dim); // set state from saved config
|
||||
e_widget_list_object_append(o, ob, 1, 1, 0.5);
|
||||
|
||||
|
@ -171,6 +191,8 @@ _advanced_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_D
|
|||
e_widget_list_object_append(o, ob, 1, 1, 0.5);
|
||||
ob = e_widget_slider_add(evas, 1, 0, _("%1.1f second(s)"), 0.0, 5.0, 0.1, 0,
|
||||
&(cfdata->backlight_transition), NULL, 100);
|
||||
cfdata->backlight_slider_fade = ob;
|
||||
e_widget_disabled_set(ob, !cfdata->enable_idle_dim); // set state from saved config
|
||||
e_widget_list_object_append(o, ob, 1, 1, 0.5);
|
||||
|
||||
devs = (Eina_List *)e_backlight_devices_get();
|
||||
|
@ -195,5 +217,33 @@ _advanced_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_D
|
|||
e_widget_ilist_go(ob);
|
||||
if (sel >= 0) e_widget_ilist_selected_set(ob, sel);
|
||||
}
|
||||
return o;
|
||||
|
||||
e_widget_toolbook_page_append(otb, NULL, _("Dimming"), o,
|
||||
1, 0, 1, 0, 0.5, 0.0);
|
||||
|
||||
/* Presentation */
|
||||
o = e_widget_list_add(evas, 0, 0);
|
||||
ob = e_widget_check_add(evas, _("Idle dimming even on fullscreen windows"),
|
||||
&(cfdata->fullscreen_windows_ignore));
|
||||
e_widget_list_object_append(o, ob, 1, 1, 0.5);
|
||||
/*
|
||||
// FIXME: Do the same as on screen blanking or locking.
|
||||
ob = e_widget_check_add(evas, _("Suggest if deactivated before"),
|
||||
&(cfdata->ask_presentation));
|
||||
e_widget_on_change_hook_set(ob, _cb_ask_presentation_changed, cfdata);
|
||||
cfdata->disable_list = eina_list_append(cfdata->disable_list, ob);
|
||||
e_widget_list_object_append(o, ob, 1, 1, 0.5);
|
||||
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f seconds"),
|
||||
1.0, 300.0, 10.0, 0,
|
||||
&(cfdata->ask_presentation_timeout), NULL, 100);
|
||||
cfdata->gui.ask_presentation_slider = ob;
|
||||
cfdata->disable_list = eina_list_append(cfdata->disable_list, ob);
|
||||
e_widget_list_object_append(o, ob, 1, 1, 0.5);
|
||||
*/
|
||||
e_widget_toolbook_page_append(otb, NULL, _("Presentation"), o,
|
||||
1, 0, 1, 0, 0.5, 0.0);
|
||||
|
||||
e_widget_toolbook_page_show(otb, 0);
|
||||
|
||||
return otb;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ struct _E_Config_Dialog_Data
|
|||
|
||||
int enable_screensaver;
|
||||
double timeout;
|
||||
int presentation_mode;
|
||||
int fullscreen_windows_ignore;
|
||||
int ask_presentation;
|
||||
double ask_presentation_timeout;
|
||||
|
||||
|
@ -67,7 +67,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
|
|||
cfdata->enable_screensaver = e_config->screensaver_enable;
|
||||
cfdata->timeout = (double)e_config->screensaver_timeout / 60.0;
|
||||
cfdata->ask_presentation = e_config->screensaver_ask_presentation;
|
||||
cfdata->presentation_mode = e_config->mode.presentation;
|
||||
cfdata->fullscreen_windows_ignore = e_config->screen_actions_fullscreen_windows_ignore;
|
||||
cfdata->ask_presentation_timeout = e_config->screensaver_ask_presentation_timeout;
|
||||
cfdata->screensaver_suspend = e_config->screensaver_suspend;
|
||||
cfdata->screensaver_suspend_on_ac = e_config->screensaver_suspend_on_ac;
|
||||
|
@ -98,7 +98,7 @@ _basic_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
|||
e_config->screensaver_enable = cfdata->enable_screensaver;
|
||||
e_config->screensaver_timeout = lround(cfdata->timeout * 60.0);
|
||||
e_config->screensaver_ask_presentation = cfdata->ask_presentation;
|
||||
e_config->mode.presentation = cfdata->presentation_mode;
|
||||
e_config->screen_actions_fullscreen_windows_ignore = cfdata->fullscreen_windows_ignore;
|
||||
e_config->screensaver_ask_presentation_timeout = cfdata->ask_presentation_timeout;
|
||||
e_config->screensaver_suspend = cfdata->screensaver_suspend;
|
||||
e_config->screensaver_suspend_on_ac = cfdata->screensaver_suspend_on_ac;
|
||||
|
@ -139,7 +139,7 @@ _basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfda
|
|||
return ((e_config->screensaver_enable != cfdata->enable_screensaver) ||
|
||||
(e_config->screensaver_timeout != lround(cfdata->timeout * 60.0)) ||
|
||||
(e_config->screensaver_ask_presentation != cfdata->ask_presentation) ||
|
||||
(e_config->mode.presentation != cfdata->presentation_mode) ||
|
||||
(e_config->screen_actions_fullscreen_windows_ignore != cfdata->fullscreen_windows_ignore) ||
|
||||
(e_config->screensaver_ask_presentation_timeout != cfdata->ask_presentation_timeout) ||
|
||||
(e_config->screensaver_suspend != cfdata->screensaver_suspend) ||
|
||||
(e_config->screensaver_suspend_on_ac != cfdata->screensaver_suspend_on_ac) ||
|
||||
|
@ -189,8 +189,8 @@ _basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data
|
|||
1, 0, 1, 0, 0.5, 0.0);
|
||||
/* Presentation */
|
||||
ol = e_widget_list_add(evas, 0, 0);
|
||||
ow = e_widget_check_add(evas, _("Presentation mode enabled"),
|
||||
&(cfdata->presentation_mode));
|
||||
ow = e_widget_check_add(evas, _("Blanking even on fullscreen windows"),
|
||||
&(cfdata->fullscreen_windows_ignore));
|
||||
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
|
||||
ow = e_widget_check_add(evas, _("Suggest if deactivated before"),
|
||||
&(cfdata->ask_presentation));
|
||||
|
|
Loading…
Reference in New Issue