2006-02-19 15:53:35 -08:00
|
|
|
#include "e.h"
|
2006-03-31 09:26:38 -08:00
|
|
|
#ifdef HAVE_PAM
|
2006-04-17 20:08:43 -07:00
|
|
|
# include <security/pam_appl.h>
|
|
|
|
# include <pwd.h>
|
2006-03-31 09:26:38 -08:00
|
|
|
#endif
|
|
|
|
|
2012-06-14 06:16:28 -07:00
|
|
|
#define E_DESKLOCK_STATE_DEFAULT 0
|
2007-04-18 20:44:47 -07:00
|
|
|
#define E_DESKLOCK_STATE_CHECKING 1
|
2012-06-14 06:16:28 -07:00
|
|
|
#define E_DESKLOCK_STATE_INVALID 2
|
2007-04-18 20:44:47 -07:00
|
|
|
|
2012-06-14 06:16:28 -07:00
|
|
|
#define PASSWD_LEN 256
|
2006-02-19 15:53:35 -08:00
|
|
|
|
2006-02-22 06:35:04 -08:00
|
|
|
/**************************** private data ******************************/
|
2012-06-14 06:16:28 -07:00
|
|
|
typedef struct _E_Desklock_Data E_Desklock_Data;
|
2007-03-10 21:01:49 -08:00
|
|
|
typedef struct _E_Desklock_Popup_Data E_Desklock_Popup_Data;
|
2006-04-17 20:14:29 -07:00
|
|
|
#ifdef HAVE_PAM
|
2007-03-10 21:01:49 -08:00
|
|
|
typedef struct _E_Desklock_Auth E_Desklock_Auth;
|
2006-04-17 20:14:29 -07:00
|
|
|
#endif
|
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
|
|
|
|
2006-02-26 13:42:19 -08:00
|
|
|
struct _E_Desklock_Popup_Data
|
|
|
|
{
|
2013-02-18 05:43:14 -08:00
|
|
|
E_Zone *zone;
|
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
|
|
|
Evas_Object *comp_object;
|
2007-03-10 21:01:49 -08:00
|
|
|
Evas_Object *bg_object;
|
|
|
|
Evas_Object *login_box;
|
2006-02-26 13:42:19 -08:00
|
|
|
};
|
2006-02-22 06:35:04 -08:00
|
|
|
|
|
|
|
struct _E_Desklock_Data
|
|
|
|
{
|
2013-01-11 02:34:29 -08:00
|
|
|
Eina_List *elock_wnd_list;
|
|
|
|
Ecore_X_Window elock_wnd;
|
|
|
|
Eina_List *handlers;
|
2012-07-16 06:21:31 -07:00
|
|
|
Ecore_Event_Handler *move_handler;
|
2013-01-11 02:34:29 -08:00
|
|
|
Ecore_X_Window elock_grab_break_wnd;
|
|
|
|
char passwd[PASSWD_LEN];
|
|
|
|
int state;
|
|
|
|
Eina_Bool selected : 1;
|
2006-02-22 06:35:04 -08: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
|
|
|
};
|
|
|
|
|
2006-04-17 20:14:29 -07:00
|
|
|
#ifdef HAVE_PAM
|
|
|
|
struct _E_Desklock_Auth
|
|
|
|
{
|
2012-06-14 06:16:28 -07:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
struct pam_conv conv;
|
|
|
|
pam_handle_t *handle;
|
|
|
|
} pam;
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2012-08-22 00:02:41 -07:00
|
|
|
char user[4096];
|
|
|
|
char passwd[4096];
|
2006-04-17 20:14:29 -07:00
|
|
|
};
|
|
|
|
#endif
|
2006-02-19 15:53:35 -08:00
|
|
|
|
2010-07-18 12:06:00 -07:00
|
|
|
static E_Desklock_Data *edd = NULL;
|
|
|
|
static E_Zone *last_active_zone = NULL;
|
2006-04-17 20:14:29 -07:00
|
|
|
#ifdef HAVE_PAM
|
|
|
|
static Ecore_Event_Handler *_e_desklock_exit_handler = NULL;
|
2007-03-10 21:01:49 -08:00
|
|
|
static pid_t _e_desklock_child_pid = -1;
|
2006-04-17 20:14:29 -07:00
|
|
|
#endif
|
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;
|
|
|
|
static Ecore_Job *job = NULL;
|
|
|
|
static Eina_List *tasks = NULL;
|
|
|
|
|
2006-02-22 06:35:04 -08:00
|
|
|
/***********************************************************************/
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool _e_desklock_cb_key_down(void *data, int type, void *event);
|
|
|
|
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);
|
2012-04-30 05:28:57 -07:00
|
|
|
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);
|
2006-02-19 15:53:35 -08:00
|
|
|
|
2012-07-17 06:33:21 -07:00
|
|
|
static Eina_Bool _e_desklock_cb_run(void *data, int type, void *event);
|
|
|
|
|
2012-07-16 05:23:37 -07:00
|
|
|
static void _e_desklock_popup_free(E_Desklock_Popup_Data *edp);
|
|
|
|
static void _e_desklock_popup_add(E_Zone *zone);
|
|
|
|
static void _e_desklock_login_box_add(E_Desklock_Popup_Data *edp);
|
2012-07-20 06:30:58 -07:00
|
|
|
static void _e_desklock_select(void);
|
|
|
|
static void _e_desklock_unselect(void);
|
2012-06-14 06:16:28 -07:00
|
|
|
static void _e_desklock_null(void);
|
|
|
|
static void _e_desklock_passwd_update(void);
|
|
|
|
static void _e_desklock_backspace(void);
|
|
|
|
static void _e_desklock_delete(void);
|
|
|
|
static int _e_desklock_zone_num_get(void);
|
|
|
|
static int _e_desklock_check_auth(void);
|
|
|
|
static void _e_desklock_state_set(int state);
|
2006-03-31 09:26:38 -08: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
|
|
|
#ifdef HAVE_PAM
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool _e_desklock_cb_exit(void *data, int type, void *event);
|
2012-06-14 06:16:28 -07:00
|
|
|
static int _desklock_auth(char *passwd);
|
|
|
|
static int _desklock_pam_init(E_Desklock_Auth *da);
|
|
|
|
static int _desklock_auth_pam_conv(int num_msg, const struct pam_message **msg, struct pam_response **resp, void *appdata_ptr);
|
|
|
|
static char *_desklock_auth_get_current_user(void);
|
|
|
|
static char *_desklock_auth_get_current_host(void);
|
2006-04-17 20:14:29 -07:00
|
|
|
#endif
|
|
|
|
|
2012-06-14 06:16:28 -07:00
|
|
|
static void _e_desklock_ask_presentation_mode(void);
|
2009-04-26 19:54:43 -07:00
|
|
|
|
2007-05-28 04:15:04 -07:00
|
|
|
EAPI 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
|
|
|
|
2006-10-20 19:32:14 -07:00
|
|
|
if (e_config->desklock_background)
|
2006-12-28 21:42:04 -08:00
|
|
|
e_filereg_register(e_config->desklock_background);
|
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
|
|
|
|
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)
|
|
|
|
{
|
2012-04-30 05:59:03 -07:00
|
|
|
Eina_Bool waslocked = EINA_FALSE;
|
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
|
|
|
|
2012-04-30 05:59:03 -07:00
|
|
|
if (edd) waslocked = EINA_TRUE;
|
2011-02-15 21:20:13 -08:00
|
|
|
if (!x_fatal)
|
2012-06-14 06:16:28 -07:00
|
|
|
e_desklock_hide();
|
2006-10-20 19:32:14 -07:00
|
|
|
if (e_config->desklock_background)
|
2006-12-28 21:42:04 -08:00
|
|
|
e_filereg_deregister(e_config->desklock_background);
|
2012-06-14 06:16:28 -07:00
|
|
|
|
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;
|
|
|
|
|
|
|
|
if (job) ecore_job_del(job);
|
|
|
|
job = NULL;
|
|
|
|
|
2012-09-19 06:31:35 -07:00
|
|
|
if (e_config->desklock_background)
|
|
|
|
e_filereg_deregister(e_config->desklock_background);
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2009-04-25 11:32:34 -07:00
|
|
|
static const char *
|
2012-09-19 06:51:19 -07:00
|
|
|
_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
|
|
|
{
|
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 ((cdbg->manager > -1) && (cdbg->manager != (int)zone->comp->num)) continue;
|
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
|
|
|
}
|
|
|
|
|
2009-04-26 19:54:43 -07:00
|
|
|
EAPI int
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2006-02-19 15:53:35 -08:00
|
|
|
EAPI int
|
2012-07-17 06:33:21 -07:00
|
|
|
e_desklock_show(Eina_Bool suspend)
|
2006-02-19 15:53:35 -08: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
|
|
|
Eina_List *managers, *l, *l3;
|
2010-07-18 12:06:00 -07:00
|
|
|
E_Manager *man;
|
2012-07-16 05:23:37 -07:00
|
|
|
int total_zone_num;
|
2010-07-18 12:06:00 -07:00
|
|
|
E_Event_Desklock *ev;
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2007-02-13 08:33:35 -08:00
|
|
|
if (_e_custom_desklock_exe) return 0;
|
2006-02-26 22:35:56 -08:00
|
|
|
|
2012-06-08 02:37:57 -07:00
|
|
|
if (e_config->desklock_use_custom_desklock && 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
|
|
|
|
|
|
|
#ifndef HAVE_PAM
|
|
|
|
e_util_dialog_show(_("Error - no PAM support"),
|
2012-06-14 06:16:28 -07:00
|
|
|
_("No PAM support was built into Enlightenment, so<br>"
|
|
|
|
"desk locking is disabled."));
|
2007-02-13 08:33:35 -08:00
|
|
|
return 0;
|
2010-03-08 16:31:44 -08:00
|
|
|
#endif
|
|
|
|
|
2006-12-28 18:56:26 -08:00
|
|
|
if (edd) return 0;
|
|
|
|
|
2006-03-31 09:26:38 -08:00
|
|
|
#ifdef HAVE_PAM
|
2006-04-17 20:08:43 -07:00
|
|
|
if (e_config->desklock_auth_method == 1)
|
2006-02-26 22:35:56 -08:00
|
|
|
{
|
2006-03-31 09:26:38 -08:00
|
|
|
#endif
|
2012-06-14 06:16:28 -07:00
|
|
|
if (!e_config->desklock_personal_passwd)
|
|
|
|
{
|
|
|
|
E_Zone *zone;
|
|
|
|
|
|
|
|
zone = e_util_zone_current_get(e_manager_current_get());
|
|
|
|
if (zone)
|
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
|
|
|
e_configure_registry_call("screen/screen_lock", zone->comp, NULL);
|
2012-06-14 06:16:28 -07:00
|
|
|
return 0;
|
2006-02-26 22:35:56 -08:00
|
|
|
}
|
2012-06-14 06:16:28 -07:00
|
|
|
#ifdef HAVE_PAM
|
|
|
|
}
|
|
|
|
|
2006-03-31 09:26:38 -08:00
|
|
|
#endif
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2006-03-03 20:11:51 -08:00
|
|
|
edd = E_NEW(E_Desklock_Data, 1);
|
|
|
|
if (!edd) return 0;
|
2012-07-16 05:23:37 -07:00
|
|
|
edd->elock_wnd = ecore_x_window_input_new(e_manager_current_get()->root, 0, 0, 1, 1);
|
2006-03-03 20:11:51 -08:00
|
|
|
ecore_x_window_show(edd->elock_wnd);
|
|
|
|
managers = e_manager_list();
|
2012-12-30 23:47:51 -08:00
|
|
|
e_menu_hide_all();
|
2006-03-03 20:11:51 -08:00
|
|
|
if (!e_grabinput_get(edd->elock_wnd, 0, edd->elock_wnd))
|
2006-02-26 22:35:56 -08:00
|
|
|
{
|
2012-06-14 06:16:28 -07:00
|
|
|
EINA_LIST_FOREACH(managers, l, man)
|
|
|
|
{
|
|
|
|
Ecore_X_Window *windows;
|
|
|
|
int wnum;
|
|
|
|
|
|
|
|
windows = ecore_x_window_children_get(man->root, &wnum);
|
|
|
|
if (windows)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < wnum; i++)
|
|
|
|
{
|
|
|
|
Ecore_X_Window_Attributes att;
|
|
|
|
|
|
|
|
memset(&att, 0, sizeof(Ecore_X_Window_Attributes));
|
|
|
|
ecore_x_window_attributes_get(windows[i], &att);
|
|
|
|
if (att.visible)
|
|
|
|
{
|
|
|
|
ecore_x_window_hide(windows[i]);
|
|
|
|
if (e_grabinput_get(edd->elock_wnd, 0, edd->elock_wnd))
|
|
|
|
{
|
|
|
|
edd->elock_grab_break_wnd = windows[i];
|
|
|
|
free(windows);
|
|
|
|
goto works;
|
|
|
|
}
|
|
|
|
ecore_x_window_show(windows[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
free(windows);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* everything failed - can't lock */
|
|
|
|
e_util_dialog_show(_("Lock Failed"),
|
|
|
|
_("Locking the desktop failed because some application<br>"
|
|
|
|
"has grabbed either the keyboard or the mouse or both<br>"
|
|
|
|
"and their grab is unable to be broken."));
|
|
|
|
ecore_x_window_free(edd->elock_wnd);
|
|
|
|
E_FREE(edd);
|
|
|
|
return 0;
|
2006-02-26 22:35:56 -08:00
|
|
|
}
|
2012-06-14 06:16:28 -07:00
|
|
|
works:
|
2013-02-18 05:43:55 -08:00
|
|
|
//e_comp_block_window_add();
|
|
|
|
E_LIST_FOREACH(e_comp_list(), e_comp_override_add);
|
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
|
|
|
e_comp_ignore_win_add(E_PIXMAP_TYPE_X, edd->elock_wnd);
|
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
|
|
|
|
2006-03-02 16:02:32 -08:00
|
|
|
total_zone_num = _e_desklock_zone_num_get();
|
2009-08-21 08:08:49 -07:00
|
|
|
EINA_LIST_FOREACH(managers, l, man)
|
2006-02-26 22:35:56 -08: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
|
|
|
E_Zone *zone;
|
|
|
|
EINA_LIST_FOREACH(man->comp->zones, l3, zone)
|
|
|
|
_e_desklock_popup_add(zone);
|
2006-02-26 22:35:56 -08:00
|
|
|
}
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2006-02-26 22:35:56 -08:00
|
|
|
/* handlers */
|
2013-02-18 05:43:05 -08:00
|
|
|
E_LIST_HANDLER_APPEND(edd->handlers, ECORE_EVENT_KEY_DOWN, _e_desklock_cb_key_down, NULL);
|
|
|
|
E_LIST_HANDLER_APPEND(edd->handlers, E_EVENT_ZONE_ADD, _e_desklock_cb_zone_add, NULL);
|
|
|
|
E_LIST_HANDLER_APPEND(edd->handlers, E_EVENT_ZONE_DEL, _e_desklock_cb_zone_del, NULL);
|
|
|
|
E_LIST_HANDLER_APPEND(edd->handlers, E_EVENT_ZONE_MOVE_RESIZE, _e_desklock_cb_zone_move_resize, NULL);
|
2010-07-18 12:06:00 -07:00
|
|
|
|
2012-06-14 06:16:28 -07:00
|
|
|
if ((total_zone_num > 1) && (e_config->desklock_login_box_zone == -2))
|
2012-07-16 06:21:31 -07:00
|
|
|
edd->move_handler = ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE, _e_desklock_cb_mouse_move, NULL);
|
2010-07-18 12:06:00 -07:00
|
|
|
|
2006-02-26 22:35:56 -08:00
|
|
|
_e_desklock_passwd_update();
|
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;
|
2006-02-19 15:53:35 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
e_desklock_hide(void)
|
|
|
|
{
|
2010-07-18 12:06:00 -07:00
|
|
|
E_Event_Desklock *ev;
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2010-12-27 08:17:12 -08:00
|
|
|
if ((!edd) && (!_e_custom_desklock_exe)) return;
|
2006-03-03 20:11:51 -08:00
|
|
|
|
2013-02-18 05:43:55 -08:00
|
|
|
E_LIST_FOREACH(e_comp_list(), e_comp_override_del);
|
2013-11-27 07:25:36 -08:00
|
|
|
E_LIST_FOREACH(e_comp_list(), e_comp_shape_queue);
|
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);
|
|
|
|
|
2007-02-13 08:33:35 -08:00
|
|
|
if (e_config->desklock_use_custom_desklock)
|
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
|
|
|
|
2012-06-14 06:27:49 -07:00
|
|
|
if (!edd) return;
|
2006-03-03 20:11:51 -08:00
|
|
|
if (edd->elock_grab_break_wnd)
|
|
|
|
ecore_x_window_show(edd->elock_grab_break_wnd);
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2013-02-18 05:43:14 -08:00
|
|
|
E_FREE_LIST(edd->elock_wnd_list, _e_desklock_popup_free);
|
2009-08-21 08:08:49 -07:00
|
|
|
E_FREE_LIST(edd->handlers, ecore_event_handler_del);
|
2012-07-16 06:21:31 -07:00
|
|
|
if (edd->move_handler) ecore_event_handler_del(edd->move_handler);
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2006-02-26 22:35:56 -08:00
|
|
|
e_grabinput_release(edd->elock_wnd, edd->elock_wnd);
|
2009-04-10 02:57:57 -07:00
|
|
|
ecore_x_window_free(edd->elock_wnd);
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2006-02-26 22:35:56 -08:00
|
|
|
E_FREE(edd);
|
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
|
|
|
}
|
|
|
|
|
2012-07-16 05:23:37 -07:00
|
|
|
static void
|
|
|
|
_e_desklock_popup_add(E_Zone *zone)
|
|
|
|
{
|
|
|
|
E_Desklock_Popup_Data *edp;
|
|
|
|
E_Config_Desklock_Background *cbg;
|
|
|
|
const char *bg;
|
2013-02-18 05:43:14 -08:00
|
|
|
Evas *evas;
|
2012-07-16 05:23:37 -07:00
|
|
|
|
|
|
|
cbg = eina_list_nth(e_config->desklock_backgrounds, zone->num);
|
|
|
|
bg = cbg ? cbg->file : NULL;
|
|
|
|
edp = E_NEW(E_Desklock_Popup_Data, 1);
|
|
|
|
|
2013-02-18 05:43:14 -08:00
|
|
|
edp->zone = zone;
|
|
|
|
evas = e_comp_get(zone)->evas;
|
|
|
|
evas_event_freeze(evas);
|
|
|
|
edp->bg_object = edje_object_add(evas);
|
2013-02-18 05:43:47 -08:00
|
|
|
evas_object_name_set(edp->bg_object, "desklock->bg_object");
|
2012-07-16 05:23:37 -07:00
|
|
|
|
|
|
|
if ((!bg) || (!strcmp(bg, "theme_desklock_background")))
|
|
|
|
{
|
|
|
|
e_theme_edje_object_set(edp->bg_object,
|
|
|
|
"base/theme/desklock",
|
|
|
|
"e/desklock/background");
|
|
|
|
}
|
|
|
|
else if (!strcmp(bg, "theme_background"))
|
|
|
|
{
|
|
|
|
e_theme_edje_object_set(edp->bg_object,
|
|
|
|
"base/theme/backgrounds",
|
|
|
|
"e/desktop/background");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const char *f;
|
|
|
|
|
|
|
|
if (!strcmp(bg, "user_background"))
|
2012-09-19 06:51:19 -07:00
|
|
|
f = _user_wallpaper_get(zone);
|
2012-07-16 05:23:37 -07:00
|
|
|
else
|
|
|
|
f = bg;
|
|
|
|
|
|
|
|
if (e_util_edje_collection_exists(f, "e/desklock/background"))
|
|
|
|
{
|
|
|
|
edje_object_file_set(edp->bg_object, f, "e/desklock/background");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!edje_object_file_set(edp->bg_object,
|
|
|
|
f, "e/desktop/background"))
|
|
|
|
{
|
|
|
|
edje_object_file_set(edp->bg_object,
|
|
|
|
e_theme_edje_file_get("base/theme/desklock",
|
|
|
|
"e/desklock/background"),
|
|
|
|
"e/desklock/background");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-02-18 05:43:14 -08:00
|
|
|
evas_object_move(edp->bg_object, zone->x, zone->y);
|
2012-07-16 05:23:37 -07:00
|
|
|
evas_object_resize(edp->bg_object, zone->w, zone->h);
|
2013-02-25 06:04:12 -08:00
|
|
|
evas_object_show(edp->bg_object);
|
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
|
|
|
edp->comp_object = e_comp_object_util_add(edp->bg_object, 0);
|
|
|
|
evas_object_layer_set(edp->comp_object, E_LAYER_DESKLOCK);
|
|
|
|
evas_object_clip_set(edp->comp_object, edp->zone->bg_clip_object);
|
2012-07-16 05:23:37 -07:00
|
|
|
|
|
|
|
_e_desklock_login_box_add(edp);
|
2013-02-18 05:43:14 -08:00
|
|
|
evas_event_thaw(evas);
|
2012-07-16 05:23:37 -07:00
|
|
|
|
|
|
|
edd->elock_wnd_list = eina_list_append(edd->elock_wnd_list, edp);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_desklock_login_box_add(E_Desklock_Popup_Data *edp)
|
|
|
|
{
|
|
|
|
int mw, mh;
|
2013-02-18 05:43:14 -08:00
|
|
|
E_Zone *zone, *current_zone;
|
2012-07-16 05:23:37 -07:00
|
|
|
int total_zone_num;
|
2013-02-18 05:43:14 -08:00
|
|
|
Evas *evas;
|
2012-07-16 05:23:37 -07:00
|
|
|
|
2013-02-18 05:43:14 -08:00
|
|
|
zone = edp->zone;
|
|
|
|
last_active_zone = current_zone = e_util_zone_current_get(e_manager_current_get());
|
2012-07-16 05:30:31 -07:00
|
|
|
total_zone_num = _e_desklock_zone_num_get();
|
|
|
|
if (total_zone_num > 1)
|
|
|
|
{
|
|
|
|
if ((e_config->desklock_login_box_zone == -2) && (zone != current_zone))
|
|
|
|
return;
|
2012-07-16 05:38:17 -07:00
|
|
|
if ((e_config->desklock_login_box_zone > -1) && (e_config->desklock_login_box_zone != (int)eina_list_count(edd->elock_wnd_list)))
|
2012-07-16 05:30:31 -07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-02-18 05:43:14 -08:00
|
|
|
evas = evas_object_evas_get(edp->bg_object);
|
|
|
|
edp->login_box = edje_object_add(evas);
|
2013-02-18 05:43:47 -08:00
|
|
|
evas_object_name_set(edp->login_box, "desklock->login_box");
|
2012-07-16 05:23:37 -07:00
|
|
|
e_theme_edje_object_set(edp->login_box,
|
|
|
|
"base/theme/desklock",
|
|
|
|
"e/desklock/login_box");
|
|
|
|
edje_object_part_text_set(edp->login_box, "e.text.title",
|
|
|
|
_("Please enter your unlock password"));
|
|
|
|
edje_object_size_min_calc(edp->login_box, &mw, &mh);
|
|
|
|
if (edje_object_part_exists(edp->bg_object, "e.swallow.login_box"))
|
|
|
|
{
|
|
|
|
edje_extern_object_min_size_set(edp->login_box, mw, mh);
|
|
|
|
edje_object_part_swallow(edp->bg_object, "e.swallow.login_box", edp->login_box);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
evas_object_resize(edp->login_box, mw, mh);
|
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
|
|
|
e_comp_object_util_center_on(edp->login_box, edp->comp_object);
|
2013-02-25 06:04:12 -08:00
|
|
|
evas_object_show(edp->login_box);
|
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
|
|
|
evas_object_layer_set(edp->login_box, E_LAYER_DESKLOCK);
|
|
|
|
evas_object_stack_above(edp->login_box, edp->comp_object);
|
2012-07-16 05:23:37 -07:00
|
|
|
}
|
2013-02-18 05:43:14 -08:00
|
|
|
|
|
|
|
evas_object_clip_set(edp->login_box, edp->zone->bg_clip_object);
|
2012-07-16 05:23:37 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_desklock_popup_free(E_Desklock_Popup_Data *edp)
|
|
|
|
{
|
|
|
|
if (!edp) return;
|
|
|
|
|
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
|
|
|
evas_object_hide(edp->comp_object);
|
|
|
|
evas_object_del(edp->comp_object);
|
2012-07-16 05:23:37 -07:00
|
|
|
evas_object_del(edp->bg_object);
|
|
|
|
evas_object_del(edp->login_box);
|
|
|
|
|
2012-12-14 05:04:32 -08:00
|
|
|
free(edp);
|
2012-07-16 05:23:37 -07:00
|
|
|
}
|
|
|
|
|
2012-07-09 01:03:58 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
e_desklock_state_get(void)
|
|
|
|
{
|
|
|
|
return _e_desklock_state;
|
|
|
|
}
|
|
|
|
|
2012-07-16 05:23:37 -07:00
|
|
|
static Eina_List *
|
|
|
|
_e_desklock_popup_find(E_Zone *zone)
|
2012-04-30 05:28:57 -07:00
|
|
|
{
|
2012-07-16 05:23:37 -07:00
|
|
|
Eina_List *l;
|
|
|
|
E_Desklock_Popup_Data *edp;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(edd->elock_wnd_list, l, edp)
|
2013-02-18 05:43:14 -08:00
|
|
|
if (edp->zone == zone) return l;
|
2012-07-16 05:23:37 -07:00
|
|
|
return NULL;
|
2012-04-30 05:28:57 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_e_desklock_cb_zone_add(void *data __UNUSED__,
|
2012-06-14 06:16:28 -07:00
|
|
|
int type __UNUSED__,
|
2012-07-16 05:23:37 -07:00
|
|
|
void *event)
|
2012-04-30 05:28:57 -07:00
|
|
|
{
|
2012-07-16 05:23:37 -07:00
|
|
|
E_Event_Zone_Add *ev = event;
|
2012-04-30 05:28:57 -07:00
|
|
|
if (!edd) return ECORE_CALLBACK_PASS_ON;
|
2012-07-16 06:21:31 -07:00
|
|
|
if ((!edd->move_handler) && (e_config->desklock_login_box_zone == -2))
|
|
|
|
edd->move_handler = ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE, _e_desklock_cb_mouse_move, NULL);
|
2012-07-16 05:23:37 -07:00
|
|
|
if (!_e_desklock_popup_find(ev->zone)) _e_desklock_popup_add(ev->zone);
|
2012-04-30 05:28:57 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_e_desklock_cb_zone_del(void *data __UNUSED__,
|
2012-06-14 06:16:28 -07:00
|
|
|
int type __UNUSED__,
|
2012-07-16 05:23:37 -07:00
|
|
|
void *event)
|
2012-04-30 05:28:57 -07:00
|
|
|
{
|
2012-07-16 05:23:37 -07:00
|
|
|
E_Event_Zone_Del *ev = event;
|
|
|
|
Eina_List *l;
|
2012-04-30 05:28:57 -07:00
|
|
|
if (!edd) return ECORE_CALLBACK_PASS_ON;
|
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 ((eina_list_count(e_util_comp_current_get()->zones) == 1) && (e_config->desklock_login_box_zone == -2))
|
2012-07-16 06:21:31 -07:00
|
|
|
edd->move_handler = ecore_event_handler_del(edd->move_handler);
|
2013-01-11 02:34:29 -08:00
|
|
|
|
2012-07-16 05:23:37 -07:00
|
|
|
l = _e_desklock_popup_find(ev->zone);
|
|
|
|
if (l)
|
|
|
|
{
|
|
|
|
_e_desklock_popup_free(l->data);
|
|
|
|
edd->elock_wnd_list = eina_list_remove_list(edd->elock_wnd_list, l);
|
|
|
|
}
|
2012-04-30 05:28:57 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_e_desklock_cb_zone_move_resize(void *data __UNUSED__,
|
2012-06-14 06:16:28 -07:00
|
|
|
int type __UNUSED__,
|
2012-07-16 03:43:23 -07:00
|
|
|
void *event)
|
2012-04-30 05:28:57 -07:00
|
|
|
{
|
2012-07-16 03:43:23 -07:00
|
|
|
E_Desklock_Popup_Data *edp;
|
|
|
|
Eina_List *l;
|
|
|
|
E_Event_Zone_Move_Resize *ev = event;
|
|
|
|
|
2012-04-30 05:28:57 -07:00
|
|
|
if (!edd) return ECORE_CALLBACK_PASS_ON;
|
2012-07-16 03:43:23 -07:00
|
|
|
EINA_LIST_FOREACH(edd->elock_wnd_list, l, edp)
|
2013-02-18 05:43:14 -08:00
|
|
|
if (edp->zone == ev->zone)
|
2012-07-16 03:43:23 -07:00
|
|
|
{
|
2012-07-16 03:45:08 -07:00
|
|
|
evas_object_resize(edp->bg_object, ev->zone->w, ev->zone->h);
|
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
|
|
|
e_comp_object_util_center_on(edp->login_box, edp->comp_object);
|
2012-07-16 03:43:23 -07:00
|
|
|
break;
|
|
|
|
}
|
2012-04-30 05:28:57 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2010-03-08 16:31:44 -08:00
|
|
|
_e_desklock_cb_key_down(void *data __UNUSED__, int type __UNUSED__, void *event)
|
2006-02-19 15:53:35 -08:00
|
|
|
{
|
2010-03-08 16:31:44 -08:00
|
|
|
Ecore_Event_Key *ev = event;
|
2010-07-18 12:06:00 -07:00
|
|
|
|
2012-06-14 06:16:28 -07:00
|
|
|
if ((ev->window != edd->elock_wnd) ||
|
2010-07-18 12:06:00 -07:00
|
|
|
(edd->state == E_DESKLOCK_STATE_CHECKING)) return 1;
|
2007-03-10 21:01:49 -08:00
|
|
|
|
2009-03-16 09:24:43 -07:00
|
|
|
if (!strcmp(ev->key, "Escape"))
|
2012-07-20 06:30:58 -07:00
|
|
|
{
|
|
|
|
if (edd->selected)
|
|
|
|
{
|
|
|
|
_e_desklock_unselect();
|
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
|
|
|
}
|
2009-03-16 09:24:43 -07:00
|
|
|
else if (!strcmp(ev->key, "KP_Enter"))
|
2006-04-17 20:08:43 -07:00
|
|
|
_e_desklock_check_auth();
|
2009-03-16 09:24:43 -07:00
|
|
|
else if (!strcmp(ev->key, "Return"))
|
2006-04-17 20:08:43 -07:00
|
|
|
_e_desklock_check_auth();
|
2009-03-16 09:24:43 -07:00
|
|
|
else if (!strcmp(ev->key, "BackSpace"))
|
2012-07-20 06:30:58 -07:00
|
|
|
{
|
|
|
|
if (edd->selected)
|
|
|
|
{
|
|
|
|
_e_desklock_null();
|
|
|
|
_e_desklock_unselect();
|
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
|
|
|
_e_desklock_backspace();
|
|
|
|
}
|
2009-03-16 09:24:43 -07:00
|
|
|
else if (!strcmp(ev->key, "Delete"))
|
2012-07-20 06:30:58 -07:00
|
|
|
{
|
|
|
|
if (edd->selected)
|
|
|
|
{
|
|
|
|
_e_desklock_null();
|
|
|
|
_e_desklock_unselect();
|
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
|
|
|
_e_desklock_delete();
|
|
|
|
}
|
2012-06-14 06:16:28 -07:00
|
|
|
else if ((!strcmp(ev->key, "u") &&
|
|
|
|
(ev->modifiers & ECORE_EVENT_MODIFIER_CTRL)))
|
2008-07-07 14:28:22 -07:00
|
|
|
_e_desklock_null();
|
2012-07-20 06:30:58 -07:00
|
|
|
else if ((!strcmp(ev->key, "a") &&
|
|
|
|
(ev->modifiers & ECORE_EVENT_MODIFIER_CTRL)))
|
|
|
|
_e_desklock_select();
|
2006-02-26 22:35:56 -08:00
|
|
|
else
|
|
|
|
{
|
2012-06-14 06:16:28 -07:00
|
|
|
/* here we have to grab a password */
|
|
|
|
if (ev->compose)
|
|
|
|
{
|
2012-07-20 06:30:58 -07:00
|
|
|
if (edd->selected)
|
|
|
|
{
|
|
|
|
_e_desklock_null();
|
|
|
|
_e_desklock_unselect();
|
|
|
|
}
|
2012-06-14 06:16:28 -07:00
|
|
|
if ((strlen(edd->passwd) < (PASSWD_LEN - strlen(ev->compose))))
|
|
|
|
{
|
|
|
|
strcat(edd->passwd, ev->compose);
|
|
|
|
_e_desklock_passwd_update();
|
|
|
|
}
|
|
|
|
}
|
2006-02-26 22:35:56 -08:00
|
|
|
}
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2006-02-19 15:53:35 -08:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2010-03-08 16:31:44 -08:00
|
|
|
_e_desklock_cb_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
|
2006-02-19 15:53:35 -08:00
|
|
|
{
|
2007-03-10 21:01:49 -08:00
|
|
|
E_Desklock_Popup_Data *edp;
|
2006-04-17 20:08:43 -07:00
|
|
|
E_Zone *current_zone;
|
2008-10-22 04:49:33 -07:00
|
|
|
Eina_List *l;
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2013-02-18 05:43:14 -08:00
|
|
|
current_zone = e_util_zone_current_get(e_manager_current_get());
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2006-04-17 20:08:43 -07:00
|
|
|
if (current_zone == last_active_zone)
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2009-08-21 08:08:49 -07:00
|
|
|
EINA_LIST_FOREACH(edd->elock_wnd_list, l, edp)
|
2006-04-17 20:08:43 -07:00
|
|
|
{
|
2012-06-14 06:16:28 -07:00
|
|
|
if (!edp) continue;
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2013-02-18 05:43:14 -08:00
|
|
|
if (edp->zone != current_zone)
|
2012-07-16 06:01:21 -07:00
|
|
|
{
|
2012-07-16 06:21:31 -07:00
|
|
|
if (edp->login_box) evas_object_hide(edp->login_box);
|
|
|
|
continue;
|
2012-07-16 06:01:21 -07:00
|
|
|
}
|
2012-07-16 06:21:31 -07:00
|
|
|
if (edp->login_box)
|
|
|
|
evas_object_show(edp->login_box);
|
|
|
|
else
|
|
|
|
_e_desklock_login_box_add(edp);
|
2006-04-17 20:08:43 -07:00
|
|
|
}
|
2012-07-16 06:21:31 -07:00
|
|
|
_e_desklock_passwd_update();
|
2006-04-17 20:08:43 -07:00
|
|
|
last_active_zone = current_zone;
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2006-02-19 15:53:35 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2007-09-13 14:09:12 -07:00
|
|
|
_e_desklock_passwd_update(void)
|
2006-02-19 15:53:35 -08:00
|
|
|
{
|
2011-11-22 07:59:54 -08:00
|
|
|
int len, i;
|
|
|
|
char passwd_hidden[PASSWD_LEN] = "", *pp;
|
2007-03-10 21:01:49 -08:00
|
|
|
E_Desklock_Popup_Data *edp;
|
2008-10-22 04:49:33 -07:00
|
|
|
Eina_List *l;
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2006-02-26 22:35:56 -08:00
|
|
|
if (!edd) return;
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2011-11-22 07:59:54 -08:00
|
|
|
len = eina_unicode_utf8_get_len(edd->passwd);
|
2012-06-14 06:16:28 -07:00
|
|
|
for (i = 0, pp = passwd_hidden; i < len; i++, pp++)
|
2007-03-10 21:01:49 -08:00
|
|
|
*pp = '*';
|
2006-07-31 21:14:34 -07:00
|
|
|
*pp = 0;
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2009-08-21 08:08:49 -07:00
|
|
|
EINA_LIST_FOREACH(edd->elock_wnd_list, l, edp)
|
2013-01-11 02:34:29 -08:00
|
|
|
if (edp->login_box)
|
|
|
|
edje_object_part_text_set(edp->login_box, "e.text.password",
|
|
|
|
passwd_hidden);
|
2006-02-19 15:53:35 -08:00
|
|
|
}
|
|
|
|
|
2012-07-20 06:30:58 -07:00
|
|
|
static void
|
|
|
|
_e_desklock_select(void)
|
|
|
|
{
|
|
|
|
E_Desklock_Popup_Data *edp;
|
|
|
|
Eina_List *l;
|
|
|
|
EINA_LIST_FOREACH(edd->elock_wnd_list, l, edp)
|
|
|
|
if (edp->login_box)
|
|
|
|
edje_object_signal_emit(edp->login_box, "e,state,selected", "e");
|
|
|
|
edd->selected = EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_desklock_unselect(void)
|
|
|
|
{
|
|
|
|
E_Desklock_Popup_Data *edp;
|
|
|
|
Eina_List *l;
|
|
|
|
EINA_LIST_FOREACH(edd->elock_wnd_list, l, edp)
|
|
|
|
if (edp->login_box)
|
|
|
|
edje_object_signal_emit(edp->login_box, "e,state,unselected", "e");
|
|
|
|
edd->selected = EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2008-07-07 14:28:22 -07:00
|
|
|
static void
|
|
|
|
_e_desklock_null(void)
|
|
|
|
{
|
|
|
|
memset(edd->passwd, 0, sizeof(char) * PASSWD_LEN);
|
|
|
|
_e_desklock_passwd_update();
|
|
|
|
}
|
|
|
|
|
2006-02-19 15:53:35 -08:00
|
|
|
static void
|
2007-09-13 14:09:12 -07:00
|
|
|
_e_desklock_backspace(void)
|
2006-02-19 15:53:35 -08:00
|
|
|
{
|
2006-07-31 21:14:34 -07:00
|
|
|
int len, val, pos;
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2006-07-31 21:14:34 -07:00
|
|
|
if (!edd) return;
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2006-02-26 22:35:56 -08:00
|
|
|
len = strlen(edd->passwd);
|
|
|
|
if (len > 0)
|
|
|
|
{
|
2012-06-14 06:16:28 -07:00
|
|
|
pos = evas_string_char_prev_get(edd->passwd, len, &val);
|
|
|
|
if ((pos < len) && (pos >= 0))
|
|
|
|
{
|
|
|
|
edd->passwd[pos] = 0;
|
|
|
|
_e_desklock_passwd_update();
|
|
|
|
}
|
2006-02-26 22:35:56 -08:00
|
|
|
}
|
2006-02-19 15:53:35 -08:00
|
|
|
}
|
2006-02-26 22:35:56 -08:00
|
|
|
|
2006-02-19 15:53:35 -08:00
|
|
|
static void
|
2007-09-13 14:09:12 -07:00
|
|
|
_e_desklock_delete(void)
|
2006-02-19 15:53:35 -08:00
|
|
|
{
|
2006-04-17 20:08:43 -07:00
|
|
|
_e_desklock_backspace();
|
2006-02-19 15:53:35 -08:00
|
|
|
}
|
2006-02-26 13:42:19 -08:00
|
|
|
|
2006-03-02 16:02:32 -08:00
|
|
|
static int
|
2007-09-13 14:09:12 -07:00
|
|
|
_e_desklock_zone_num_get(void)
|
2006-03-02 16:02:32 -08:00
|
|
|
{
|
2006-04-17 20:08:43 -07:00
|
|
|
int num;
|
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
|
|
|
Eina_List *l;
|
2009-08-21 08:08:49 -07:00
|
|
|
E_Manager *man;
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2006-04-17 20:08:43 -07:00
|
|
|
num = 0;
|
2009-08-21 08:08:49 -07:00
|
|
|
EINA_LIST_FOREACH(e_manager_list(), l, man)
|
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
|
|
|
num += eina_list_count(man->comp->zones);
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2006-04-17 20:08:43 -07:00
|
|
|
return num;
|
2006-03-02 16:02:32 -08:00
|
|
|
}
|
2006-02-26 13:42:19 -08:00
|
|
|
|
2006-04-17 20:08:43 -07:00
|
|
|
static int
|
2007-09-13 14:09:12 -07:00
|
|
|
_e_desklock_check_auth(void)
|
2006-03-31 09:26:38 -08:00
|
|
|
{
|
2006-04-17 20:08:43 -07:00
|
|
|
if (!edd) return 0;
|
2006-03-31 09:26:38 -08:00
|
|
|
#ifdef HAVE_PAM
|
2006-04-17 20:08:43 -07:00
|
|
|
if (e_config->desklock_auth_method == 0)
|
2012-06-14 06:16:28 -07:00
|
|
|
{
|
2012-08-22 04:41:08 -07:00
|
|
|
int ret;
|
2013-01-11 02:34:29 -08:00
|
|
|
|
2012-08-22 04:41:08 -07:00
|
|
|
ret = _desklock_auth(edd->passwd);
|
|
|
|
// passwd off in child proc now - null out from parent
|
2012-06-14 06:16:28 -07:00
|
|
|
memset(edd->passwd, 0, sizeof(char) * PASSWD_LEN);
|
2012-08-22 07:10:53 -07:00
|
|
|
return ret;
|
2006-04-17 20:08:43 -07:00
|
|
|
}
|
2012-08-22 04:41:08 -07:00
|
|
|
else if (e_config->desklock_auth_method == 1)
|
|
|
|
{
|
|
|
|
#endif
|
2013-01-11 02:34:29 -08:00
|
|
|
if ((e_config->desklock_personal_passwd) &&
|
|
|
|
(!strcmp(!edd->passwd ? "" : edd->passwd,
|
|
|
|
!e_config->desklock_personal_passwd ? "" :
|
|
|
|
e_config->desklock_personal_passwd)))
|
|
|
|
{
|
|
|
|
/* password ok */
|
|
|
|
/* security - null out passwd string once we are done with it */
|
|
|
|
memset(edd->passwd, 0, sizeof(char) * PASSWD_LEN);
|
|
|
|
e_desklock_hide();
|
|
|
|
return 1;
|
2012-08-22 04:41:08 -07:00
|
|
|
}
|
2013-01-11 02:34:29 -08:00
|
|
|
#ifdef HAVE_PAM
|
|
|
|
}
|
|
|
|
|
2006-03-31 09:26:38 -08:00
|
|
|
#endif
|
2007-04-18 20:44:47 -07:00
|
|
|
/* password is definitely wrong */
|
|
|
|
_e_desklock_state_set(E_DESKLOCK_STATE_INVALID);
|
2008-07-07 14:28:22 -07:00
|
|
|
_e_desklock_null();
|
2006-04-17 20:08:43 -07:00
|
|
|
return 0;
|
2006-03-31 09:26:38 -08:00
|
|
|
}
|
|
|
|
|
2007-04-18 20:44:47 -07:00
|
|
|
static void
|
|
|
|
_e_desklock_state_set(int state)
|
|
|
|
{
|
2008-10-22 04:49:33 -07:00
|
|
|
Eina_List *l;
|
2009-08-21 08:08:49 -07:00
|
|
|
E_Desklock_Popup_Data *edp;
|
2012-04-15 01:09:56 -07:00
|
|
|
const char *signal_desklock, *text;
|
2007-04-18 20:44:47 -07:00
|
|
|
if (!edd) return;
|
|
|
|
|
|
|
|
edd->state = state;
|
|
|
|
if (state == E_DESKLOCK_STATE_CHECKING)
|
|
|
|
{
|
2012-06-14 06:16:28 -07:00
|
|
|
signal_desklock = "e,state,checking";
|
2012-09-21 12:00:28 -07:00
|
|
|
text = _("Authenticating...");
|
2007-04-18 20:44:47 -07:00
|
|
|
}
|
|
|
|
else if (state == E_DESKLOCK_STATE_INVALID)
|
|
|
|
{
|
2012-06-14 06:16:28 -07:00
|
|
|
signal_desklock = "e,state,invalid";
|
2012-09-21 12:00:28 -07:00
|
|
|
text = _("The password you entered is invalid. Try again.");
|
2007-04-18 20:44:47 -07:00
|
|
|
}
|
2010-01-14 15:48:59 -08:00
|
|
|
else
|
|
|
|
return;
|
2007-04-18 20:44:47 -07:00
|
|
|
|
2009-08-21 08:08:49 -07:00
|
|
|
EINA_LIST_FOREACH(edd->elock_wnd_list, l, edp)
|
2007-04-18 20:44:47 -07:00
|
|
|
{
|
2012-11-15 01:11:49 -08:00
|
|
|
edje_object_signal_emit(edp->login_box, signal_desklock, "e");
|
|
|
|
edje_object_signal_emit(edp->bg_object, signal_desklock, "e");
|
2012-06-14 06:16:28 -07:00
|
|
|
edje_object_part_text_set(edp->login_box, "e.text.title", text);
|
2007-04-18 20:44:47 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-03-31 09:26:38 -08:00
|
|
|
#ifdef HAVE_PAM
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2010-03-08 16:31:44 -08:00
|
|
|
_e_desklock_cb_exit(void *data __UNUSED__, int type __UNUSED__, void *event)
|
2006-03-31 09:26:38 -08:00
|
|
|
{
|
2010-03-08 16:31:44 -08:00
|
|
|
Ecore_Exe_Event_Del *ev = event;
|
2010-07-18 12:06:00 -07:00
|
|
|
|
2006-04-17 20:08:43 -07:00
|
|
|
if (ev->pid == _e_desklock_child_pid)
|
|
|
|
{
|
2012-06-14 06:16:28 -07:00
|
|
|
_e_desklock_child_pid = -1;
|
|
|
|
/* ok */
|
|
|
|
if (ev->exit_code == 0)
|
|
|
|
{
|
|
|
|
/* security - null out passwd string once we are done with it */
|
|
|
|
memset(edd->passwd, 0, sizeof(char) * PASSWD_LEN);
|
|
|
|
e_desklock_hide();
|
|
|
|
}
|
|
|
|
/* error */
|
|
|
|
else if (ev->exit_code < 128)
|
|
|
|
{
|
|
|
|
/* security - null out passwd string once we are done with it */
|
|
|
|
memset(edd->passwd, 0, sizeof(char) * PASSWD_LEN);
|
|
|
|
e_desklock_hide();
|
|
|
|
e_util_dialog_show(_("Authentication System Error"),
|
|
|
|
_("Authentication via PAM had errors setting up the<br>"
|
|
|
|
"authentication session. The error code was <hilight>%i</hilight>.<br>"
|
|
|
|
"This is bad and should not be happening. Please report this bug.")
|
|
|
|
, ev->exit_code);
|
|
|
|
}
|
|
|
|
/* failed auth */
|
|
|
|
else
|
|
|
|
{
|
|
|
|
_e_desklock_state_set(E_DESKLOCK_STATE_INVALID);
|
|
|
|
/* security - null out passwd string once we are done with it */
|
|
|
|
_e_desklock_null();
|
|
|
|
}
|
|
|
|
if (_e_desklock_exit_handler)
|
|
|
|
ecore_event_handler_del(_e_desklock_exit_handler);
|
|
|
|
_e_desklock_exit_handler = NULL;
|
2006-04-17 20:08:43 -07:00
|
|
|
}
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2006-03-31 09:26:38 -08:00
|
|
|
}
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2006-04-17 20:08:43 -07:00
|
|
|
static int
|
2006-08-21 09:00:43 -07:00
|
|
|
_desklock_auth(char *passwd)
|
2006-03-31 09:26:38 -08:00
|
|
|
{
|
2007-04-18 20:44:47 -07:00
|
|
|
_e_desklock_state_set(E_DESKLOCK_STATE_CHECKING);
|
2010-03-02 07:07:03 -08:00
|
|
|
_e_desklock_child_pid = fork();
|
|
|
|
if (_e_desklock_child_pid > 0)
|
2006-04-17 20:08:43 -07:00
|
|
|
{
|
2012-06-14 06:16:28 -07:00
|
|
|
/* parent */
|
|
|
|
_e_desklock_exit_handler =
|
|
|
|
ecore_event_handler_add(ECORE_EXE_EVENT_DEL, _e_desklock_cb_exit,
|
|
|
|
NULL);
|
2006-04-17 20:08:43 -07:00
|
|
|
}
|
2010-03-02 07:07:03 -08:00
|
|
|
else if (_e_desklock_child_pid == 0)
|
2006-04-17 20:08:43 -07:00
|
|
|
{
|
2012-06-14 06:16:28 -07:00
|
|
|
/* child */
|
|
|
|
int pamerr;
|
|
|
|
E_Desklock_Auth da;
|
2006-07-31 21:14:34 -07:00
|
|
|
char *current_user, *p;
|
2012-06-14 06:16:28 -07:00
|
|
|
struct sigaction action;
|
|
|
|
|
|
|
|
action.sa_handler = SIG_DFL;
|
|
|
|
action.sa_flags = SA_ONSTACK | SA_NODEFER | SA_RESETHAND | SA_SIGINFO;
|
|
|
|
sigemptyset(&action.sa_mask);
|
|
|
|
sigaction(SIGSEGV, &action, NULL);
|
|
|
|
sigaction(SIGILL, &action, NULL);
|
|
|
|
sigaction(SIGFPE, &action, NULL);
|
|
|
|
sigaction(SIGBUS, &action, NULL);
|
|
|
|
sigaction(SIGABRT, &action, NULL);
|
|
|
|
|
|
|
|
current_user = _desklock_auth_get_current_user();
|
|
|
|
eina_strlcpy(da.user, current_user, sizeof(da.user));
|
|
|
|
eina_strlcpy(da.passwd, passwd, sizeof(da.passwd));
|
|
|
|
/* security - null out passwd string once we are done with it */
|
|
|
|
for (p = passwd; *p; p++)
|
|
|
|
*p = 0;
|
|
|
|
da.pam.handle = NULL;
|
|
|
|
da.pam.conv.conv = NULL;
|
|
|
|
da.pam.conv.appdata_ptr = NULL;
|
|
|
|
|
|
|
|
pamerr = _desklock_pam_init(&da);
|
|
|
|
if (pamerr != PAM_SUCCESS)
|
|
|
|
{
|
|
|
|
free(current_user);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
pamerr = pam_authenticate(da.pam.handle, 0);
|
|
|
|
pam_end(da.pam.handle, pamerr);
|
|
|
|
/* security - null out passwd string once we are done with it */
|
|
|
|
memset(da.passwd, 0, sizeof(da.passwd));
|
|
|
|
if (pamerr == PAM_SUCCESS)
|
|
|
|
{
|
|
|
|
free(current_user);
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
free(current_user);
|
|
|
|
exit(-1);
|
2006-04-17 20:08:43 -07:00
|
|
|
}
|
2010-03-02 07:07:03 -08:00
|
|
|
else
|
|
|
|
{
|
2012-06-14 06:16:28 -07:00
|
|
|
_e_desklock_state_set(E_DESKLOCK_STATE_INVALID);
|
|
|
|
return 0;
|
2010-03-02 07:07:03 -08:00
|
|
|
}
|
2006-06-08 12:11:54 -07:00
|
|
|
return 1;
|
2006-03-31 09:26:38 -08:00
|
|
|
}
|
|
|
|
|
2006-04-17 20:08:43 -07:00
|
|
|
static char *
|
|
|
|
_desklock_auth_get_current_user(void)
|
2006-03-31 09:26:38 -08:00
|
|
|
{
|
2006-04-17 20:08:43 -07:00
|
|
|
char *user;
|
|
|
|
struct passwd *pwent = NULL;
|
2006-03-31 09:26:38 -08:00
|
|
|
|
2006-04-17 20:08:43 -07:00
|
|
|
pwent = getpwuid(getuid());
|
|
|
|
user = strdup(pwent->pw_name);
|
|
|
|
return user;
|
|
|
|
}
|
2006-03-31 09:26:38 -08:00
|
|
|
|
2006-04-17 20:08:43 -07:00
|
|
|
static int
|
2006-04-17 20:14:29 -07:00
|
|
|
_desklock_pam_init(E_Desklock_Auth *da)
|
2006-04-17 20:08:43 -07:00
|
|
|
{
|
|
|
|
int pamerr;
|
2006-08-12 06:25:29 -07:00
|
|
|
const char *pam_prof;
|
2006-06-20 04:35:15 -07:00
|
|
|
char *current_host;
|
|
|
|
char *current_user;
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2006-04-17 20:08:43 -07:00
|
|
|
if (!da) return -1;
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2006-04-17 20:08:43 -07:00
|
|
|
da->pam.conv.conv = _desklock_auth_pam_conv;
|
|
|
|
da->pam.conv.appdata_ptr = da;
|
|
|
|
da->pam.handle = NULL;
|
2006-08-12 06:25:29 -07:00
|
|
|
|
2006-09-19 02:59:03 -07:00
|
|
|
/* try other pam profiles - and system-auth (login for fbsd users) is a fallback */
|
2006-09-19 05:26:31 -07:00
|
|
|
pam_prof = "login";
|
2010-03-08 16:31:44 -08:00
|
|
|
if (ecore_file_exists("/etc/pam.d/enlightenment"))
|
2007-03-10 21:01:49 -08:00
|
|
|
pam_prof = "enlightenment";
|
2010-03-08 16:31:44 -08:00
|
|
|
else if (ecore_file_exists("/etc/pam.d/xscreensaver"))
|
2007-03-10 21:01:49 -08:00
|
|
|
pam_prof = "xscreensaver";
|
2010-03-08 16:31:44 -08:00
|
|
|
else if (ecore_file_exists("/etc/pam.d/kscreensaver"))
|
2007-03-10 21:01:49 -08:00
|
|
|
pam_prof = "kscreensaver";
|
2010-03-08 16:31:44 -08:00
|
|
|
else if (ecore_file_exists("/etc/pam.d/system-auth"))
|
2007-03-10 21:01:49 -08:00
|
|
|
pam_prof = "system-auth";
|
2010-03-08 16:31:44 -08:00
|
|
|
else if (ecore_file_exists("/etc/pam.d/system"))
|
2007-03-10 21:01:49 -08:00
|
|
|
pam_prof = "system";
|
2008-08-07 05:04:44 -07:00
|
|
|
else if (ecore_file_exists("/etc/pam.d/xdm"))
|
|
|
|
pam_prof = "xdm";
|
|
|
|
else if (ecore_file_exists("/etc/pam.d/gdm"))
|
|
|
|
pam_prof = "gdm";
|
|
|
|
else if (ecore_file_exists("/etc/pam.d/kdm"))
|
|
|
|
pam_prof = "kdm";
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2006-08-12 06:25:29 -07:00
|
|
|
if ((pamerr = pam_start(pam_prof, da->user, &(da->pam.conv),
|
2012-06-14 06:16:28 -07:00
|
|
|
&(da->pam.handle))) != PAM_SUCCESS)
|
2006-04-17 20:08:43 -07:00
|
|
|
return pamerr;
|
2006-06-20 04:35:15 -07:00
|
|
|
|
|
|
|
current_user = _desklock_auth_get_current_user();
|
|
|
|
|
2007-03-10 21:01:49 -08:00
|
|
|
if ((pamerr = pam_set_item(da->pam.handle, PAM_USER, current_user)) != PAM_SUCCESS)
|
2006-06-20 04:35:15 -07:00
|
|
|
{
|
2012-06-14 06:16:28 -07:00
|
|
|
free(current_user);
|
|
|
|
return pamerr;
|
2006-06-20 04:35:15 -07:00
|
|
|
}
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2006-06-20 04:35:15 -07:00
|
|
|
current_host = _desklock_auth_get_current_host();
|
2007-03-10 21:01:49 -08:00
|
|
|
if ((pamerr = pam_set_item(da->pam.handle, PAM_RHOST, current_host)) != PAM_SUCCESS)
|
2006-06-20 04:35:15 -07:00
|
|
|
{
|
2012-06-14 06:16:28 -07:00
|
|
|
free(current_user);
|
|
|
|
free(current_host);
|
|
|
|
return pamerr;
|
2006-06-20 04:35:15 -07:00
|
|
|
}
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2006-06-20 04:35:15 -07:00
|
|
|
free(current_user);
|
|
|
|
free(current_host);
|
2006-04-17 20:08:43 -07:00
|
|
|
return 0;
|
2006-03-31 09:26:38 -08:00
|
|
|
}
|
|
|
|
|
2006-04-17 20:08:43 -07:00
|
|
|
static int
|
|
|
|
_desklock_auth_pam_conv(int num_msg, const struct pam_message **msg, struct pam_response **resp, void *appdata_ptr)
|
2006-03-31 09:26:38 -08:00
|
|
|
{
|
2006-04-17 20:08:43 -07:00
|
|
|
int replies = 0;
|
2006-04-17 20:14:29 -07:00
|
|
|
E_Desklock_Auth *da = (E_Desklock_Auth *)appdata_ptr;
|
2006-04-17 20:08:43 -07:00
|
|
|
struct pam_response *reply = NULL;
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2012-06-14 06:16:28 -07:00
|
|
|
reply = (struct pam_response *)malloc(sizeof(struct pam_response) * num_msg);
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2010-07-18 12:06:00 -07:00
|
|
|
if (!reply) return PAM_CONV_ERR;
|
2010-03-08 16:31:44 -08:00
|
|
|
|
2006-04-17 20:08:43 -07:00
|
|
|
for (replies = 0; replies < num_msg; replies++)
|
|
|
|
{
|
2012-06-14 06:16:28 -07:00
|
|
|
switch (msg[replies]->msg_style)
|
|
|
|
{
|
|
|
|
case PAM_PROMPT_ECHO_ON:
|
|
|
|
reply[replies].resp_retcode = PAM_SUCCESS;
|
|
|
|
reply[replies].resp = strdup(da->user);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PAM_PROMPT_ECHO_OFF:
|
|
|
|
reply[replies].resp_retcode = PAM_SUCCESS;
|
|
|
|
reply[replies].resp = strdup(da->passwd);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PAM_ERROR_MSG:
|
|
|
|
case PAM_TEXT_INFO:
|
|
|
|
reply[replies].resp_retcode = PAM_SUCCESS;
|
|
|
|
reply[replies].resp = NULL;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
free(reply);
|
|
|
|
return PAM_CONV_ERR;
|
|
|
|
}
|
2006-04-17 20:08:43 -07:00
|
|
|
}
|
|
|
|
*resp = reply;
|
|
|
|
return PAM_SUCCESS;
|
2006-03-31 09:26:38 -08:00
|
|
|
}
|
|
|
|
|
2006-04-17 20:08:43 -07:00
|
|
|
static char *
|
|
|
|
_desklock_auth_get_current_host(void)
|
2006-03-31 09:26:38 -08:00
|
|
|
{
|
2006-04-17 20:08:43 -07:00
|
|
|
return strdup("localhost");
|
2006-03-31 09:26:38 -08:00
|
|
|
}
|
2012-06-14 06:16:28 -07:00
|
|
|
|
2006-03-31 09:26:38 -08:00
|
|
|
#endif
|
2006-12-28 18:56:26 -08:00
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2010-03-08 16:31:44 -08:00
|
|
|
_e_desklock_cb_custom_desklock_exit(void *data __UNUSED__, int type __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
|
2010-03-08 16:31:44 -08:00
|
|
|
_e_desklock_cb_idle_poller(void *data __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
|
|
|
{
|
2012-06-14 06:16:28 -07:00
|
|
|
double idle, max;
|
2009-04-26 19:54:43 -07:00
|
|
|
|
2012-06-14 06:16:28 -07:00
|
|
|
/* If a desklock is already up, bail */
|
2010-06-24 09:19:12 -07:00
|
|
|
if ((_e_custom_desklock_exe) || (edd)) return ECORE_CALLBACK_RENEW;
|
2007-04-04 04:43:36 -07:00
|
|
|
|
2012-06-14 06:16:28 -07:00
|
|
|
idle = ecore_x_screensaver_idle_time_get();
|
|
|
|
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
|
|
|
|
_e_desklock_ask_presentation_yes(void *data __UNUSED__, E_Dialog *dia)
|
|
|
|
{
|
|
|
|
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
|
|
|
|
_e_desklock_ask_presentation_no(void *data __UNUSED__, E_Dialog *dia)
|
|
|
|
{
|
|
|
|
e_object_del(E_OBJECT(dia));
|
|
|
|
_e_desklock_ask_presentation_count = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_desklock_ask_presentation_no_increase(void *data __UNUSED__, E_Dialog *dia)
|
|
|
|
{
|
|
|
|
int timeout, interval, blanking, expose;
|
|
|
|
|
|
|
|
_e_desklock_ask_presentation_count++;
|
|
|
|
timeout = e_config->screensaver_timeout * _e_desklock_ask_presentation_count;
|
|
|
|
interval = e_config->screensaver_interval;
|
|
|
|
blanking = e_config->screensaver_blanking;
|
|
|
|
expose = e_config->screensaver_expose;
|
|
|
|
|
|
|
|
ecore_x_screensaver_set(timeout, interval, blanking, expose);
|
|
|
|
e_object_del(E_OBJECT(dia));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_desklock_ask_presentation_no_forever(void *data __UNUSED__, E_Dialog *dia)
|
|
|
|
{
|
|
|
|
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
|
|
|
|
_e_desklock_ask_presentation_key_down(void *data, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *event)
|
|
|
|
{
|
|
|
|
Evas_Event_Key_Down *ev = event;
|
|
|
|
E_Dialog *dia = data;
|
|
|
|
|
|
|
|
if (strcmp(ev->keyname, "Return") == 0)
|
|
|
|
_e_desklock_ask_presentation_yes(NULL, dia);
|
|
|
|
else if (strcmp(ev->keyname, "Escape") == 0)
|
|
|
|
_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);
|
|
|
|
e_win_centered_set(dia->win, 1);
|
|
|
|
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
|
|
|
|
_e_desklock_job(void *data __UNUSED__)
|
|
|
|
{
|
|
|
|
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
|
|
|
|
_e_desklock_cb_run(void *data __UNUSED__, int type __UNUSED__, void *event)
|
|
|
|
{
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|