forked from enlightenment/enlightenment
Fix the ecore_timer callback function.
Some formatting fixes. SVN revision: 28650
This commit is contained in:
parent
600cc2f8d8
commit
369d5107c0
|
@ -65,13 +65,12 @@ 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_desklock_exit(void *data, int type, void *event);
|
||||
static int _e_desklock_cb_idle_timer(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();
|
||||
static void _e_desklock_delete();
|
||||
static int _e_desklock_zone_num_get();
|
||||
|
||||
static int _e_desklock_check_auth();
|
||||
|
||||
#ifdef HAVE_PAM
|
||||
|
@ -86,11 +85,9 @@ static char *_desklock_auth_get_current_host(void);
|
|||
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);
|
||||
_e_desklock_cb_idle_timer, NULL);
|
||||
|
||||
if (e_config->desklock_background)
|
||||
e_filereg_register(e_config->desklock_background);
|
||||
|
@ -184,8 +181,8 @@ e_desklock_show(void)
|
|||
for (i = 0; i < wnum; i++)
|
||||
{
|
||||
Ecore_X_Window_Attributes att;
|
||||
memset(&att, 0, sizeof(Ecore_X_Window_Attributes));
|
||||
|
||||
memset(&att, 0, sizeof(Ecore_X_Window_Attributes));
|
||||
ecore_x_window_attributes_get(windows[i], &att);
|
||||
if (att.visible)
|
||||
{
|
||||
|
@ -480,13 +477,15 @@ _e_desklock_passwd_update()
|
|||
|
||||
if (!edd) return;
|
||||
|
||||
for (p = edd->passwd, pp = passwd_hidden; *p; p++, pp++) *pp = '*';
|
||||
for (p = edd->passwd, pp = passwd_hidden; *p; p++, pp++)
|
||||
*pp = '*';
|
||||
*pp = 0;
|
||||
|
||||
for (l = edd->elock_wnd_list; l; l = l->next)
|
||||
{
|
||||
edp = l->data;
|
||||
edje_object_part_text_set(edp->login_box, "e.text.password", passwd_hidden);
|
||||
edje_object_part_text_set(edp->login_box, "e.text.password",
|
||||
passwd_hidden);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -693,11 +692,16 @@ _desklock_pam_init(E_Desklock_Auth *da)
|
|||
|
||||
/* try other pam profiles - and system-auth (login for fbsd users) is a fallback */
|
||||
pam_prof = "login";
|
||||
if (ecore_file_exists("/etc/pam.d/enlightenment")) pam_prof = "enlightenment";
|
||||
else if (ecore_file_exists("/etc/pam.d/xscreensaver")) pam_prof = "xscreensaver";
|
||||
else if (ecore_file_exists("/etc/pam.d/kscreensaver")) pam_prof = "kscreensaver";
|
||||
else if (ecore_file_exists("/etc/pam.d/system-auth")) pam_prof = "system-auth";
|
||||
else if (ecore_file_exists("/etc/pam.d/system")) pam_prof = "system";
|
||||
if (ecore_file_exists("/etc/pam.d/enlightenment"))
|
||||
pam_prof = "enlightenment";
|
||||
else if (ecore_file_exists("/etc/pam.d/xscreensaver"))
|
||||
pam_prof = "xscreensaver";
|
||||
else if (ecore_file_exists("/etc/pam.d/kscreensaver"))
|
||||
pam_prof = "kscreensaver";
|
||||
else if (ecore_file_exists("/etc/pam.d/system-auth"))
|
||||
pam_prof = "system-auth";
|
||||
else if (ecore_file_exists("/etc/pam.d/system"))
|
||||
pam_prof = "system";
|
||||
|
||||
if ((pamerr = pam_start(pam_prof, da->user, &(da->pam.conv),
|
||||
&(da->pam.handle))) != PAM_SUCCESS)
|
||||
|
@ -705,16 +709,14 @@ _desklock_pam_init(E_Desklock_Auth *da)
|
|||
|
||||
current_user = _desklock_auth_get_current_user();
|
||||
|
||||
if ((pamerr = pam_set_item(da->pam.handle, PAM_USER,
|
||||
current_user)) != PAM_SUCCESS)
|
||||
if ((pamerr = pam_set_item(da->pam.handle, PAM_USER, current_user)) != PAM_SUCCESS)
|
||||
{
|
||||
free(current_user);
|
||||
return pamerr;
|
||||
}
|
||||
|
||||
current_host = _desklock_auth_get_current_host();
|
||||
if ((pamerr = pam_set_item(da->pam.handle, PAM_RHOST,
|
||||
current_host)) != PAM_SUCCESS)
|
||||
if ((pamerr = pam_set_item(da->pam.handle, PAM_RHOST, current_host)) != PAM_SUCCESS)
|
||||
{
|
||||
free(current_user);
|
||||
free(current_host);
|
||||
|
@ -790,7 +792,7 @@ _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)
|
||||
_e_desklock_cb_idle_timer(void *data)
|
||||
{
|
||||
static double time_of_last_event = 0;
|
||||
static unsigned int xtime_of_last_user_activity = 0;
|
||||
|
@ -826,10 +828,8 @@ _e_desklock_cb_idle_timer(void *data, int type, void *event)
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_e_desklock_user_idle = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Make sure our timer persists. */
|
||||
return 1;
|
||||
|
|
Loading…
Reference in New Issue