2006-02-19 15:53:35 -08:00
|
|
|
#include "e.h"
|
2007-04-18 20:44:47 -07:00
|
|
|
|
2006-02-19 15:53:35 -08:00
|
|
|
|
2006-02-22 06:35:04 -08:00
|
|
|
/**************************** private data ******************************/
|
2006-02-19 15:53:35 -08:00
|
|
|
|
2013-01-11 02:34:29 -08:00
|
|
|
typedef struct _E_Desklock_Run E_Desklock_Run;
|
2012-07-17 06:33:21 -07:00
|
|
|
|
2010-07-18 12:06:00 -07:00
|
|
|
|
2012-07-17 06:33:21 -07:00
|
|
|
struct _E_Desklock_Run
|
|
|
|
{
|
|
|
|
E_Order *desk_run;
|
2013-01-11 02:34:29 -08:00
|
|
|
int position;
|
2012-07-17 06:33:21 -07:00
|
|
|
};
|
|
|
|
|
2007-02-13 08:33:35 -08:00
|
|
|
static Ecore_Exe *_e_custom_desklock_exe = NULL;
|
|
|
|
static Ecore_Event_Handler *_e_custom_desklock_exe_handler = NULL;
|
2008-01-10 23:33:57 -08:00
|
|
|
static Ecore_Poller *_e_desklock_idle_poller = NULL;
|
2007-04-04 04:43:36 -07:00
|
|
|
static int _e_desklock_user_idle = 0;
|
2009-04-26 19:54:43 -07:00
|
|
|
static double _e_desklock_autolock_time = 0.0;
|
|
|
|
static E_Dialog *_e_desklock_ask_presentation_dia = NULL;
|
|
|
|
static int _e_desklock_ask_presentation_count = 0;
|
2006-02-19 15:53:35 -08:00
|
|
|
|
2012-07-17 06:33:21 -07:00
|
|
|
static Ecore_Event_Handler *_e_desklock_run_handler = NULL;
|
2015-06-01 02:38:31 -07:00
|
|
|
static Ecore_Event_Handler *_e_desklock_randr_handler = NULL;
|
2012-07-17 06:33:21 -07:00
|
|
|
static Ecore_Job *job = NULL;
|
|
|
|
static Eina_List *tasks = NULL;
|
|
|
|
|
2013-12-21 07:59:23 -08:00
|
|
|
static Eina_List *show_hooks = NULL;
|
|
|
|
static Eina_List *hide_hooks = NULL;
|
2013-10-25 06:20:45 -07:00
|
|
|
|
2013-10-25 23:50:36 -07:00
|
|
|
static Eina_List *block_rects = NULL;
|
|
|
|
|
2013-12-21 07:59:23 -08:00
|
|
|
static Eina_List *desklock_ifaces = NULL;
|
|
|
|
static E_Desklock_Interface *current_iface = NULL;
|
2016-01-15 16:25:25 -08:00
|
|
|
static Eina_Bool demo = EINA_FALSE;
|
2006-02-19 15:53:35 -08:00
|
|
|
|
2013-12-21 07:59:23 -08:00
|
|
|
/***********************************************************************/
|
2015-03-18 15:09:09 -07:00
|
|
|
static Eina_Bool _e_desklock_cb_custom_desklock_exit(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
|
|
|
|
static Eina_Bool _e_desklock_cb_idle_poller(void *data EINA_UNUSED);
|
2012-07-17 06:33:21 -07:00
|
|
|
static Eina_Bool _e_desklock_cb_run(void *data, int type, void *event);
|
2015-06-01 02:38:31 -07:00
|
|
|
static Eina_Bool _e_desklock_cb_randr(void *data, int type, void *event);
|
2012-07-17 06:33:21 -07:00
|
|
|
|
2012-07-09 01:03:58 -07:00
|
|
|
static Eina_Bool _e_desklock_state = EINA_FALSE;
|
2006-04-17 20:14:29 -07:00
|
|
|
|
2012-06-14 06:16:28 -07:00
|
|
|
static void _e_desklock_ask_presentation_mode(void);
|
2009-04-26 19:54:43 -07:00
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API int E_EVENT_DESKLOCK = 0;
|
2007-05-28 04:08:36 -07:00
|
|
|
|
2010-11-22 07:21:32 -08:00
|
|
|
EINTERN int
|
2006-04-17 20:14:29 -07:00
|
|
|
e_desklock_init(void)
|
|
|
|
{
|
2012-09-19 06:31:35 -07:00
|
|
|
Eina_List *l;
|
|
|
|
E_Config_Desklock_Background *bg;
|
2008-01-10 23:33:57 -08:00
|
|
|
/* A poller to tick every 256 ticks, watching for an idle user */
|
|
|
|
_e_desklock_idle_poller = ecore_poller_add(ECORE_POLLER_CORE, 256,
|
2012-06-14 06:16:28 -07:00
|
|
|
_e_desklock_cb_idle_poller, NULL);
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2012-09-19 06:31:35 -07:00
|
|
|
EINA_LIST_FOREACH(e_config->desklock_backgrounds, l, bg)
|
|
|
|
e_filereg_register(bg->file);
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2007-05-28 04:15:04 -07:00
|
|
|
E_EVENT_DESKLOCK = ecore_event_type_new();
|
2007-05-28 04:08:36 -07:00
|
|
|
|
2012-07-17 06:33:21 -07:00
|
|
|
_e_desklock_run_handler = ecore_event_handler_add(E_EVENT_DESKLOCK,
|
2013-01-11 02:34:29 -08:00
|
|
|
_e_desklock_cb_run, NULL);
|
2012-07-17 06:33:21 -07:00
|
|
|
|
2015-06-01 02:38:31 -07:00
|
|
|
_e_desklock_randr_handler = ecore_event_handler_add(E_EVENT_RANDR_CHANGE,
|
|
|
|
_e_desklock_cb_randr, NULL);
|
2006-04-17 20:14:29 -07:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2010-11-22 07:21:32 -08:00
|
|
|
EINTERN int
|
2006-04-17 20:14:29 -07:00
|
|
|
e_desklock_shutdown(void)
|
|
|
|
{
|
2013-12-21 07:59:23 -08:00
|
|
|
Eina_Bool waslocked = _e_desklock_state;
|
2012-07-17 06:33:21 -07:00
|
|
|
E_Desklock_Run *task;
|
2012-09-19 06:31:35 -07:00
|
|
|
Eina_List *l;
|
|
|
|
E_Config_Desklock_Background *bg;
|
2012-06-14 06:16:28 -07:00
|
|
|
|
2013-12-21 07:59:23 -08:00
|
|
|
desklock_ifaces = eina_list_free(desklock_ifaces);
|
2011-02-15 21:20:13 -08:00
|
|
|
if (!x_fatal)
|
2012-06-14 06:16:28 -07:00
|
|
|
e_desklock_hide();
|
|
|
|
|
2012-04-30 05:59:03 -07:00
|
|
|
if (waslocked) e_util_env_set("E_DESKLOCK_LOCKED", "locked");
|
2012-07-17 06:33:21 -07:00
|
|
|
|
|
|
|
ecore_event_handler_del(_e_desklock_run_handler);
|
|
|
|
_e_desklock_run_handler = NULL;
|
2015-06-01 02:38:31 -07:00
|
|
|
ecore_event_handler_del(_e_desklock_randr_handler);
|
|
|
|
_e_desklock_randr_handler = NULL;
|
2012-07-17 06:33:21 -07:00
|
|
|
|
|
|
|
if (job) ecore_job_del(job);
|
|
|
|
job = NULL;
|
|
|
|
|
2012-09-19 06:31:35 -07:00
|
|
|
EINA_LIST_FOREACH(e_config->desklock_backgrounds, l, bg)
|
|
|
|
e_filereg_deregister(bg->file);
|
|
|
|
|
2012-07-17 06:33:21 -07:00
|
|
|
EINA_LIST_FREE(tasks, task)
|
|
|
|
{
|
|
|
|
e_object_del(E_OBJECT(task->desk_run));
|
|
|
|
free(task);
|
|
|
|
}
|
|
|
|
|
2006-04-17 20:14:29 -07:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API Eina_Stringshare *
|
2013-12-21 07:59:23 -08:00
|
|
|
e_desklock_user_wallpaper_get(E_Zone *zone)
|
2009-04-25 11:32:34 -07:00
|
|
|
{
|
|
|
|
const E_Config_Desktop_Background *cdbg;
|
|
|
|
const Eina_List *l;
|
2012-09-19 06:51:19 -07:00
|
|
|
E_Desk *desk;
|
2009-04-25 11:32:34 -07:00
|
|
|
|
2012-09-19 06:51:19 -07:00
|
|
|
desk = e_desk_current_get(zone);
|
2009-04-25 11:32:34 -07:00
|
|
|
EINA_LIST_FOREACH(e_config->desktop_backgrounds, l, cdbg)
|
2012-09-19 06:51:19 -07:00
|
|
|
{
|
|
|
|
if ((cdbg->zone > -1) && (cdbg->zone != (int)zone->num)) continue;
|
|
|
|
if ((cdbg->desk_x > -1) && (cdbg->desk_x != desk->x)) continue;
|
|
|
|
if ((cdbg->desk_y > -1) && (cdbg->desk_y != desk->y)) continue;
|
|
|
|
if (cdbg->file) return cdbg->file;
|
|
|
|
}
|
2009-04-25 11:32:34 -07:00
|
|
|
|
2012-09-19 23:57:33 -07:00
|
|
|
if (e_config->desktop_default_background)
|
|
|
|
return e_config->desktop_default_background;
|
|
|
|
|
2010-07-18 12:06:00 -07:00
|
|
|
return e_theme_edje_file_get("base/theme/desklock", "e/desklock/background");
|
2009-04-25 11:32:34 -07:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2013-12-21 07:59:23 -08:00
|
|
|
e_desklock_interface_append(E_Desklock_Interface *iface)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN(iface);
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN(iface->show);
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN(iface->name);
|
|
|
|
EINA_SAFETY_ON_TRUE_RETURN(iface->active); // fucking casuals
|
|
|
|
/* make sure our module is first so it gets tried last */
|
|
|
|
if (!e_util_strcmp(iface->name, "lokker"))
|
|
|
|
desklock_ifaces = eina_list_prepend(desklock_ifaces, (void*)iface);
|
|
|
|
else
|
|
|
|
desklock_ifaces = eina_list_append(desklock_ifaces, (void*)iface);
|
2014-01-14 22:01:41 -08:00
|
|
|
if (_e_desklock_state && (!current_iface))
|
|
|
|
{
|
|
|
|
if (iface->show())
|
|
|
|
{
|
|
|
|
iface->active = EINA_TRUE;
|
|
|
|
current_iface = iface;
|
|
|
|
}
|
|
|
|
}
|
2013-12-21 07:59:23 -08:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2013-12-21 07:59:23 -08:00
|
|
|
e_desklock_interface_remove(E_Desklock_Interface *iface)
|
|
|
|
{
|
|
|
|
E_Desklock_Interface *diface;
|
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN(iface);
|
|
|
|
if (!desklock_ifaces) return;
|
|
|
|
desklock_ifaces = eina_list_remove(desklock_ifaces, (void*)iface);
|
|
|
|
if (!iface->active) return;
|
|
|
|
/* if it was active, hide it */
|
|
|
|
if (iface->hide) iface->hide();
|
|
|
|
iface->active = EINA_FALSE;
|
|
|
|
current_iface = NULL;
|
|
|
|
/* then try to find a replacement locker */
|
|
|
|
EINA_LIST_REVERSE_FOREACH(desklock_ifaces, l, diface)
|
|
|
|
{
|
|
|
|
if (!diface->show()) continue;
|
|
|
|
diface->active = EINA_TRUE;
|
|
|
|
current_iface = diface;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* XXX: if none of the remaining lockers can lock, we're left with a black screen.
|
|
|
|
* I again blame the user for magically unloading the current locker module DURING
|
|
|
|
* desklock, but I refuse to unlock their system.
|
|
|
|
if (!current_iface) e_desklock_hide();
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2013-10-25 06:20:45 -07:00
|
|
|
e_desklock_show_hook_add(E_Desklock_Show_Cb cb)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN(cb);
|
2013-12-21 07:59:23 -08:00
|
|
|
show_hooks = eina_list_append(show_hooks, cb);
|
2013-10-25 06:20:45 -07:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2013-10-25 06:20:45 -07:00
|
|
|
e_desklock_show_hook_del(E_Desklock_Show_Cb cb)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN(cb);
|
2013-12-21 07:59:23 -08:00
|
|
|
show_hooks = eina_list_remove(show_hooks, cb);
|
2013-10-25 06:20:45 -07:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2013-10-25 06:20:45 -07:00
|
|
|
e_desklock_hide_hook_add(E_Desklock_Hide_Cb cb)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN(cb);
|
2013-12-21 07:59:23 -08:00
|
|
|
hide_hooks = eina_list_append(hide_hooks, cb);
|
2013-10-25 06:20:45 -07:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2013-10-25 06:20:45 -07:00
|
|
|
e_desklock_hide_hook_del(E_Desklock_Hide_Cb cb)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN(cb);
|
2013-12-21 07:59:23 -08:00
|
|
|
hide_hooks = eina_list_remove(hide_hooks, cb);
|
2013-10-25 06:20:45 -07:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API int
|
2009-04-26 19:54:43 -07:00
|
|
|
e_desklock_show_autolocked(void)
|
|
|
|
{
|
2009-05-06 05:00:19 -07:00
|
|
|
if (_e_desklock_autolock_time < 1.0)
|
|
|
|
_e_desklock_autolock_time = ecore_loop_time_get();
|
2012-07-17 06:33:21 -07:00
|
|
|
return e_desklock_show(EINA_FALSE);
|
2009-04-26 19:54:43 -07:00
|
|
|
}
|
|
|
|
|
2016-01-15 16:25:25 -08:00
|
|
|
E_API Eina_Bool
|
|
|
|
e_desklock_demo(void)
|
|
|
|
{
|
|
|
|
E_Desklock_Interface *iface;
|
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
if (e_desklock_is_external()) return EINA_FALSE;
|
|
|
|
EINA_LIST_REVERSE_FOREACH(desklock_ifaces, l, iface)
|
|
|
|
{
|
|
|
|
if (iface->show())
|
|
|
|
{
|
|
|
|
demo = iface->active = EINA_TRUE;
|
|
|
|
current_iface = iface;
|
|
|
|
e_comp_shape_queue();
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API int
|
2012-07-17 06:33:21 -07:00
|
|
|
e_desklock_show(Eina_Bool suspend)
|
2006-02-19 15:53:35 -08:00
|
|
|
{
|
2013-12-21 07:59:23 -08:00
|
|
|
const Eina_List *l;
|
2010-07-18 12:06:00 -07:00
|
|
|
E_Event_Desklock *ev;
|
2013-10-25 06:20:45 -07:00
|
|
|
E_Desklock_Show_Cb show_cb;
|
|
|
|
E_Desklock_Hide_Cb hide_cb;
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2013-10-25 06:20:45 -07:00
|
|
|
if (_e_desklock_state) return EINA_TRUE;
|
2006-02-26 22:35:56 -08:00
|
|
|
|
2013-10-26 01:59:32 -07:00
|
|
|
if (e_desklock_is_external() && e_config->desklock_custom_desklock_cmd && e_config->desklock_custom_desklock_cmd[0])
|
2006-12-28 18:56:26 -08:00
|
|
|
{
|
2012-12-30 23:47:51 -08:00
|
|
|
e_menu_hide_all();
|
2012-06-14 06:16:28 -07:00
|
|
|
_e_custom_desklock_exe_handler =
|
|
|
|
ecore_event_handler_add(ECORE_EXE_EVENT_DEL,
|
|
|
|
_e_desklock_cb_custom_desklock_exit, NULL);
|
2012-10-02 06:00:25 -07:00
|
|
|
if (e_config->desklock_language)
|
|
|
|
e_intl_language_set(e_config->desklock_language);
|
2012-10-02 07:04:38 -07:00
|
|
|
|
2013-01-31 09:50:45 -08:00
|
|
|
if (e_config->xkb.lock_layout)
|
|
|
|
e_xkb_layout_set(e_config->xkb.lock_layout);
|
2012-06-14 06:16:28 -07:00
|
|
|
_e_custom_desklock_exe =
|
|
|
|
ecore_exe_run(e_config->desklock_custom_desklock_cmd, NULL);
|
2012-07-09 01:03:58 -07:00
|
|
|
_e_desklock_state = EINA_TRUE;
|
2013-02-18 05:43:14 -08:00
|
|
|
/* TODO: ensure layer is correct on external desklocks? */
|
2012-06-14 06:16:28 -07:00
|
|
|
return 1;
|
2010-03-08 16:31:44 -08:00
|
|
|
}
|
2007-02-13 08:33:35 -08:00
|
|
|
|
2016-09-08 07:06:51 -07:00
|
|
|
#if ! defined(HAVE_PAM) && ! defined(__OpenBSD__)
|
2013-10-26 01:59:32 -07:00
|
|
|
if (e_desklock_is_system())
|
|
|
|
{
|
|
|
|
e_util_dialog_show(_("Error - no PAM support"),
|
|
|
|
_("No PAM support was built into Enlightenment, so<br>"
|
|
|
|
"desk locking is disabled."));
|
|
|
|
return 0;
|
|
|
|
}
|
2010-03-08 16:31:44 -08:00
|
|
|
#endif
|
|
|
|
|
2013-10-26 01:59:32 -07:00
|
|
|
if (e_desklock_is_personal())
|
2006-02-26 22:35:56 -08:00
|
|
|
{
|
2013-12-21 07:59:23 -08:00
|
|
|
if (!e_config->desklock_passwd)
|
|
|
|
{
|
|
|
|
E_Zone *zone;
|
2012-06-14 06:16:28 -07:00
|
|
|
|
2015-03-13 14:47:36 -07:00
|
|
|
zone = e_zone_current_get();
|
2013-12-21 07:59:23 -08:00
|
|
|
if (zone)
|
2014-11-02 18:35:13 -08:00
|
|
|
e_configure_registry_call("screen/screen_lock", NULL, NULL);
|
2013-12-21 07:59:23 -08:00
|
|
|
return 0;
|
|
|
|
}
|
2006-02-26 22:35:56 -08:00
|
|
|
}
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2012-12-30 23:47:51 -08:00
|
|
|
e_menu_hide_all();
|
2013-12-21 07:59:23 -08:00
|
|
|
EINA_LIST_FOREACH(show_hooks, l, show_cb)
|
2006-02-26 22:35:56 -08:00
|
|
|
{
|
2013-10-25 06:20:45 -07:00
|
|
|
if (!show_cb()) goto fail;
|
2006-02-26 22:35:56 -08:00
|
|
|
}
|
2013-12-21 07:59:23 -08:00
|
|
|
|
2015-01-05 12:27:41 -08:00
|
|
|
{
|
|
|
|
Evas_Object *o;
|
|
|
|
|
|
|
|
o = evas_object_rectangle_add(e_comp->evas);
|
|
|
|
block_rects = eina_list_append(block_rects, o);
|
|
|
|
evas_object_color_set(o, 0, 0, 0, 255);
|
2015-06-01 02:38:31 -07:00
|
|
|
evas_object_resize(o, 99999, 99999);
|
2015-01-05 12:27:41 -08:00
|
|
|
evas_object_layer_set(o, E_LAYER_DESKLOCK);
|
|
|
|
evas_object_show(o);
|
|
|
|
}
|
2012-10-02 06:00:25 -07:00
|
|
|
if (e_config->desklock_language)
|
|
|
|
e_intl_language_set(e_config->desklock_language);
|
2012-10-02 07:04:04 -07:00
|
|
|
|
2013-01-31 09:50:45 -08:00
|
|
|
if (e_config->xkb.lock_layout)
|
|
|
|
e_xkb_layout_set(e_config->xkb.lock_layout);
|
2012-10-02 07:04:04 -07:00
|
|
|
|
2016-01-15 16:25:25 -08:00
|
|
|
if (demo)
|
|
|
|
{
|
|
|
|
if (current_iface->hide)
|
|
|
|
current_iface->hide();
|
|
|
|
current_iface->active = demo = EINA_FALSE;
|
|
|
|
current_iface = NULL;
|
|
|
|
}
|
|
|
|
|
2013-12-21 07:59:23 -08:00
|
|
|
{
|
|
|
|
E_Desklock_Interface *iface;
|
|
|
|
Eina_Bool success = EINA_TRUE;
|
|
|
|
|
|
|
|
EINA_LIST_REVERSE_FOREACH(desklock_ifaces, l, iface)
|
|
|
|
{
|
|
|
|
success = iface->show();
|
|
|
|
if (success)
|
|
|
|
{
|
|
|
|
iface->active = EINA_TRUE;
|
|
|
|
current_iface = iface;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* FIXME: if someone doesn't have a locking module loaded and has
|
|
|
|
* lock-on-startup, this will result in a permanent black screen.
|
|
|
|
* I blame the user in this case since lokker is a default module
|
|
|
|
* which is really hard to disable (you have to work at it or be a gentoo user).
|
|
|
|
*/
|
|
|
|
if (!success) goto lang_fail;
|
|
|
|
}
|
2007-05-28 04:15:04 -07:00
|
|
|
|
|
|
|
ev = E_NEW(E_Event_Desklock, 1);
|
|
|
|
ev->on = 1;
|
2012-07-17 06:33:21 -07:00
|
|
|
ev->suspend = suspend;
|
2007-05-28 04:15:04 -07:00
|
|
|
ecore_event_add(E_EVENT_DESKLOCK, ev, NULL, NULL);
|
2012-06-14 06:16:28 -07:00
|
|
|
|
2013-12-19 07:53:29 -08:00
|
|
|
e_util_env_set("E_DESKLOCK_UNLOCKED", NULL);
|
2012-04-30 05:59:03 -07:00
|
|
|
e_util_env_set("E_DESKLOCK_LOCKED", "locked");
|
2012-07-09 01:03:58 -07:00
|
|
|
_e_desklock_state = EINA_TRUE;
|
2006-02-26 22:35:56 -08:00
|
|
|
return 1;
|
2013-12-21 07:59:23 -08:00
|
|
|
lang_fail:
|
|
|
|
if (e_config->desklock_language)
|
|
|
|
e_intl_language_set(e_config->language);
|
|
|
|
|
|
|
|
if (e_config_xkb_layout_eq(e_config->xkb.current_layout, e_config->xkb.lock_layout))
|
|
|
|
{
|
|
|
|
if (e_config->xkb.sel_layout)
|
|
|
|
e_xkb_layout_set(e_config->xkb.sel_layout);
|
|
|
|
}
|
2013-10-25 06:20:45 -07:00
|
|
|
fail:
|
2013-12-21 07:59:23 -08:00
|
|
|
EINA_LIST_FOREACH(hide_hooks, l, hide_cb)
|
2013-10-25 06:20:45 -07:00
|
|
|
hide_cb();
|
|
|
|
return 0;
|
2006-02-19 15:53:35 -08:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2006-02-19 15:53:35 -08:00
|
|
|
e_desklock_hide(void)
|
|
|
|
{
|
2013-10-25 06:20:45 -07:00
|
|
|
Eina_List *l;
|
2010-07-18 12:06:00 -07:00
|
|
|
E_Event_Desklock *ev;
|
2013-10-25 06:20:45 -07:00
|
|
|
E_Desklock_Hide_Cb hide_cb;
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2016-01-15 16:25:25 -08:00
|
|
|
if (demo && current_iface)
|
|
|
|
{
|
|
|
|
if (current_iface->hide)
|
|
|
|
current_iface->hide();
|
|
|
|
demo = current_iface->active = EINA_FALSE;
|
|
|
|
current_iface = NULL;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
demo = EINA_FALSE;
|
|
|
|
|
2013-12-21 07:59:23 -08:00
|
|
|
if ((!_e_desklock_state) && (!_e_custom_desklock_exe)) return;
|
2006-03-03 20:11:51 -08:00
|
|
|
|
2015-03-13 13:31:22 -07:00
|
|
|
e_comp_override_del();
|
|
|
|
e_comp_shape_queue();
|
2013-10-25 23:50:36 -07:00
|
|
|
E_FREE_LIST(block_rects, evas_object_del);
|
2013-02-18 05:43:55 -08:00
|
|
|
//e_comp_block_window_del();
|
2012-10-02 06:00:25 -07:00
|
|
|
if (e_config->desklock_language)
|
|
|
|
e_intl_language_set(e_config->language);
|
|
|
|
|
2013-01-31 09:50:45 -08:00
|
|
|
if (e_config_xkb_layout_eq(e_config->xkb.current_layout, e_config->xkb.lock_layout))
|
2012-10-03 02:00:12 -07:00
|
|
|
{
|
2013-01-31 09:50:45 -08:00
|
|
|
if (e_config->xkb.sel_layout)
|
|
|
|
e_xkb_layout_set(e_config->xkb.sel_layout);
|
2012-10-03 02:00:12 -07:00
|
|
|
}
|
2012-10-02 07:04:04 -07:00
|
|
|
|
2012-07-09 01:03:58 -07:00
|
|
|
_e_desklock_state = EINA_FALSE;
|
2012-07-09 00:47:54 -07:00
|
|
|
ev = E_NEW(E_Event_Desklock, 1);
|
|
|
|
ev->on = 0;
|
2012-07-17 06:33:21 -07:00
|
|
|
ev->suspend = 1;
|
2012-07-09 00:47:54 -07:00
|
|
|
ecore_event_add(E_EVENT_DESKLOCK, ev, NULL, NULL);
|
|
|
|
|
2013-10-26 01:59:32 -07:00
|
|
|
if (e_desklock_is_external())
|
2006-12-28 21:42:04 -08:00
|
|
|
{
|
2012-06-14 06:16:28 -07:00
|
|
|
_e_custom_desklock_exe = NULL;
|
|
|
|
return;
|
2006-12-28 21:42:04 -08:00
|
|
|
}
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2013-12-21 07:59:23 -08:00
|
|
|
EINA_LIST_FOREACH(hide_hooks, l, hide_cb)
|
2013-10-25 06:20:45 -07:00
|
|
|
hide_cb();
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2013-12-21 07:59:23 -08:00
|
|
|
if (current_iface)
|
|
|
|
{
|
|
|
|
if (current_iface->hide)
|
|
|
|
current_iface->hide();
|
|
|
|
current_iface->active = EINA_FALSE;
|
|
|
|
current_iface = NULL;
|
|
|
|
}
|
2007-05-28 04:15:04 -07:00
|
|
|
|
2009-04-26 19:54:43 -07:00
|
|
|
if (_e_desklock_autolock_time > 0.0)
|
|
|
|
{
|
2012-06-14 06:16:28 -07:00
|
|
|
if ((e_config->desklock_ask_presentation) &&
|
|
|
|
(e_config->desklock_ask_presentation_timeout > 0.0))
|
|
|
|
{
|
|
|
|
double max, now;
|
|
|
|
|
|
|
|
now = ecore_loop_time_get();
|
|
|
|
max = _e_desklock_autolock_time + e_config->desklock_ask_presentation_timeout;
|
|
|
|
if (now <= max)
|
|
|
|
_e_desklock_ask_presentation_mode();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
_e_desklock_ask_presentation_count = 0;
|
|
|
|
|
|
|
|
_e_desklock_autolock_time = 0.0;
|
2009-04-26 19:54:43 -07:00
|
|
|
}
|
2012-04-30 05:59:03 -07:00
|
|
|
e_util_env_set("E_DESKLOCK_LOCKED", "freefreefree");
|
2013-12-19 07:53:29 -08:00
|
|
|
e_util_env_set("E_DESKLOCK_UNLOCKED", "happened");
|
2006-02-19 15:53:35 -08:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API Eina_Bool
|
2012-07-09 01:03:58 -07:00
|
|
|
e_desklock_state_get(void)
|
|
|
|
{
|
|
|
|
return _e_desklock_state;
|
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_desklock_cb_custom_desklock_exit(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2006-12-28 18:56:26 -08:00
|
|
|
{
|
2010-03-08 16:31:44 -08:00
|
|
|
Ecore_Exe_Event_Del *ev = event;
|
2010-07-18 12:06:00 -07:00
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
if (ev->exe != _e_custom_desklock_exe) return ECORE_CALLBACK_PASS_ON;
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2006-12-28 18:56:26 -08:00
|
|
|
if (ev->exit_code != 0)
|
2006-12-28 21:42:04 -08:00
|
|
|
{
|
2012-06-14 06:16:28 -07:00
|
|
|
/* do something profound here... like notify someone */
|
2006-12-28 21:42:04 -08:00
|
|
|
}
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2006-12-28 18:56:26 -08:00
|
|
|
e_desklock_hide();
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_DONE;
|
2006-12-28 18:56:26 -08:00
|
|
|
}
|
2007-04-04 04:43:36 -07:00
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_desklock_cb_idle_poller(void *data EINA_UNUSED)
|
2007-04-04 04:43:36 -07:00
|
|
|
{
|
2013-01-14 09:26:13 -08:00
|
|
|
if ((e_config->desklock_autolock_idle) && (!e_config->mode.presentation))
|
2007-04-04 04:43:36 -07:00
|
|
|
{
|
2014-03-11 04:24:41 -07:00
|
|
|
double idle = 0.0, max;
|
2009-04-26 19:54:43 -07:00
|
|
|
|
2012-06-14 06:16:28 -07:00
|
|
|
/* If a desklock is already up, bail */
|
2013-12-21 07:59:23 -08:00
|
|
|
if ((_e_custom_desklock_exe) || (_e_desklock_state)) return ECORE_CALLBACK_RENEW;
|
2007-04-04 04:43:36 -07:00
|
|
|
|
2014-03-11 04:24:41 -07:00
|
|
|
#ifndef HAVE_WAYLAND_ONLY
|
2015-07-28 09:31:22 -07:00
|
|
|
if (e_comp->comp_type == E_PIXMAP_TYPE_X)
|
|
|
|
idle = ecore_x_screensaver_idle_time_get();
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_WAYLAND
|
|
|
|
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
|
|
|
idle = e_comp_wl_idle_time_get();
|
2014-03-11 04:24:41 -07:00
|
|
|
#endif
|
2015-01-16 11:44:23 -08:00
|
|
|
|
2012-06-14 06:16:28 -07:00
|
|
|
max = e_config->desklock_autolock_idle_timeout;
|
|
|
|
if (_e_desklock_ask_presentation_count > 0)
|
|
|
|
max *= (1 + _e_desklock_ask_presentation_count);
|
2009-04-26 19:54:43 -07:00
|
|
|
|
2012-06-14 06:16:28 -07:00
|
|
|
/* If we have exceeded our idle time... */
|
2009-04-26 19:54:43 -07:00
|
|
|
if (idle >= max)
|
2012-06-14 06:16:28 -07:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
* 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;
|
2009-04-26 19:54:43 -07:00
|
|
|
e_desklock_show_autolocked();
|
2012-06-14 06:16:28 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
_e_desklock_user_idle = 0;
|
2007-04-04 04:43:36 -07:00
|
|
|
}
|
|
|
|
|
2008-01-10 23:33:57 -08:00
|
|
|
/* Make sure our poller persists. */
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_RENEW;
|
2007-04-04 04:43:36 -07:00
|
|
|
}
|
2009-04-26 19:54:43 -07:00
|
|
|
|
|
|
|
static void
|
|
|
|
_e_desklock_ask_presentation_del(void *data)
|
|
|
|
{
|
|
|
|
if (_e_desklock_ask_presentation_dia == data)
|
|
|
|
_e_desklock_ask_presentation_dia = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_desklock_ask_presentation_yes(void *data EINA_UNUSED, E_Dialog *dia)
|
2009-04-26 19:54:43 -07:00
|
|
|
{
|
|
|
|
e_config->mode.presentation = 1;
|
|
|
|
e_config_mode_changed();
|
|
|
|
e_config_save_queue();
|
|
|
|
e_object_del(E_OBJECT(dia));
|
|
|
|
_e_desklock_ask_presentation_count = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_desklock_ask_presentation_no(void *data EINA_UNUSED, E_Dialog *dia)
|
2009-04-26 19:54:43 -07:00
|
|
|
{
|
|
|
|
e_object_del(E_OBJECT(dia));
|
|
|
|
_e_desklock_ask_presentation_count = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_desklock_ask_presentation_no_increase(void *data EINA_UNUSED, E_Dialog *dia)
|
2009-04-26 19:54:43 -07:00
|
|
|
{
|
2015-07-28 09:31:22 -07:00
|
|
|
int timeout, blanking, expose;
|
2009-04-26 19:54:43 -07:00
|
|
|
|
|
|
|
_e_desklock_ask_presentation_count++;
|
|
|
|
timeout = e_config->screensaver_timeout * _e_desklock_ask_presentation_count;
|
|
|
|
blanking = e_config->screensaver_blanking;
|
|
|
|
expose = e_config->screensaver_expose;
|
|
|
|
|
2015-07-28 09:31:22 -07:00
|
|
|
e_screensaver_attrs_set(timeout, blanking, expose);
|
|
|
|
e_screensaver_update();
|
2009-04-26 19:54:43 -07:00
|
|
|
e_object_del(E_OBJECT(dia));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_desklock_ask_presentation_no_forever(void *data EINA_UNUSED, E_Dialog *dia)
|
2009-04-26 19:54:43 -07:00
|
|
|
{
|
|
|
|
e_config->desklock_ask_presentation = 0;
|
|
|
|
e_config_save_queue();
|
|
|
|
e_object_del(E_OBJECT(dia));
|
|
|
|
_e_desklock_ask_presentation_count = 0;
|
|
|
|
}
|
|
|
|
|
2009-05-06 05:00:19 -07:00
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_desklock_ask_presentation_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *o EINA_UNUSED, void *event)
|
2009-05-06 05:00:19 -07:00
|
|
|
{
|
|
|
|
Evas_Event_Key_Down *ev = event;
|
|
|
|
E_Dialog *dia = data;
|
|
|
|
|
2014-03-13 10:00:57 -07:00
|
|
|
if (strcmp(ev->key, "Return") == 0)
|
2009-05-06 05:00:19 -07:00
|
|
|
_e_desklock_ask_presentation_yes(NULL, dia);
|
2014-03-13 10:00:57 -07:00
|
|
|
else if (strcmp(ev->key, "Escape") == 0)
|
2009-05-06 05:00:19 -07:00
|
|
|
_e_desklock_ask_presentation_no(NULL, dia);
|
|
|
|
}
|
|
|
|
|
2009-04-26 19:54:43 -07:00
|
|
|
static void
|
|
|
|
_e_desklock_ask_presentation_mode(void)
|
|
|
|
{
|
|
|
|
E_Dialog *dia;
|
|
|
|
|
2010-07-18 12:06:00 -07:00
|
|
|
if (_e_desklock_ask_presentation_dia) return;
|
2009-04-26 19:54:43 -07:00
|
|
|
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
if (!(dia = e_dialog_new(NULL, "E", "_desklock_ask_presentation"))) return;
|
2009-04-26 19:54:43 -07:00
|
|
|
|
|
|
|
e_dialog_title_set(dia, _("Activate Presentation Mode?"));
|
|
|
|
e_dialog_icon_set(dia, "dialog-ask", 64);
|
2010-07-18 12:06:00 -07:00
|
|
|
e_dialog_text_set(dia,
|
2012-11-30 07:39:17 -08:00
|
|
|
_("You unlocked your desktop too fast.<br><br>"
|
2012-06-14 06:16:28 -07:00
|
|
|
"Would you like to enable <b>presentation</b> mode and "
|
|
|
|
"temporarily disable screen saver, lock and power saving?"));
|
|
|
|
|
|
|
|
e_object_del_attach_func_set(E_OBJECT(dia),
|
|
|
|
_e_desklock_ask_presentation_del);
|
|
|
|
e_dialog_button_add(dia, _("Yes"), NULL,
|
|
|
|
_e_desklock_ask_presentation_yes, NULL);
|
|
|
|
e_dialog_button_add(dia, _("No"), NULL,
|
|
|
|
_e_desklock_ask_presentation_no, NULL);
|
2010-07-18 12:06:00 -07:00
|
|
|
e_dialog_button_add(dia, _("No, but increase timeout"), NULL,
|
2012-06-14 06:16:28 -07:00
|
|
|
_e_desklock_ask_presentation_no_increase, NULL);
|
2010-07-18 12:06:00 -07:00
|
|
|
e_dialog_button_add(dia, _("No, and stop asking"), NULL,
|
2012-06-14 06:16:28 -07:00
|
|
|
_e_desklock_ask_presentation_no_forever, NULL);
|
2009-04-26 19:54:43 -07:00
|
|
|
|
|
|
|
e_dialog_button_focus_num(dia, 0);
|
|
|
|
e_widget_list_homogeneous_set(dia->box_object, 0);
|
2014-11-02 18:35:13 -08:00
|
|
|
elm_win_center(dia->win, 1, 1);
|
2009-04-26 19:54:43 -07:00
|
|
|
e_dialog_show(dia);
|
|
|
|
|
2010-07-18 12:06:00 -07:00
|
|
|
evas_object_event_callback_add(dia->bg_object, EVAS_CALLBACK_KEY_DOWN,
|
2012-06-14 06:16:28 -07:00
|
|
|
_e_desklock_ask_presentation_key_down, dia);
|
2009-05-06 05:00:19 -07:00
|
|
|
|
2009-04-26 19:54:43 -07:00
|
|
|
_e_desklock_ask_presentation_dia = dia;
|
|
|
|
}
|
2012-07-17 06:33:21 -07:00
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_e_desklock_run(E_Desklock_Run *task)
|
|
|
|
{
|
|
|
|
Efreet_Desktop *desktop;
|
|
|
|
|
|
|
|
desktop = eina_list_nth(task->desk_run->desktops, task->position++);
|
|
|
|
if (!desktop)
|
|
|
|
{
|
|
|
|
e_object_del(E_OBJECT(task->desk_run));
|
|
|
|
free(task);
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
e_exec(NULL, desktop, NULL, NULL, NULL);
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_desklock_job(void *data EINA_UNUSED)
|
2012-07-17 06:33:21 -07:00
|
|
|
{
|
|
|
|
E_Desklock_Run *task;
|
|
|
|
|
|
|
|
job = NULL;
|
2013-01-11 02:34:29 -08:00
|
|
|
if (!tasks) return;
|
2012-07-17 06:33:21 -07:00
|
|
|
|
|
|
|
task = eina_list_data_get(tasks);
|
|
|
|
if (!_e_desklock_run(task))
|
|
|
|
tasks = eina_list_remove_list(tasks, tasks);
|
|
|
|
|
|
|
|
if (tasks) job = ecore_job_add(_e_desklock_job, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_desklock_cb_run(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2012-07-17 06:33:21 -07:00
|
|
|
{
|
|
|
|
E_Desklock_Run *task;
|
|
|
|
E_Event_Desklock *ev = event;
|
|
|
|
E_Order *desk_run;
|
|
|
|
char buf[PATH_MAX];
|
|
|
|
|
|
|
|
if (!ev->suspend) return ECORE_CALLBACK_PASS_ON;
|
|
|
|
|
|
|
|
if (ev->on)
|
|
|
|
{
|
|
|
|
e_user_dir_concat_static(buf, "applications/desk-lock/.order");
|
|
|
|
if (!ecore_file_exists(buf))
|
|
|
|
e_prefix_data_concat_static(buf, "applications/desk-lock/.order");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
e_user_dir_concat_static(buf, "applications/desk-unlock/.order");
|
|
|
|
if (!ecore_file_exists(buf))
|
|
|
|
e_prefix_data_concat_static(buf, "applications/desk-unlock/.order");
|
|
|
|
}
|
|
|
|
|
|
|
|
desk_run = e_order_new(buf);
|
|
|
|
if (!desk_run) return ECORE_CALLBACK_PASS_ON;
|
|
|
|
|
|
|
|
task = calloc(1, sizeof (E_Desklock_Run));
|
|
|
|
if (!task)
|
|
|
|
{
|
|
|
|
e_object_del(E_OBJECT(desk_run));
|
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
|
|
|
|
|
|
|
task->desk_run = desk_run;
|
|
|
|
tasks = eina_list_append(tasks, task);
|
|
|
|
|
|
|
|
if (!job) ecore_job_add(_e_desklock_job, NULL);
|
|
|
|
|
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
|
|
|
|
2015-06-01 02:38:31 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_e_desklock_cb_randr(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
|
|
|
|
{
|
|
|
|
if (!_e_desklock_state) return ECORE_CALLBACK_PASS_ON;
|
|
|
|
e_desklock_hide();
|
|
|
|
e_desklock_show(EINA_FALSE);
|
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|