Hello,
A while back I submitted something that allowed a user to specify a
"custom desklock". This allowed a user to sidestep some possible PAM
issues as well as interact with their screensaver of choice.
It was committed, yet met with some understandable negative feedback. A
poor decision was made on my part to bind the "custom desklock" to the
screensaver activation routines. So that the effect was that the
desklock was always activated when some did not wish.
This will fix that.
Now, we have the following:
- A seperate "ScreenSaver" configuration panel. This will allow you
to enable/disable and control all aspects of the X screensaver.
- The "Custom Desklock" still exists and is only activated when the
desklock would normally be activated. That is, on explicit "Lock"
request from user, or when then X Screensaver becomes active (If desired).
- Additionally, the desklock can be activated due to the user being
idle. This is handy I think, for allowing the desklock to become active
at the same time your screensaver of choice becomes active. Simply set
the timeout to coincide with your screensaver's timeout. Also, maybe
you wish to lock it before the screensaver is active.
Hopefully this addresses some of the issues people had. I know there
were other comments and concerns as well. I have not addressed all yet
due to time. I will discuss the other things again in irc before
adressing them.
Please note: This patch was originally developed on my system in
conjunction with the DPMS patchset. There may be an issue in which if
you have previously applied the DPMS patch... this will not apply clean,
as it is against a current cvs. If this gets committed as does the DPMS
patchset, and someone needs the merge done... I'll be happy to do it.
Also worth noting.... This patch looks more invasive than it really is.
I have renamed alot of the vars/code that was submitted in the
original patchset.
Questions/Comments/Complaints welcome.
--
Regards,
Ravenlock
#include "e.h"
#define E_CONFIG_BLANKING_DEFAULT 2
#define E_CONFIG_BLANKING_PREFERRED 1
#define E_CONFIG_BLANKING_NOT_PREFERRED 0
#define E_CONFIG_EXPOSURES_DEFAULT 2
#define E_CONFIG_EXPOSURES_ALLOWED 1
#define E_CONFIG_EXPOSURES_NOT_ALLOWED 0
static void *_create_data(E_Config_Dialog *cfd);
static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static int _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data
*cfdata);
static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas,
E_Config_Dialog_Data *cfdata);
static int _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data
*cfdata);
static Evas_Object *_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas,
E_Config_Dialog_Data *cfdata);
/******************************************************************************************/
/*******************************************************************************************/
struct _E_Config_Dialog_Data
{
E_Config_Dialog *cfd;
int enable_screensaver;
double timeout;
double interval;
int blanking;
int exposures;
};
EAPI E_Config_Dialog *
e_int_config_screensaver(E_Container *con)
{
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
//e_widget_disabled_set(ob, !ecore_x_screensaver_event_available_get());
if (e_config_dialog_find("E", "_config_screensaver_dialog")) return NULL;
v = E_NEW(E_Config_Dialog_View, 1);
v->create_cfdata = _create_data;
v->free_cfdata = _free_data;
v->basic.apply_cfdata = _basic_apply_data;
v->basic.create_widgets = _basic_create_widgets;
v->advanced.apply_cfdata = _advanced_apply_data;
v->advanced.create_widgets = _advanced_create_widgets;
v->override_auto_apply = 1;
cfd = e_config_dialog_new(con,
_("Screen Saver Settings"),
"E", "_config_screensaver_dialog",
"enlightenment/screensaver", 0, v, NULL);
return cfd;
}
static void
_fill_data(E_Config_Dialog_Data *cfdata)
{
cfdata->enable_screensaver = e_config->screensaver_enable;
cfdata->timeout = e_config->screensaver_timeout / 60;
cfdata->interval = e_config->screensaver_interval;
cfdata->blanking = e_config->screensaver_blanking;
cfdata->exposures = e_config->screensaver_expose;
}
static void *
_create_data(E_Config_Dialog *cfd)
{
E_Config_Dialog_Data *cfdata;
cfdata = E_NEW(E_Config_Dialog_Data, 1);
cfdata->cfd = cfd;
_fill_data(cfdata);
return cfdata;
}
static void
_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
if (!cfdata) return;
E_FREE(cfdata);
}
static int
_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
e_config->screensaver_enable = cfdata->enable_screensaver;
e_config->screensaver_timeout = cfdata->timeout * 60;
e_config->screensaver_interval = cfdata->interval;
e_config->screensaver_blanking = cfdata->blanking;
e_config->screensaver_expose = cfdata->exposures;
/* Apply settings */
e_screensaver_init();
}
static int
_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
_apply_data(cfd, cfdata);
e_config_save_queue();
return 1;
}
static Evas_Object *
_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
*cfdata)
{
Evas_Object *o, *of, *ob;
o = e_widget_list_add(evas, 0, 0);
ob = e_widget_check_add(evas, _("Enable X screensaver"),
&(cfdata->enable_screensaver));
e_widget_list_object_append(o, ob, 1, 1, 0);
of = e_widget_framelist_add(evas, _("Screensaver Timer(s)"), 0);
ob = e_widget_label_add(evas, _("Time until X screensaver starts"));
e_widget_framelist_object_append(of, ob);
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f minutes"),
1.0, 90.0,
1.0, 0, &(cfdata->timeout), NULL,
200);
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 0.5);
e_dialog_resizable_set(cfd->dia, 0);
return o;
}
/* advanced window */
static int
_advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
if (!cfdata) return 0;
_apply_data(cfd, cfdata);
e_config_save_queue();
return 1;
}
static Evas_Object *
_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
*cfdata)
{
Evas_Object *o, *of, *ob;
E_Radio_Group *rg;
o = e_widget_list_add(evas, 0, 0);
ob = e_widget_check_add(evas, _("Enable X screensaver"),
&(cfdata->enable_screensaver));
e_widget_list_object_append(o, ob, 1, 1, 0);
of = e_widget_framelist_add(evas, _("Screensaver Timer(s)"), 0);
ob = e_widget_label_add(evas, _("Time until X screensaver starts"));
e_widget_framelist_object_append(of, ob);
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f minutes"),
1.0, 90.0,
1.0, 0, &(cfdata->timeout), NULL,
200);
e_widget_framelist_object_append(of, ob);
ob = e_widget_label_add(evas, _("Time until X screensaver alternates"));
e_widget_framelist_object_append(of, ob);
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f seconds"),
1.0, 300.0,
1.0, 0, &(cfdata->interval), NULL,
200);
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 0.5);
of = e_widget_framelist_add(evas, _("Blanking"), 0);
rg = e_widget_radio_group_new(&(cfdata->blanking));
ob = e_widget_radio_add(evas, _("Default"), E_CONFIG_BLANKING_DEFAULT, rg);
e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_add(evas, _("Preferred"), E_CONFIG_BLANKING_PREFERRED,
rg);
e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_add(evas, _("Not Preferred"),
E_CONFIG_BLANKING_NOT_PREFERRED, rg);
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 0.5);
of = e_widget_framelist_add(evas, _("Exposure Events"), 0);
rg = e_widget_radio_group_new(&(cfdata->exposures));
ob = e_widget_radio_add(evas, _("Default"), E_CONFIG_EXPOSURES_DEFAULT, rg);
e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_add(evas, _("Allow"), E_CONFIG_EXPOSURES_ALLOWED, rg);
e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_add(evas, _("Don't Allow"),
E_CONFIG_EXPOSURES_NOT_ALLOWED, rg);
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 0.5);
e_dialog_resizable_set(cfd->dia, 0);
return o;
}
/* general functionality/callbacks */
#ifdef E_TYPEDEFS
#else
#ifndef E_INT_CONFIG_SCREENSAVER_H
#define E_INT_CONFIG_SCREENSAVER_H
EAPI E_Config_Dialog *e_int_config_screensaver(E_Container *con);
#endif
#endif
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h"
EAPI int
e_screensaver_init(void)
{
int timeout=0, interval=0, blanking=0, expose=0;
if (e_config->screensaver_enable)
{
timeout = e_config->screensaver_timeout;
}
interval = e_config->screensaver_interval;
blanking = e_config->screensaver_blanking;
expose = e_config->screensaver_expose;
ecore_x_screensaver_set(timeout, interval, blanking, expose);
return 1;
}
#ifdef E_TYPEDEFS
#else
#ifndef E_SCREENSAVER_H
#define E_SCREENSAVER_H
EAPI int e_screensaver_init(void);
#endif
#endif
? e17/apps/e/src/bin/e_int_config_screensaver.c
? e17/apps/e/src/bin/e_int_config_screensaver.h
? e17/apps/e/src/bin/e_screensaver.c
? e17/apps/e/src/bin/e_screensaver.h
Index: e17/apps/e/src/bin/Makefile.am
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/Makefile.am,v
retrieving revision 1.170
diff -u -r1.170 Makefile.am
--- e17/apps/e/src/bin/Makefile.am 29 Jan 2007 02:07:35 -0000 1.170
+++ e17/apps/e/src/bin/Makefile.am 4 Feb 2007 23:28:06 -0000
@@ -137,8 +137,10 @@
e_int_config_color_classes.h \
e_int_config_mime.h \
e_int_config_mime_edit.h \
+e_int_config_screensaver.h \
e_exebuf.h \
e_desklock.h \
+e_screensaver.h \
e_int_config_modules.h \
e_exehist.h \
e_color_class.h \
@@ -293,8 +295,10 @@
e_int_config_color_classes.c \
e_int_config_mime.c \
e_int_config_mime_edit.c \
+e_int_config_screensaver.c \
e_exebuf.c \
e_desklock.c \
+e_screensaver.c \
e_int_config_modules.c \
e_exehist.c \
e_color_class.c \
Index: e17/apps/e/src/bin/e_config.c
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.225
diff -u -r1.225 e_config.c
--- e17/apps/e/src/bin/e_config.c 7 Jan 2007 23:45:35 -0000 1.225
+++ e17/apps/e/src/bin/e_config.c 4 Feb 2007 23:28:07 -0000
@@ -474,18 +474,23 @@
E_CONFIG_VAL(D, T, desklock_background, STR);
E_CONFIG_VAL(D, T, desklock_auth_method, INT);
E_CONFIG_VAL(D, T, desklock_login_box_zone, INT);
- E_CONFIG_VAL(D, T, desklock_autolock, INT);
- E_CONFIG_VAL(D, T, desklock_use_timeout, INT);
- E_CONFIG_VAL(D, T, desklock_timeout, DOUBLE);
- E_CONFIG_VAL(D, T, desklock_disable_screensaver, INT);
- E_CONFIG_VAL(D, T, desklock_use_custom_screensaver, INT);
- E_CONFIG_VAL(D, T, desklock_custom_screensaver_cmd, STR);
+ E_CONFIG_VAL(D, T, desklock_autolock_screensaver, INT);
+ E_CONFIG_VAL(D, T, desklock_autolock_idle, INT);
+ E_CONFIG_VAL(D, T, desklock_autolock_idle_timeout, DOUBLE);
+ E_CONFIG_VAL(D, T, desklock_use_custom_desklock, INT);
+ E_CONFIG_VAL(D, T, desklock_custom_desklock_cmd, STR);
E_CONFIG_VAL(D, T, display_res_restore, INT);
E_CONFIG_VAL(D, T, display_res_width, INT);
E_CONFIG_VAL(D, T, display_res_height, INT);
E_CONFIG_VAL(D, T, display_res_hz, INT);
E_CONFIG_VAL(D, T, display_res_rotation, INT);
+ E_CONFIG_VAL(D, T, screensaver_enable, INT);
+ E_CONFIG_VAL(D, T, screensaver_timeout, INT);
+ E_CONFIG_VAL(D, T, screensaver_interval, INT);
+ E_CONFIG_VAL(D, T, screensaver_blanking, INT);
+ E_CONFIG_VAL(D, T, screensaver_expose, INT);
+
E_CONFIG_VAL(D, T, border_raise_on_mouse_action, INT);
E_CONFIG_VAL(D, T, border_raise_on_focus, INT);
E_CONFIG_VAL(D, T, desk_flip_wrap, INT);
@@ -678,10 +683,9 @@
e_config->desklock_background = NULL;
e_config->desklock_auth_method = 0;
e_config->desklock_login_box_zone = -1;
- e_config->desklock_autolock = 0;
- e_config->desklock_use_timeout = 0;
- e_config->desklock_timeout = 300.0;
- e_config->desklock_disable_screensaver = 0;
+ e_config->desklock_autolock_screensaver = 0;
+ e_config->desklock_autolock_idle = 0;
+ e_config->desklock_autolock_idle_timeout = 300.0;
e_config->display_res_restore = 0;
e_config->display_res_width = 0;
@@ -1225,8 +1229,8 @@
IFCFGEND;
IFCFG(0x00106);
- e_config->desklock_use_custom_screensaver = 0;
- e_config->desklock_custom_screensaver_cmd = NULL;
+ e_config->desklock_use_custom_desklock = 0;
+ e_config->desklock_custom_desklock_cmd = NULL;
IFCFGEND;
IFCFG(0x0107); /* the version # where this value(s) was introduced */
@@ -1297,9 +1301,17 @@
IFCFG(0x0108);
e_config->desk_auto_switch = 0;
IFCFGEND;
-
- e_config->config_version = E_CONFIG_FILE_VERSION;
+ IFCFG(0x0110);
+ e_config->screensaver_enable = 0;
+ e_config->screensaver_timeout = 0;
+ e_config->screensaver_interval = 5;
+ e_config->screensaver_blanking = 2;
+ e_config->screensaver_expose = 2;
+ IFCFGEND;
+
+ e_config->config_version = E_CONFIG_FILE_VERSION;
+
#if 0 /* example of new config */
IFCFG(0x0090); /* the version # where this value(s) was introduced */
e_config->new_value = 10; /* set the value(s) */
@@ -1382,11 +1394,10 @@
E_CONFIG_LIMIT(e_config->cfgdlg_default_mode, 0, 1);
E_CONFIG_LIMIT(e_config->font_hinting, 0, 2);
E_CONFIG_LIMIT(e_config->desklock_login_box_zone, -2, 1000);
- E_CONFIG_LIMIT(e_config->desklock_autolock, 0, 1);
- E_CONFIG_LIMIT(e_config->desklock_use_timeout, 0, 1);
- E_CONFIG_LIMIT(e_config->desklock_timeout, 1.0, 5400.0);
- E_CONFIG_LIMIT(e_config->desklock_disable_screensaver, 0, 1);
- E_CONFIG_LIMIT(e_config->desklock_use_custom_screensaver, 0, 1);
+ E_CONFIG_LIMIT(e_config->desklock_autolock_screensaver, 0, 1);
+ E_CONFIG_LIMIT(e_config->desklock_autolock_idle, 0, 1);
+ E_CONFIG_LIMIT(e_config->desklock_autolock_idle_timeout, 1.0, 5400.0);
+ E_CONFIG_LIMIT(e_config->desklock_use_custom_desklock, 0, 1);
E_CONFIG_LIMIT(e_config->display_res_restore, 0, 1);
E_CONFIG_LIMIT(e_config->display_res_width, 1, 8192);
E_CONFIG_LIMIT(e_config->display_res_height, 1, 8192);
@@ -1398,6 +1409,12 @@
E_CONFIG_LIMIT(e_config->remember_internal_windows, 0, 1);
E_CONFIG_LIMIT(e_config->desk_auto_switch, 0, 1);
+ E_CONFIG_LIMIT(e_config->screensaver_enable, 0, 1);
+ E_CONFIG_LIMIT(e_config->screensaver_timeout, 0, 5400);
+ E_CONFIG_LIMIT(e_config->screensaver_interval, 0, 5400);
+ E_CONFIG_LIMIT(e_config->screensaver_blanking, 0, 2);
+ E_CONFIG_LIMIT(e_config->screensaver_expose, 0, 2);
+
/* FIXME: disabled auto apply because it causes problems */
e_config->cfgdlg_auto_apply = 0;
/* FIXME: desklock personalized password id disabled for security reasons */
@@ -1983,7 +2000,7 @@
if (e_config->wallpaper_import_last_dev)
evas_stringshare_del(e_config->wallpaper_import_last_dev);
if (e_config->wallpaper_import_last_path)
evas_stringshare_del(e_config->wallpaper_import_last_path);
if (e_config->theme_default_border_style)
evas_stringshare_del(e_config->theme_default_border_style);
- if (e_config->desklock_custom_screensaver_cmd)
evas_stringshare_del(e_config->desklock_custom_screensaver_cmd);
+ if (e_config->desklock_custom_desklock_cmd)
evas_stringshare_del(e_config->desklock_custom_desklock_cmd);
E_FREE(e_config);
}
}
Index: e17/apps/e/src/bin/e_config.h
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_config.h,v
retrieving revision 1.140
diff -u -r1.140 e_config.h
--- e17/apps/e/src/bin/e_config.h 7 Jan 2007 23:45:35 -0000 1.140
+++ e17/apps/e/src/bin/e_config.h 4 Feb 2007 23:28:08 -0000
@@ -52,7 +52,7 @@
/* 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 0x0108
+#define E_CONFIG_FILE_GENERATION 0x0110
#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH << 16) |
E_CONFIG_FILE_GENERATION)
#define E_EVAS_ENGINE_DEFAULT 0
@@ -227,12 +227,17 @@
const char *desklock_background; // GUI
int desklock_auth_method; // GUI
int desklock_login_box_zone; // GUI
- int desklock_autolock; // GUI
- int desklock_use_timeout; // GUI
- double desklock_timeout; // GUI
- int desklock_disable_screensaver; // GUI
- int desklock_use_custom_screensaver; //GUI
- const char *desklock_custom_screensaver_cmd; // GUI
+ int desklock_autolock_screensaver; // GUI
+ int desklock_autolock_idle; // GUI
+ double desklock_autolock_idle_timeout; // GUI
+ int desklock_use_custom_desklock; //GUI
+ const char *desklock_custom_desklock_cmd; // GUI
+
+ int screensaver_enable;
+ int screensaver_timeout;
+ int screensaver_interval;
+ int screensaver_blanking;
+ int screensaver_expose;
int display_res_restore; // GUI
int display_res_width; // GUI
Index: e17/apps/e/src/bin/e_configure.c
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_configure.c,v
retrieving revision 1.88
diff -u -r1.88 e_configure.c
--- e17/apps/e/src/bin/e_configure.c 10 Jan 2007 19:26:39 -0000 1.88
+++ e17/apps/e/src/bin/e_configure.c 4 Feb 2007 23:28:08 -0000
@@ -412,7 +412,8 @@
_e_configure_item_add(cat, _("Virtual Desktops"), "enlightenment/desktops",
e_int_config_desks);
_e_configure_item_add(cat, _("Screen Resolution"),
"enlightenment/screen_resolution", e_int_config_display);
_e_configure_item_add(cat, _("Screen Lock"), "enlightenment/desklock",
e_int_config_desklock);
-
+ _e_configure_item_add(cat, _("Screen Saver"), "enlightenment/screensaver",
e_int_config_screensaver);
+
cat = _e_configure_category_add(eco, _("Keyboard & Mouse"),
"enlightenment/behavior");
_e_configure_item_add(cat, _("Key Bindings"), "enlightenment/keys",
e_int_config_keybindings);
_e_configure_item_add(cat, _("Mouse Bindings"),
"enlightenment/mouse_clean", e_int_config_mousebindings);
Index: e17/apps/e/src/bin/e_desklock.c
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_desklock.c,v
retrieving revision 1.32
diff -u -r1.32 e_desklock.c
--- e17/apps/e/src/bin/e_desklock.c 7 Jan 2007 09:22:21 -0000 1.32
+++ e17/apps/e/src/bin/e_desklock.c 4 Feb 2007 23:28:08 -0000
@@ -52,8 +52,10 @@
static Ecore_Event_Handler *_e_desklock_exit_handler = NULL;
static pid_t _e_desklock_child_pid = -1;
#endif
-static Ecore_Exe *_e_custom_saver_exe = NULL;
-static Ecore_Event_Handler *_e_custom_saver_exe_handler = NULL;
+static Ecore_Exe *_e_custom_desklock_exe = NULL;
+static Ecore_Event_Handler *_e_custom_desklock_exe_handler = NULL;
+static Ecore_Timer *_e_desklock_idle_timer = NULL;
+static int _e_desklock_user_idle = 0;
/***********************************************************************/
@@ -62,7 +64,8 @@
static int _e_desklock_cb_mouse_up(void *data, int type, void *event);
static int _e_desklock_cb_mouse_wheel(void *data, int type, void *event);
static int _e_desklock_cb_mouse_move(void *data, int type, void *event);
-static int _e_desklock_cb_custom_saver_exit(void *data, int type, void *event);
+static int _e_desklock_cb_custom_desklock_exit(void *data, int type, void
*event);
+static int _e_desklock_cb_idle_timer(void *data, int type, void *event);
static void _e_desklock_passwd_update();
static void _e_desklock_backspace();
@@ -84,20 +87,10 @@
e_desklock_init(void)
{
- if (e_config->desklock_disable_screensaver)
- ecore_x_screensaver_timeout_set(0);
- else
- {
- if (e_config->desklock_use_timeout)
- ecore_x_screensaver_timeout_set(e_config->desklock_timeout);
- }
-
- /*
- * Effectively hide the X screensaver yet allow
- * it to generate the timer events for us.
- */
- ecore_x_screensaver_blank_set(!e_config->desklock_use_custom_screensaver);
- ecore_x_screensaver_expose_set(!e_config->desklock_use_custom_screensaver);
+ /* A timer to tick every second, watching for an idle user */
+ _e_desklock_idle_timer = ecore_timer_add(1.0,
+ _e_desklock_cb_idle_timer,
+ NULL);
if (e_config->desklock_background)
e_filereg_register(e_config->desklock_background);
@@ -125,26 +118,26 @@
int zone_counter;
int total_zone_num;
+ if (_e_custom_desklock_exe) return 0;
-#ifndef HAVE_PAM
- e_util_dialog_show(_("Error - no PAM support"),
- _("No PAM support was built into Enlightenment, so<br>"
- "desk locking is disabled."));
- return 0;
-#endif
- if (_e_custom_saver_exe) return 0;
-
- if (e_config->desklock_use_custom_screensaver)
+ if (e_config->desklock_use_custom_desklock)
{
- _e_custom_saver_exe_handler =
ecore_event_handler_add(ECORE_EXE_EVENT_DEL,
-
_e_desklock_cb_custom_saver_exit,
+ _e_custom_desklock_exe_handler =
ecore_event_handler_add(ECORE_EXE_EVENT_DEL,
+
_e_desklock_cb_custom_desklock_exit,
NULL);
e_util_library_path_strip();
- _e_custom_saver_exe =
ecore_exe_run(e_config->desklock_custom_screensaver_cmd, NULL);
+ _e_custom_desklock_exe =
ecore_exe_run(e_config->desklock_custom_desklock_cmd, NULL);
e_util_library_path_restore();
return 1;
}
-
+
+#ifndef HAVE_PAM
+ e_util_dialog_show(_("Error - no PAM support"),
+ _("No PAM support was built into Enlightenment, so<br>"
+ "desk locking is disabled."));
+ return 0;
+#endif
+
if (edd) return 0;
#ifdef HAVE_PAM
@@ -357,16 +350,17 @@
{
E_Desklock_Popup_Data *edp;
- if ((!edd) && (!_e_custom_saver_exe)) return;
+ if ((!edd) && (!_e_custom_desklock_exe)) return;
- if (e_config->desklock_use_custom_screensaver)
+ if (e_config->desklock_use_custom_desklock)
{
- _e_custom_saver_exe = NULL;
+ _e_custom_desklock_exe = NULL;
return;
}
if (edd->elock_grab_break_wnd)
ecore_x_window_show(edd->elock_grab_break_wnd);
+
while (edd->elock_wnd_list)
{
edp = edd->elock_wnd_list->data;
@@ -778,28 +772,66 @@
#endif
static int
-_e_desklock_cb_custom_saver_exit(void *data, int type, void *event)
+_e_desklock_cb_custom_desklock_exit(void *data, int type, void *event)
{
Ecore_Exe_Event_Del *ev;
ev = event;
- if (ev->exe != _e_custom_saver_exe) return 1;
+ if (ev->exe != _e_custom_desklock_exe) return 1;
if (ev->exit_code != 0)
{
/* do something profound here... like notify someone */
}
- /*
- * Miserable HACK alert!!!
- * Seems I must reset this. Some reason yet unknown, my
- * intended values are getting reset!?!
- */
- ecore_x_screensaver_timeout_set(e_config->desklock_timeout);
- ecore_x_screensaver_blank_set(!e_config->desklock_use_custom_screensaver);
- ecore_x_screensaver_expose_set(!e_config->desklock_use_custom_screensaver);
-
e_desklock_hide();
return 0;
}
+
+static int
+_e_desklock_cb_idle_timer(void *data, int type, void *event)
+{
+ static double time_of_last_event = 0;
+ static unsigned int xtime_of_last_user_activity = 0;
+
+ if ( ecore_x_current_user_activity_time_get() > xtime_of_last_user_activity
)
+ {
+ xtime_of_last_user_activity = ecore_x_current_user_activity_time_get();
+ time_of_last_event = ecore_time_get();
+ }
+
+ if (e_config->desklock_autolock_idle)
+ {
+ /* If a desklock is already up, bail */
+ if ((_e_custom_desklock_exe) || (edd)) return 1;
+
+ /* If we have exceeded our idle time... */
+ double t = ecore_time_get();
+ if (t - time_of_last_event >= e_config->desklock_autolock_idle_timeout)
+ {
+ /*
+ * Unfortunately, not all "desklocks" stay up for as long as
+ * the user is idle or until it is unlocked.
+ *
+ * 'xscreensaver-command -lock' for example sends a command
+ * to xscreensaver and then terminates. So, we have another
+ * check (_e_desklock_user_idle) which lets us know that we
+ * have locked the screen due to idleness.
+ */
+ if (!_e_desklock_user_idle)
+ {
+ _e_desklock_user_idle = 1;
+ e_desklock_show();
+ }
+ }
+ else
+ {
+ _e_desklock_user_idle = 0;
+ }
+ }
+
+ /* Make sure our timer persists. */
+ return 1;
+
+}
Index: e17/apps/e/src/bin/e_includes.h
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_includes.h,v
retrieving revision 1.144
diff -u -r1.144 e_includes.h
--- e17/apps/e/src/bin/e_includes.h 17 Dec 2006 11:24:59 -0000 1.144
+++ e17/apps/e/src/bin/e_includes.h 4 Feb 2007 23:28:08 -0000
@@ -101,6 +101,7 @@
#include "e_int_config_winlist.h"
#include "e_int_config_display.h"
#include "e_int_config_desklock.h"
+#include "e_int_config_screensaver.h"
#include "e_int_config_exebuf.h"
#include "e_int_config_apps.h"
#include "e_int_config_cfgdialogs.h"
@@ -113,6 +114,7 @@
#include "e_deskpreview.h"
#include "e_exebuf.h"
#include "e_desklock.h"
+#include "e_screensaver.h"
#include "e_int_config_modules.h"
#include "e_exehist.h"
#include "e_color_class.h"
Index: e17/apps/e/src/bin/e_int_config_desklock.c
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_int_config_desklock.c,v
retrieving revision 1.46
diff -u -r1.46 e_int_config_desklock.c
--- e17/apps/e/src/bin/e_int_config_desklock.c 15 Jan 2007 17:14:12 -0000
1.46
+++ e17/apps/e/src/bin/e_int_config_desklock.c 4 Feb 2007 23:28:09 -0000
@@ -51,16 +51,16 @@
char *desklock_passwd_cp;
int show_password; // local
+ int autolock_screensaver;
int autolock; // in e_config;
- int use_timeout; // in e_config;
double timeout; // in e_config;
int login_box_zone; // in e_config;
int specific_lb_zone; // local variable
int specific_lb_zone_backup; // used to have smart iface
- int use_custom_screensaver;
- char *custom_screensaver_cmd;
+ int use_custom_desklock;
+ char *custom_desklock_cmd;
int zone_count; // local variable;
@@ -283,9 +283,9 @@
cfdata->desklock_passwd_cp = strdup("");
}
- cfdata->autolock = e_config->desklock_autolock;
- cfdata->use_timeout = e_config->desklock_use_timeout;
- cfdata->timeout = e_config->desklock_timeout / 60;
+ cfdata->autolock_screensaver = e_config->desklock_autolock_screensaver;
+ cfdata->autolock = e_config->desklock_autolock_idle;
+ cfdata->timeout = e_config->desklock_autolock_idle_timeout / 60;
/* should be taken from e_config */
//cfdata->login_box_on_zone = -1;
@@ -341,9 +341,9 @@
cfdata->auth_method = e_config->desklock_auth_method;
#endif
- cfdata->use_custom_screensaver = e_config->desklock_use_custom_screensaver;
- if (e_config->desklock_custom_screensaver_cmd)
- cfdata->custom_screensaver_cmd =
strdup(e_config->desklock_custom_screensaver_cmd);
+ cfdata->use_custom_desklock = e_config->desklock_use_custom_desklock;
+ if (e_config->desklock_custom_desklock_cmd)
+ cfdata->custom_desklock_cmd =
strdup(e_config->desklock_custom_desklock_cmd);
//vertical_lb_align = e_config->desklock_login
}
@@ -378,17 +378,14 @@
evas_stringshare_del(e_config->desklock_personal_passwd);
}
e_config->desklock_personal_passwd =
evas_stringshare_add(cfdata->desklock_passwd_cp);
- e_config->desklock_autolock = cfdata->autolock;
- e_config->desklock_use_timeout = cfdata->use_timeout;
- e_config->desklock_timeout = cfdata->timeout * 60;
+
+ e_config->desklock_autolock_screensaver = cfdata->autolock_screensaver;
+ e_config->desklock_autolock_idle = cfdata->autolock;
+ e_config->desklock_autolock_idle_timeout = cfdata->timeout * 60;
+
#ifdef HAVE_PAM
e_config->desklock_auth_method = cfdata->auth_method;
#endif
- if (e_config->desklock_use_timeout)
- ecore_x_screensaver_timeout_set(e_config->desklock_timeout);
-
- ecore_x_screensaver_blank_set(!e_config->desklock_use_custom_screensaver);
- ecore_x_screensaver_expose_set(!e_config->desklock_use_custom_screensaver);
e_config_save_queue();
return 1;
@@ -403,15 +400,16 @@
of = e_widget_framelist_add(evas, _("Automatic Locking"), 0);
e_widget_disabled_set(of, !ecore_x_screensaver_event_available_get());
- ob = e_widget_check_add(evas, _("Enable screensaver"),
&(cfdata->use_timeout));
+ ob = e_widget_check_add(evas, _("Lock when X screensaver activates"),
+ &(cfdata->autolock_screensaver));
e_widget_disabled_set(ob, !ecore_x_screensaver_event_available_get());
- e_widget_framelist_object_append(of, ob);
+ e_widget_framelist_object_append(of, ob);
- ob = e_widget_check_add(evas, _("Lock when the screensaver starts"),
&(cfdata->autolock));
+ ob = e_widget_check_add(evas, _("Lock when idle time exceeded"),
&(cfdata->autolock));
e_widget_disabled_set(ob, !ecore_x_screensaver_event_available_get());
e_widget_framelist_object_append(of, ob);
- ob = e_widget_label_add(evas, _("Time until screensaver starts"));
+ ob = e_widget_label_add(evas, _("Idle time to exceed"));
e_widget_disabled_set(ob, !ecore_x_screensaver_event_available_get());
e_widget_framelist_object_append(of, ob);
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f minutes"),
@@ -458,26 +456,21 @@
else
e_config->desklock_login_box_zone = LOGINBOX_SHOW_ALL_SCREENS;
- e_config->desklock_autolock = cfdata->autolock;
- e_config->desklock_use_timeout = cfdata->use_timeout;
- e_config->desklock_timeout = cfdata->timeout * 60;
+ e_config->desklock_autolock_screensaver = cfdata->autolock_screensaver;
+ e_config->desklock_autolock_idle = cfdata->autolock;
+ e_config->desklock_autolock_idle_timeout = cfdata->timeout * 60;
#ifdef HAVE_PAM
e_config->desklock_auth_method = cfdata->auth_method;
#endif
- if (e_config->desklock_use_timeout)
- ecore_x_screensaver_timeout_set(e_config->desklock_timeout);
-
- e_config->desklock_use_custom_screensaver = cfdata->use_custom_screensaver;
- if (cfdata->custom_screensaver_cmd)
+ e_config->desklock_use_custom_desklock = cfdata->use_custom_desklock;
+ if (cfdata->custom_desklock_cmd)
{
- if (e_config->desklock_custom_screensaver_cmd)
- evas_stringshare_del(e_config->desklock_custom_screensaver_cmd);
- e_config->desklock_custom_screensaver_cmd =
evas_stringshare_add(cfdata->custom_screensaver_cmd);
+ if (e_config->desklock_custom_desklock_cmd)
+ evas_stringshare_del(e_config->desklock_custom_desklock_cmd);
+ e_config->desklock_custom_desklock_cmd =
evas_stringshare_add(cfdata->custom_desklock_cmd);
}
- ecore_x_screensaver_blank_set(!e_config->desklock_use_custom_screensaver);
- ecore_x_screensaver_expose_set(!e_config->desklock_use_custom_screensaver);
e_config_save_queue();
return 1;
}
@@ -708,19 +701,16 @@
*/
of = e_widget_framelist_add(evas, _("Automatic Locking"), 0);
-
- e_widget_disabled_set(of, !ecore_x_screensaver_event_available_get());
-
- ob = e_widget_check_add(evas, _("Enable X screensaver"),
&(cfdata->use_timeout));
+
+ ob = e_widget_check_add(evas, _("Lock when X screensaver activates"),
+ &(cfdata->autolock_screensaver));
e_widget_disabled_set(ob, !ecore_x_screensaver_event_available_get());
e_widget_framelist_object_append(of, ob);
-
- ob = e_widget_check_add(evas, _("Lock when the screensaver starts"),
&(cfdata->autolock));
- e_widget_disabled_set(ob, !ecore_x_screensaver_event_available_get());
+
+ ob = e_widget_check_add(evas, _("Lock when idle time exceeded"),
&(cfdata->autolock));
e_widget_framelist_object_append(of, ob);
- ob = e_widget_label_add(evas, _("Time until screensaver starts"));
- e_widget_disabled_set(ob, !ecore_x_screensaver_event_available_get());
+ ob = e_widget_label_add(evas, _("Idle time to exceed"));
e_widget_framelist_object_append(of, ob);
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f minutes"),
1.0, 90.0,
@@ -734,15 +724,16 @@
#endif
/*
- * Allow Custom Screen Saver
+ * Allow Custom Desklock
* Useful, for example, for those of us who prefer
* to use things like xscreensaver, kscreesaver, etc...
+ * and force them to lock with a custom command.
*/
- of = e_widget_framelist_add(evas, _("Custom Screensaver"), 0);
- ob = e_widget_check_add(evas, _("Use custom screensaver/desklock"),
- &(cfdata->use_custom_screensaver));
+ of = e_widget_framelist_add(evas, _("Custom Desklock"), 0);
+ ob = e_widget_check_add(evas, _("Use custom desklock"),
+ &(cfdata->use_custom_desklock));
e_widget_framelist_object_append(of, ob);
- ob = e_widget_entry_add(evas, &(cfdata->custom_screensaver_cmd));
+ ob = e_widget_entry_add(evas, &(cfdata->custom_desklock_cmd));
e_widget_framelist_object_append(of, ob);
#ifdef HAVE_PAM
e_widget_table_object_append(ot, of, 0, 4, 2, 1, 1, 1, 1, 1);
Index: e17/apps/e/src/bin/e_ipc_handlers.h
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_ipc_handlers.h,v
retrieving revision 1.142
diff -u -r1.142 e_ipc_handlers.h
--- e17/apps/e/src/bin/e_ipc_handlers.h 29 Dec 2006 02:56:26 -0000 1.142
+++ e17/apps/e/src/bin/e_ipc_handlers.h 4 Feb 2007 23:28:13 -0000
@@ -7818,15 +7818,15 @@
#undef HDL
/****************************************************************************/
-#define HDL E_IPC_OP_DESKLOCK_USE_CUSTOM_SCREENSAVER_SET
+#define HDL E_IPC_OP_DESKLOCK_USE_CUSTOM_DESKLOCK_SET
#if (TYPE == E_REMOTE_OPTIONS)
- OP("-desklock-use-custom-screensaver-set", 1, "Set whether a custom
screensaver will be utilized", 0, HDL)
+ OP("-desklock-use-custom-desklock-set", 1, "Set whether a custom desklock
will be utilized", 0, HDL)
#elif (TYPE == E_REMOTE_OUT)
REQ_INT(atoi(params[0]), HDL);
#elif (TYPE == E_WM_IN)
START_INT(policy, HDL);
- e_config->desklock_use_custom_screensaver = policy;
- E_CONFIG_LIMIT(e_config->desklock_use_custom_screensaver, 0, 1);
+ e_config->desklock_use_custom_desklock = policy;
+ E_CONFIG_LIMIT(e_config->desklock_use_custom_desklock, 0, 1);
SAVE;
END_INT;
#elif (TYPE == E_REMOTE_IN)
@@ -7834,19 +7834,19 @@
#undef HDL
/****************************************************************************/
-#define HDL E_IPC_OP_DESKLOCK_USE_CUSTOM_SCREENSAVER_GET
+#define HDL E_IPC_OP_DESKLOCK_USE_CUSTOM_DESKLOCK_GET
#if (TYPE == E_REMOTE_OPTIONS)
- OP("-desklock-use-custom-screensaver-get", 0, "Get whether a custom screen
saver is being used", 1, HDL)
+ OP("-desklock-use-custom-desklock-get", 0, "Get whether a custom desklock
is being used", 1, HDL)
#elif (TYPE == E_REMOTE_OUT)
REQ_NULL(HDL);
#elif (TYPE == E_WM_IN)
- SEND_INT(e_config->desklock_use_custom_screensaver,
E_IPC_OP_DESKLOCK_USE_CUSTOM_SCREENSAVER_GET_REPLY, HDL);
+ SEND_INT(e_config->desklock_use_custom_desklock,
E_IPC_OP_DESKLOCK_USE_CUSTOM_DESKLOCK_GET_REPLY, HDL);
#elif (TYPE == E_REMOTE_IN)
#endif
#undef HDL
/****************************************************************************/
-#define HDL E_IPC_OP_DESKLOCK_USE_CUSTOM_SCREENSAVER_GET_REPLY
+#define HDL E_IPC_OP_DESKLOCK_USE_CUSTOM_DESKLOCK_GET_REPLY
#if (TYPE == E_REMOTE_OPTIONS)
#elif (TYPE == E_REMOTE_OUT)
#elif (TYPE == E_WM_IN)
@@ -7858,35 +7858,35 @@
#undef HDL
/****************************************************************************/
-#define HDL E_IPC_OP_DESKLOCK_CUSTOM_SCREENSAVER_CMD_SET
+#define HDL E_IPC_OP_DESKLOCK_CUSTOM_DESKLOCK_CMD_SET
#if (TYPE == E_REMOTE_OPTIONS)
- OP("-desklock-custom-screensaver-cmd-set", 1, "Set the current custom
screensaver command to OPT1", 0, HDL)
+ OP("-desklock-custom-desklock-cmd-set", 1, "Set the current custom desklock
command to OPT1", 0, HDL)
#elif (TYPE == E_REMOTE_OUT)
REQ_STRING(params[0], HDL);
#elif (TYPE == E_WM_IN)
STRING(s, HDL);
- if (e_config->desklock_custom_screensaver_cmd)
- evas_stringshare_del(e_config->desklock_custom_screensaver_cmd);
- e_config->desklock_custom_screensaver_cmd = evas_stringshare_add(s);
+ if (e_config->desklock_custom_desklock_cmd)
+ evas_stringshare_del(e_config->desklock_custom_desklock_cmd);
+ e_config->desklock_custom_desklock_cmd = evas_stringshare_add(s);
END_STRING(s);
#elif (TYPE == E_REMOTE_IN)
#endif
#undef HDL
/****************************************************************************/
-#define HDL E_IPC_OP_DESKLOCK_CUSTOM_SCREENSAVER_CMD_GET
+#define HDL E_IPC_OP_DESKLOCK_CUSTOM_DESKLOCK_CMD_GET
#if (TYPE == E_REMOTE_OPTIONS)
- OP("-desklock-custom-screensaver-cmd-get", 0, "Get the current custom
screensaver command", 1, HDL)
+ OP("-desklock-custom-desklock-cmd-get", 0, "Get the current custom desklock
command", 1, HDL)
#elif (TYPE == E_REMOTE_OUT)
REQ_NULL(HDL);
#elif (TYPE == E_WM_IN)
- SEND_STRING(e_config->desklock_custom_screensaver_cmd,
E_IPC_OP_PROFILE_GET_REPLY, HDL);
+ SEND_STRING(e_config->desklock_custom_desklock_cmd,
E_IPC_OP_DESKLOCK_CUSTOM_DESKLOCK_CMD_GET_REPLY, HDL);
#elif (TYPE == E_REMOTE_IN)
#endif
#undef HDL
/****************************************************************************/
-#define HDL E_IPC_OP_DESKLOCK_CUSTOM_SCREENSAVER_CMD_GET_REPLY
+#define HDL E_IPC_OP_DESKLOCK_CUSTOM_DESKLOCK_CMD_GET_REPLY
#if (TYPE == E_REMOTE_OPTIONS)
#elif (TYPE == E_REMOTE_OUT)
#elif (TYPE == E_WM_IN)
Index: e17/apps/e/src/bin/e_ipc_handlers_list.h
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_ipc_handlers_list.h,v
retrieving revision 1.54
diff -u -r1.54 e_ipc_handlers_list.h
--- e17/apps/e/src/bin/e_ipc_handlers_list.h 29 Dec 2006 02:56:26 -0000
1.54
+++ e17/apps/e/src/bin/e_ipc_handlers_list.h 4 Feb 2007 23:28:14 -0000
@@ -414,10 +414,9 @@
#define E_IPC_OP_REBOOT 377
#define E_IPC_OP_SUSPEND 378
-#define E_IPC_OP_DESKLOCK_USE_CUSTOM_SCREENSAVER_SET 379
-#define E_IPC_OP_DESKLOCK_USE_CUSTOM_SCREENSAVER_GET 380
-#define E_IPC_OP_DESKLOCK_USE_CUSTOM_SCREENSAVER_GET_REPLY 381
-#define E_IPC_OP_DESKLOCK_CUSTOM_SCREENSAVER_CMD_SET 382
-#define E_IPC_OP_DESKLOCK_CUSTOM_SCREENSAVER_CMD_GET 383
-#define E_IPC_OP_DESKLOCK_CUSTOM_SCREENSAVER_CMD_GET_REPLY 384
-
+#define E_IPC_OP_DESKLOCK_USE_CUSTOM_DESKLOCK_SET 379
+#define E_IPC_OP_DESKLOCK_USE_CUSTOM_DESKLOCK_GET 380
+#define E_IPC_OP_DESKLOCK_USE_CUSTOM_DESKLOCK_GET_REPLY 381
+#define E_IPC_OP_DESKLOCK_CUSTOM_DESKLOCK_CMD_SET 382
+#define E_IPC_OP_DESKLOCK_CUSTOM_DESKLOCK_CMD_GET 383
+#define E_IPC_OP_DESKLOCK_CUSTOM_DESKLOCK_CMD_GET_REPLY 384
Index: e17/apps/e/src/bin/e_main.c
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_main.c,v
retrieving revision 1.199
diff -u -r1.199 e_main.c
--- e17/apps/e/src/bin/e_main.c 17 Dec 2006 11:24:59 -0000 1.199
+++ e17/apps/e/src/bin/e_main.c 4 Feb 2007 23:28:14 -0000
@@ -769,6 +769,14 @@
}
_e_main_shutdown_push(e_exebuf_shutdown);
+ TS("screensaver");
+ /* setup screensaver */
+ if (!e_screensaver_init())
+ {
+ e_error_message_show(_("Enlightenment cannot configure the X
screensaver."));
+ _e_main_shutdown(-1);
+ }
+
TS("desklock");
/* setup desklock */
if (!e_desklock_init())
Index: e17/apps/e/src/bin/e_manager.c
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_manager.c,v
retrieving revision 1.60
diff -u -r1.60 e_manager.c
--- e17/apps/e/src/bin/e_manager.c 29 Dec 2006 05:42:04 -0000 1.60
+++ e17/apps/e/src/bin/e_manager.c 4 Feb 2007 23:28:15 -0000
@@ -754,7 +754,7 @@
if (e->on)
{
- if ((e_config->desklock_autolock) ||
(e_config->desklock_use_custom_screensaver))
+ if (e_config->desklock_autolock_screensaver)
e_desklock_show();
}
return 1;
Index: e17/libs/ecore/src/lib/ecore_x/Ecore_X.h
===================================================================
RCS file: /var/cvs/e/e17/libs/ecore/src/lib/ecore_x/Ecore_X.h,v
retrieving revision 1.181
diff -u -r1.181 Ecore_X.h
--- e17/libs/ecore/src/lib/ecore_x/Ecore_X.h 29 Dec 2006 02:56:33 -0000
1.181
+++ e17/libs/ecore/src/lib/ecore_x/Ecore_X.h 4 Feb 2007 23:38:31 -0000
@@ -981,6 +981,7 @@
EAPI void ecore_x_kill(Ecore_X_Window win);
EAPI Ecore_X_Time ecore_x_current_time_get(void);
+EAPI Ecore_X_Time ecore_x_current_user_activity_time_get(void);
EAPI void ecore_x_error_handler_set(void (*func) (void *data),
const void *data);
EAPI void ecore_x_io_error_handler_set(void (*func) (void *data),
const void *data);
Index: e17/libs/ecore/src/lib/ecore_x/ecore_x.c
===================================================================
RCS file: /var/cvs/e/e17/libs/ecore/src/lib/ecore_x/ecore_x.c,v
retrieving revision 1.123
diff -u -r1.123 ecore_x.c
--- e17/libs/ecore/src/lib/ecore_x/ecore_x.c 2 Dec 2006 06:40:24 -0000
1.123
+++ e17/libs/ecore/src/lib/ecore_x/ecore_x.c 4 Feb 2007 23:38:32 -0000
@@ -37,6 +37,7 @@
Display *_ecore_x_disp = NULL;
double _ecore_x_double_click_time = 0.25;
Time _ecore_x_event_last_time = 0;
+Time _ecore_x_event_last_user_activity_time = 0;
Window _ecore_x_event_last_win = 0;
int _ecore_x_event_last_root_x = 0;
int _ecore_x_event_last_root_y = 0;
@@ -647,6 +648,15 @@
{
return _ecore_x_event_last_time;
}
+/*
+ * Return the last time a *USER* generated an event
+ * Should corespond to key-down, key-up, mouse-down, mouse-up, mouse move
+ */
+EAPI Ecore_X_Time
+ecore_x_current_user_activity_time_get()
+{
+ return _ecore_x_event_last_user_activity_time;
+}
static int
_ecore_x_fd_handler(void *data, Ecore_Fd_Handler *fd_handler __UNUSED__)
Index: e17/libs/ecore/src/lib/ecore_x/ecore_x_events.c
===================================================================
RCS file: /var/cvs/e/e17/libs/ecore/src/lib/ecore_x/ecore_x_events.c,v
retrieving revision 1.93
diff -u -r1.93 ecore_x_events.c
--- e17/libs/ecore/src/lib/ecore_x/ecore_x_events.c 19 Dec 2006 06:51:51
-0000 1.93
+++ e17/libs/ecore/src/lib/ecore_x/ecore_x_events.c 4 Feb 2007 23:38:33
-0000
@@ -228,6 +228,7 @@
e->time = xevent->xkey.time;
e->modifiers = xevent->xkey.state;
_ecore_x_event_last_time = e->time;
+ _ecore_x_event_last_user_activity_time = e->time;
ecore_event_add(ECORE_X_EVENT_KEY_DOWN, e, _ecore_x_event_free_key_down,
NULL);
}
@@ -279,6 +280,7 @@
e->time = xevent->xkey.time;
e->modifiers = xevent->xkey.state;
_ecore_x_event_last_time = e->time;
+ _ecore_x_event_last_user_activity_time = e->time;
ecore_event_add(ECORE_X_EVENT_KEY_UP, e, _ecore_x_event_free_key_up, NULL);
}
@@ -332,6 +334,7 @@
e->event_win = xevent->xbutton.window;
e->time = xevent->xbutton.time;
_ecore_x_event_last_time = e->time;
+ _ecore_x_event_last_user_activity_time = e->time;
_ecore_x_event_last_win = e->win;
_ecore_x_event_last_root_x = e->root.x;
_ecore_x_event_last_root_y = e->root.y;
@@ -376,6 +379,7 @@
e->event_win = xevent->xbutton.window;
e->time = xevent->xbutton.time;
_ecore_x_event_last_time = e->time;
+ _ecore_x_event_last_user_activity_time = e->time;
_ecore_x_event_last_win = e->win;
_ecore_x_event_last_root_x = e->root.x;
_ecore_x_event_last_root_y = e->root.y;
@@ -431,6 +435,7 @@
if (!e->double_click && !e->triple_click)
_ecore_x_mouse_up_count = 0;
_ecore_x_event_last_time = e->time;
+ _ecore_x_event_last_user_activity_time = e->time;
_ecore_x_event_last_win = e->win;
_ecore_x_event_last_root_x = e->root.x;
_ecore_x_event_last_root_y = e->root.y;
@@ -497,6 +502,7 @@
e->event_win = xevent->xbutton.window;
e->time = xevent->xbutton.time;
_ecore_x_event_last_time = e->time;
+ _ecore_x_event_last_user_activity_time = e->time;
_ecore_x_event_last_win = e->win;
_ecore_x_event_last_root_x = e->root.x;
_ecore_x_event_last_root_y = e->root.y;
@@ -538,6 +544,7 @@
e->triple_click = 1;
}
_ecore_x_event_last_time = e->time;
+ _ecore_x_event_last_user_activity_time = e->time;
_ecore_x_event_last_win = e->win;
_ecore_x_event_last_root_x = e->root.x;
_ecore_x_event_last_root_y = e->root.y;
@@ -563,6 +570,7 @@
e->event_win = xevent->xmotion.window;
e->time = xevent->xmotion.time;
_ecore_x_event_last_time = e->time;
+ _ecore_x_event_last_user_activity_time = e->time;
_ecore_x_event_last_win = e->win;
_ecore_x_event_last_root_x = e->root.x;
_ecore_x_event_last_root_y = e->root.y;
Index: e17/libs/ecore/src/lib/ecore_x/ecore_x_private.h
===================================================================
RCS file: /var/cvs/e/e17/libs/ecore/src/lib/ecore_x/ecore_x_private.h,v
retrieving revision 1.56
diff -u -r1.56 ecore_x_private.h
--- e17/libs/ecore/src/lib/ecore_x/ecore_x_private.h 5 Nov 2006 15:14:49
-0000 1.56
+++ e17/libs/ecore/src/lib/ecore_x/ecore_x_private.h 4 Feb 2007 23:38:34
-0000
@@ -145,6 +145,7 @@
extern Display *_ecore_x_disp;
extern double _ecore_x_double_click_time;
extern Time _ecore_x_event_last_time;
+extern Time _ecore_x_event_last_user_activity_time;
extern Window _ecore_x_event_last_win;
extern int _ecore_x_event_last_root_x;
extern int _ecore_x_event_last_root_y;
Index: e17/libs/ecore/src/lib/ecore_x/ecore_x_screensaver.c
===================================================================
RCS file: /var/cvs/e/e17/libs/ecore/src/lib/ecore_x/ecore_x_screensaver.c,v
retrieving revision 1.5
diff -u -r1.5 ecore_x_screensaver.c
--- e17/libs/ecore/src/lib/ecore_x/ecore_x_screensaver.c 29 Dec 2006
02:56:33 -0000 1.5
+++ e17/libs/ecore/src/lib/ecore_x/ecore_x_screensaver.c 4 Feb 2007
23:38:34 -0000
@@ -19,6 +19,14 @@
}
EAPI void
+ecore_x_screensaver_set(int timeout, int interval, int blank, int expose)
+{
+
+ XSetScreenSaver(_ecore_x_disp, timeout, interval, blank, expose);
+
+}
+
+EAPI void
ecore_x_screensaver_timeout_set(double timeout)
{
int pto, pint, pblank, pexpo;
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel