Enlightenment CVS committal Author : raster Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_desklock.c Log Message: remove idle timer hack in desklock - not reliable anyway. no poitn fixing it. rely on e_manager to trigger desklock from scrensaver events. =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_desklock.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -3 -r1.35 -r1.36 --- e_desklock.c 25 Mar 2007 22:44:59 -0000 1.35 +++ e_desklock.c 4 Apr 2007 10:18:19 -0000 1.36 @@ -54,8 +54,6 @@ #endif 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; /***********************************************************************/ @@ -65,7 +63,6 @@ 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_desklock_exit(void *data, int type, void *event); -static int _e_desklock_cb_idle_timer(void *data); static void _e_desklock_passwd_update(); static void _e_desklock_backspace(); @@ -85,13 +82,8 @@ EAPI int e_desklock_init(void) { - /* 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); - return 1; } @@ -789,48 +781,4 @@ e_desklock_hide(); return 0; -} - -static int -_e_desklock_cb_idle_timer(void *data) -{ - 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; } ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs