forked from enlightenment/enlightenment
desklock - use immediate show for lock on suspend etc.
makes lock more correct and not fade in on lock on suspend @feat
This commit is contained in:
parent
fd3e4a645d
commit
cb2bc1d1c1
|
@ -2881,7 +2881,7 @@ disp_err:
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_e_comp_wl_desklock_show(void)
|
_e_comp_wl_desklock_show(Eina_Bool immediate EINA_UNUSED)
|
||||||
{
|
{
|
||||||
return e_comp_grab_input(1, 1);
|
return e_comp_grab_input(1, 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,7 +124,7 @@ e_desklock_interface_append(E_Desklock_Interface *iface)
|
||||||
desklock_ifaces = eina_list_append(desklock_ifaces, (void*)iface);
|
desklock_ifaces = eina_list_append(desklock_ifaces, (void*)iface);
|
||||||
if (_e_desklock_state && (!current_iface))
|
if (_e_desklock_state && (!current_iface))
|
||||||
{
|
{
|
||||||
if (iface->show())
|
if (iface->show(EINA_TRUE))
|
||||||
{
|
{
|
||||||
iface->active = EINA_TRUE;
|
iface->active = EINA_TRUE;
|
||||||
current_iface = iface;
|
current_iface = iface;
|
||||||
|
@ -155,7 +155,7 @@ e_desklock_interface_remove(E_Desklock_Interface *iface)
|
||||||
/* then try to find a replacement locker */
|
/* then try to find a replacement locker */
|
||||||
EINA_LIST_REVERSE_FOREACH(desklock_ifaces, l, diface)
|
EINA_LIST_REVERSE_FOREACH(desklock_ifaces, l, diface)
|
||||||
{
|
{
|
||||||
if (!diface->show()) continue;
|
if (!diface->show(EINA_TRUE)) continue;
|
||||||
diface->active = EINA_TRUE;
|
diface->active = EINA_TRUE;
|
||||||
current_iface = diface;
|
current_iface = diface;
|
||||||
break;
|
break;
|
||||||
|
@ -209,7 +209,7 @@ e_desklock_demo(void)
|
||||||
|
|
||||||
EINA_LIST_REVERSE_FOREACH(desklock_ifaces, l, iface)
|
EINA_LIST_REVERSE_FOREACH(desklock_ifaces, l, iface)
|
||||||
{
|
{
|
||||||
if (iface->show())
|
if (iface->show(EINA_FALSE))
|
||||||
{
|
{
|
||||||
demo = iface->active = EINA_TRUE;
|
demo = iface->active = EINA_TRUE;
|
||||||
current_iface = iface;
|
current_iface = iface;
|
||||||
|
@ -254,7 +254,7 @@ _desklock_show_internal(Eina_Bool suspend)
|
||||||
e_menu_hide_all();
|
e_menu_hide_all();
|
||||||
EINA_LIST_FOREACH(show_hooks, l, show_cb)
|
EINA_LIST_FOREACH(show_hooks, l, show_cb)
|
||||||
{
|
{
|
||||||
if (!show_cb()) goto fail;
|
if (!show_cb(suspend)) goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
EINA_LIST_FOREACH(e_comp->zones, l, zone)
|
EINA_LIST_FOREACH(e_comp->zones, l, zone)
|
||||||
|
@ -295,7 +295,7 @@ _desklock_show_internal(Eina_Bool suspend)
|
||||||
|
|
||||||
EINA_LIST_REVERSE_FOREACH(desklock_ifaces, l, iface)
|
EINA_LIST_REVERSE_FOREACH(desklock_ifaces, l, iface)
|
||||||
{
|
{
|
||||||
success = iface->show();
|
success = iface->show(suspend);
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
iface->active = EINA_TRUE;
|
iface->active = EINA_TRUE;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifdef E_TYPEDEFS
|
#ifdef E_TYPEDEFS
|
||||||
|
|
||||||
typedef struct _E_Event_Desklock E_Event_Desklock;
|
typedef struct _E_Event_Desklock E_Event_Desklock;
|
||||||
typedef Eina_Bool (*E_Desklock_Show_Cb)(void);
|
typedef Eina_Bool (*E_Desklock_Show_Cb)(Eina_Bool immediate);
|
||||||
typedef void (*E_Desklock_Hide_Cb)(void);
|
typedef void (*E_Desklock_Hide_Cb)(void);
|
||||||
|
|
||||||
typedef enum _E_Desklock_Background_Method {
|
typedef enum _E_Desklock_Background_Method {
|
||||||
|
|
|
@ -24,7 +24,7 @@ typedef enum
|
||||||
E_DESKLOCK_AUTH_METHOD_LINES = 4,
|
E_DESKLOCK_AUTH_METHOD_LINES = 4,
|
||||||
} E_Desklock_Auth_Method2;
|
} E_Desklock_Auth_Method2;
|
||||||
|
|
||||||
EINTERN Eina_Bool lokker_lock(void);
|
EINTERN Eina_Bool lokker_lock(Eina_Bool immediate);
|
||||||
EINTERN void lokker_unlock(void);
|
EINTERN void lokker_unlock(void);
|
||||||
E_API E_Config_Dialog *e_int_config_lokker(Evas_Object *parent, const char *params EINA_UNUSED);
|
E_API E_Config_Dialog *e_int_config_lokker(Evas_Object *parent, const char *params EINA_UNUSED);
|
||||||
EINTERN Eina_Bool lokker_key_down(Ecore_Event_Key*);
|
EINTERN Eina_Bool lokker_key_down(Ecore_Event_Key*);
|
||||||
|
|
|
@ -343,7 +343,7 @@ _lokker_cb_show_done(void *data, Evas_Object *obj EINA_UNUSED, const char *sig E
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_lokker_popup_add(E_Zone *zone)
|
_lokker_popup_add(E_Zone *zone, Eina_Bool immediate)
|
||||||
{
|
{
|
||||||
E_Zone *current_zone;
|
E_Zone *current_zone;
|
||||||
Evas_Object *o = NULL;
|
Evas_Object *o = NULL;
|
||||||
|
@ -353,6 +353,7 @@ _lokker_popup_add(E_Zone *zone)
|
||||||
Eina_Stringshare *bg;
|
Eina_Stringshare *bg;
|
||||||
Evas *evas;
|
Evas *evas;
|
||||||
int nocreate = 0;
|
int nocreate = 0;
|
||||||
|
Eina_Bool is_edje = EINA_FALSE;
|
||||||
|
|
||||||
lp = E_NEW(Lokker_Popup, 1);
|
lp = E_NEW(Lokker_Popup, 1);
|
||||||
cbg = eina_list_nth(e_config->desklock_backgrounds, zone->num);
|
cbg = eina_list_nth(e_config->desklock_backgrounds, zone->num);
|
||||||
|
@ -366,6 +367,7 @@ _lokker_popup_add(E_Zone *zone)
|
||||||
{
|
{
|
||||||
o = edje_object_add(evas);
|
o = edje_object_add(evas);
|
||||||
evas_object_data_set(o, "is_edje", o);
|
evas_object_data_set(o, "is_edje", o);
|
||||||
|
is_edje = EINA_TRUE;
|
||||||
e_theme_edje_object_set(o, "base/theme/desklock",
|
e_theme_edje_object_set(o, "base/theme/desklock",
|
||||||
"e/desklock/background");
|
"e/desklock/background");
|
||||||
}
|
}
|
||||||
|
@ -373,6 +375,7 @@ _lokker_popup_add(E_Zone *zone)
|
||||||
{
|
{
|
||||||
o = edje_object_add(evas);
|
o = edje_object_add(evas);
|
||||||
evas_object_data_set(o, "is_edje", o);
|
evas_object_data_set(o, "is_edje", o);
|
||||||
|
is_edje = EINA_TRUE;
|
||||||
e_theme_edje_object_set(o, "base/theme/backgrounds",
|
e_theme_edje_object_set(o, "base/theme/backgrounds",
|
||||||
"e/desktop/background");
|
"e/desktop/background");
|
||||||
}
|
}
|
||||||
|
@ -389,6 +392,7 @@ _lokker_popup_add(E_Zone *zone)
|
||||||
{
|
{
|
||||||
o = edje_object_add(evas);
|
o = edje_object_add(evas);
|
||||||
evas_object_data_set(o, "is_edje", o);
|
evas_object_data_set(o, "is_edje", o);
|
||||||
|
is_edje = EINA_TRUE;
|
||||||
if (e_util_edje_collection_exists(f, "e/desklock/background"))
|
if (e_util_edje_collection_exists(f, "e/desklock/background"))
|
||||||
{
|
{
|
||||||
edje_object_file_set(o, f, "e/desklock/background");
|
edje_object_file_set(o, f, "e/desklock/background");
|
||||||
|
@ -426,15 +430,25 @@ _lokker_popup_add(E_Zone *zone)
|
||||||
evas_object_move(lp->bg_object, zone->x, zone->y);
|
evas_object_move(lp->bg_object, zone->x, zone->y);
|
||||||
evas_object_resize(lp->bg_object, zone->w, zone->h);
|
evas_object_resize(lp->bg_object, zone->w, zone->h);
|
||||||
evas_object_show(lp->bg_object);
|
evas_object_show(lp->bg_object);
|
||||||
|
if (is_edje)
|
||||||
{
|
{
|
||||||
const char *s = edje_object_data_get(lp->bg_object, "show_signal");
|
const char *s = edje_object_data_get(lp->bg_object, "show_signal");
|
||||||
lp->show_anim = s && (atoi(s) == 1);
|
|
||||||
e_desklock_zone_block_set(zone, !lp->show_anim);
|
if (immediate)
|
||||||
if ((lp->show_anim) &&
|
{
|
||||||
(evas_object_data_get(lp->bg_object, "is_edje")))
|
edje_object_signal_emit(lp->bg_object,
|
||||||
edje_object_signal_callback_add(lp->bg_object,
|
"e,action,show,immediate", "e");
|
||||||
"e,action,show,done", "e",
|
}
|
||||||
_lokker_cb_show_done, lp);
|
else
|
||||||
|
{
|
||||||
|
s = edje_object_data_get(lp->bg_object, "show_signal");
|
||||||
|
lp->show_anim = s && (atoi(s) == 1);
|
||||||
|
e_desklock_zone_block_set(zone, !lp->show_anim);
|
||||||
|
if (lp->show_anim)
|
||||||
|
edje_object_signal_callback_add(lp->bg_object,
|
||||||
|
"e,action,show,done", "e",
|
||||||
|
_lokker_cb_show_done, lp);
|
||||||
|
}
|
||||||
s = edje_object_data_get(lp->bg_object, "hide_signal");
|
s = edje_object_data_get(lp->bg_object, "hide_signal");
|
||||||
lp->hide_anim = s && (atoi(s) == 1);
|
lp->hide_anim = s && (atoi(s) == 1);
|
||||||
}
|
}
|
||||||
|
@ -494,6 +508,18 @@ _lokker_popup_add(E_Zone *zone)
|
||||||
edd->elock_wnd_list = eina_list_append(edd->elock_wnd_list, lp);
|
edd->elock_wnd_list = eina_list_append(edd->elock_wnd_list, lp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_lokker_popup_add_normal(E_Zone *zone)
|
||||||
|
{
|
||||||
|
_lokker_popup_add(zone, EINA_FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_lokker_popup_add_immediate(E_Zone *zone)
|
||||||
|
{
|
||||||
|
_lokker_popup_add(zone, EINA_TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_lokker_cb_hide_done(void *data, Evas_Object *obj, const char *sig EINA_UNUSED, const char *src EINA_UNUSED)
|
_lokker_cb_hide_done(void *data, Evas_Object *obj, const char *sig EINA_UNUSED, const char *src EINA_UNUSED)
|
||||||
{
|
{
|
||||||
|
@ -627,7 +653,7 @@ _lokker_cb_zone_add(void *data EINA_UNUSED,
|
||||||
if (!edd) return ECORE_CALLBACK_PASS_ON;
|
if (!edd) return ECORE_CALLBACK_PASS_ON;
|
||||||
if ((!edd->move_handler) && (e_config->desklock_login_box_zone == -2))
|
if ((!edd->move_handler) && (e_config->desklock_login_box_zone == -2))
|
||||||
edd->move_handler = ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE, _lokker_cb_mouse_move, NULL);
|
edd->move_handler = ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE, _lokker_cb_mouse_move, NULL);
|
||||||
if (!_lokker_popup_find(ev->zone)) _lokker_popup_add(ev->zone);
|
if (!_lokker_popup_find(ev->zone)) _lokker_popup_add_immediate(ev->zone);
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -900,7 +926,7 @@ lokker_key_down(Ecore_Event_Key *ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
EINTERN Eina_Bool
|
EINTERN Eina_Bool
|
||||||
lokker_lock(void)
|
lokker_lock(Eina_Bool immediate)
|
||||||
{
|
{
|
||||||
int total_zone_num = 0;
|
int total_zone_num = 0;
|
||||||
|
|
||||||
|
@ -921,7 +947,14 @@ lokker_lock(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
e_pointer_type_push(e_comp->pointer, edd, "default");
|
e_pointer_type_push(e_comp->pointer, edd, "default");
|
||||||
E_LIST_FOREACH(e_comp->zones, _lokker_popup_add);
|
if (immediate)
|
||||||
|
{
|
||||||
|
E_LIST_FOREACH(e_comp->zones, _lokker_popup_add_immediate);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
E_LIST_FOREACH(e_comp->zones, _lokker_popup_add_normal);
|
||||||
|
}
|
||||||
total_zone_num = eina_list_count(e_comp->zones);
|
total_zone_num = eina_list_count(e_comp->zones);
|
||||||
|
|
||||||
/* handlers */
|
/* handlers */
|
||||||
|
|
Loading…
Reference in New Issue