From bad06a673ac0bdefa7e5f6fa3141bbbff159838e Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Mon, 30 Apr 2012 12:28:57 +0000 Subject: [PATCH] fix bug Ticket #903 SVN revision: 70557 --- src/bin/e_desklock.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/src/bin/e_desklock.c b/src/bin/e_desklock.c index 036fe65..8d9c0ac 100644 --- a/src/bin/e_desklock.c +++ b/src/bin/e_desklock.c @@ -70,6 +70,9 @@ static Eina_Bool _e_desklock_cb_mouse_move(void *data, int type, void *event); static Eina_Bool _e_desklock_cb_custom_desklock_exit(void *data, int type, void *event); static Eina_Bool _e_desklock_cb_idle_poller(void *data); static Eina_Bool _e_desklock_cb_window_stack(void *data, int type, void *event); +static Eina_Bool _e_desklock_cb_zone_add(void *data, int type, void *event); +static Eina_Bool _e_desklock_cb_zone_del(void *data, int type, void *event); +static Eina_Bool _e_desklock_cb_zone_move_resize(void *data, int type, void *event); static void _e_desklock_null(void); static void _e_desklock_passwd_update(void); @@ -375,6 +378,18 @@ e_desklock_show(void) eina_list_append(edd->handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CREATE, _e_desklock_cb_window_stack, NULL)); + edd->handlers = + eina_list_append(edd->handlers, + ecore_event_handler_add(E_EVENT_ZONE_ADD, + _e_desklock_cb_zone_add, NULL)); + edd->handlers = + eina_list_append(edd->handlers, + ecore_event_handler_add(E_EVENT_ZONE_DEL, + _e_desklock_cb_zone_del, NULL)); + edd->handlers = + eina_list_append(edd->handlers, + ecore_event_handler_add(E_EVENT_ZONE_MOVE_RESIZE, + _e_desklock_cb_zone_move_resize, NULL)); if ((total_zone_num > 1) && (e_config->desklock_login_box_zone == -2)) { @@ -467,6 +482,8 @@ _e_desklock_cb_window_stack(void *data __UNUSED__, Eina_List *l; Eina_Bool raise_win = EINA_TRUE; + if (!edd) return ECORE_CALLBACK_PASS_ON; + if (type == ECORE_X_EVENT_WINDOW_STACK) win = ((Ecore_X_Event_Window_Stack*) event)->event_win; else if (type == ECORE_X_EVENT_WINDOW_CONFIGURE) @@ -498,6 +515,49 @@ _e_desklock_cb_window_stack(void *data __UNUSED__, return ECORE_CALLBACK_PASS_ON; } +static Ecore_Job *_e_desklock_relock_job = NULL; + +static void +_e_desklock_relock_cb(void *data __UNUSED__) +{ + e_desklock_hide(); + e_desklock_show(); + _e_desklock_relock_job = NULL; +} + +static Eina_Bool +_e_desklock_cb_zone_add(void *data __UNUSED__, + int type __UNUSED__, + void *event __UNUSED__) +{ + if (!edd) return ECORE_CALLBACK_PASS_ON; + if (_e_desklock_relock_job) ecore_job_del(_e_desklock_relock_job); + _e_desklock_relock_job = ecore_job_add(_e_desklock_relock_cb, NULL); + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_desklock_cb_zone_del(void *data __UNUSED__, + int type __UNUSED__, + void *event __UNUSED__) +{ + if (!edd) return ECORE_CALLBACK_PASS_ON; + if (_e_desklock_relock_job) ecore_job_del(_e_desklock_relock_job); + _e_desklock_relock_job = ecore_job_add(_e_desklock_relock_cb, NULL); + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_desklock_cb_zone_move_resize(void *data __UNUSED__, + int type __UNUSED__, + void *event __UNUSED__) +{ + if (!edd) return ECORE_CALLBACK_PASS_ON; + if (_e_desklock_relock_job) ecore_job_del(_e_desklock_relock_job); + _e_desklock_relock_job = ecore_job_add(_e_desklock_relock_cb, NULL); + return ECORE_CALLBACK_PASS_ON; +} + static Eina_Bool _e_desklock_cb_key_down(void *data __UNUSED__, int type __UNUSED__, void *event) { -- 2.7.4