From cc9c130c24e23d9100aa703cd5c949f297059329 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 19 Dec 2013 10:53:29 -0500 Subject: [PATCH] clean up desklock showing on startup, add env var for checking unlocked state desklock's layer is below the start splash layer, so this can just be shown any time regardless of whether it's enabled. security++ previously the fact that e was restarting could break out of desklocked startup due to how the env variables were set. now there is a new variable which only gets set when the screen is locked which will force lock on startup even during restarts T681 --- src/bin/e_desklock.c | 2 ++ src/bin/e_main.c | 11 +++-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/bin/e_desklock.c b/src/bin/e_desklock.c index bcdd857cc..cddd54198 100644 --- a/src/bin/e_desklock.c +++ b/src/bin/e_desklock.c @@ -346,6 +346,7 @@ works: ev->suspend = suspend; ecore_event_add(E_EVENT_DESKLOCK, ev, NULL, NULL); + e_util_env_set("E_DESKLOCK_UNLOCKED", NULL); e_util_env_set("E_DESKLOCK_LOCKED", "locked"); _e_desklock_state = EINA_TRUE; return 1; @@ -413,6 +414,7 @@ e_desklock_hide(void) _e_desklock_autolock_time = 0.0; } e_util_env_set("E_DESKLOCK_LOCKED", "freefreefree"); + e_util_env_set("E_DESKLOCK_UNLOCKED", "happened"); } static void diff --git a/src/bin/e_main.c b/src/bin/e_main.c index 9cd6921d1..5da7b2d17 100644 --- a/src/bin/e_main.c +++ b/src/bin/e_main.c @@ -738,9 +738,7 @@ main(int argc, char **argv) TS("E_Popups Init Done"); _e_main_shutdown_push(e_popup_shutdown); - if ((locked) && ((!e_config->show_splash) && (!after_restart))) - e_desklock_show(EINA_TRUE); - else if (waslocked) + if (waslocked || (locked && ((!after_restart) || (getenv("E_DESKLOCK_UNLOCKED"))))) e_desklock_show(EINA_TRUE); if (e_config->show_splash) @@ -986,11 +984,8 @@ main(int argc, char **argv) } TS("Run Startup Apps Done"); - if (!((!e_config->show_splash) || (after_restart))) - { - ecore_timer_add(2.0, _e_main_cb_startup_fake_end, NULL); - if (locked) e_desklock_show(EINA_TRUE); - } + if (e_config->show_splash && (!after_restart)) + ecore_timer_add(2.0, _e_main_cb_startup_fake_end, NULL); TS("E_Container Thaw"); e_container_all_thaw();