forked from enlightenment/enlightenment
add method for unblocking zones during desklock show/hide
This commit is contained in:
parent
912eb66b70
commit
1c4ee0028c
|
@ -29,6 +29,7 @@ static Eina_List *show_hooks = NULL;
|
||||||
static Eina_List *hide_hooks = NULL;
|
static Eina_List *hide_hooks = NULL;
|
||||||
|
|
||||||
static Evas_Object *block_rects[32] = {NULL};
|
static Evas_Object *block_rects[32] = {NULL};
|
||||||
|
static Eina_Bool block_zone[32] = {EINA_FALSE};
|
||||||
|
|
||||||
static Eina_List *desklock_ifaces = NULL;
|
static Eina_List *desklock_ifaces = NULL;
|
||||||
static E_Desklock_Interface *current_iface = NULL;
|
static E_Desklock_Interface *current_iface = NULL;
|
||||||
|
@ -302,6 +303,7 @@ e_desklock_show(Eina_Bool suspend)
|
||||||
evas_object_color_set(o, 0, 0, 0, 255);
|
evas_object_color_set(o, 0, 0, 0, 255);
|
||||||
evas_object_geometry_set(o, zone->x, zone->y, zone->w, zone->h);
|
evas_object_geometry_set(o, zone->x, zone->y, zone->w, zone->h);
|
||||||
evas_object_layer_set(o, E_LAYER_DESKLOCK);
|
evas_object_layer_set(o, E_LAYER_DESKLOCK);
|
||||||
|
if (!block_zone[zone->num])
|
||||||
evas_object_show(o);
|
evas_object_show(o);
|
||||||
}
|
}
|
||||||
if (e_config->desklock_language)
|
if (e_config->desklock_language)
|
||||||
|
@ -390,7 +392,10 @@ e_desklock_hide(void)
|
||||||
unsigned int n;
|
unsigned int n;
|
||||||
|
|
||||||
for (n = 0; n < EINA_C_ARRAY_LENGTH(block_rects); n++)
|
for (n = 0; n < EINA_C_ARRAY_LENGTH(block_rects); n++)
|
||||||
|
{
|
||||||
E_FREE_FUNC(block_rects[n], evas_object_del);
|
E_FREE_FUNC(block_rects[n], evas_object_del);
|
||||||
|
block_zone[n] = EINA_FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//e_comp_block_window_del();
|
//e_comp_block_window_del();
|
||||||
if (e_config->desklock_language)
|
if (e_config->desklock_language)
|
||||||
|
@ -698,3 +703,20 @@ _e_desklock_cb_randr(void *data EINA_UNUSED, int type EINA_UNUSED, void *event E
|
||||||
e_desklock_show(EINA_FALSE);
|
e_desklock_show(EINA_FALSE);
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
E_API void
|
||||||
|
e_desklock_zone_block_set(const E_Zone *zone, Eina_Bool block)
|
||||||
|
{
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(zone);
|
||||||
|
if (zone->num >= EINA_C_ARRAY_LENGTH(block_rects))
|
||||||
|
{
|
||||||
|
CRI("> %lu screens connected????", EINA_C_ARRAY_LENGTH(block_rects));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
block_zone[zone->num] = !!block;
|
||||||
|
if (!block_rects[zone->num]) return;
|
||||||
|
if (block)
|
||||||
|
evas_object_show(block_rects[zone->num]);
|
||||||
|
else
|
||||||
|
evas_object_hide(block_rects[zone->num]);
|
||||||
|
}
|
||||||
|
|
|
@ -56,6 +56,8 @@ E_API void e_desklock_show_hook_del(E_Desklock_Show_Cb cb);
|
||||||
E_API void e_desklock_hide_hook_add(E_Desklock_Hide_Cb cb);
|
E_API void e_desklock_hide_hook_add(E_Desklock_Hide_Cb cb);
|
||||||
E_API void e_desklock_hide_hook_del(E_Desklock_Hide_Cb cb);
|
E_API void e_desklock_hide_hook_del(E_Desklock_Hide_Cb cb);
|
||||||
|
|
||||||
|
E_API void e_desklock_zone_block_set(const E_Zone *zone, Eina_Bool block);
|
||||||
|
|
||||||
extern E_API int E_EVENT_DESKLOCK;
|
extern E_API int E_EVENT_DESKLOCK;
|
||||||
|
|
||||||
static inline Eina_Bool
|
static inline Eina_Bool
|
||||||
|
|
|
@ -16,6 +16,8 @@ typedef struct Lokker_Popup
|
||||||
Evas_Object *comp_object;
|
Evas_Object *comp_object;
|
||||||
Evas_Object *bg_object;
|
Evas_Object *bg_object;
|
||||||
Evas_Object *login_box;
|
Evas_Object *login_box;
|
||||||
|
Eina_Bool show_anim : 1;
|
||||||
|
Eina_Bool hide_anim : 1;
|
||||||
} Lokker_Popup;
|
} Lokker_Popup;
|
||||||
|
|
||||||
typedef struct Lokker_Data
|
typedef struct Lokker_Data
|
||||||
|
@ -395,6 +397,14 @@ _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);
|
||||||
|
{
|
||||||
|
const char *s;
|
||||||
|
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);
|
||||||
|
s = edje_object_data_get(lp->bg_object, "hide_signal");
|
||||||
|
lp->hide_anim = s && (atoi(s) == 1);
|
||||||
|
}
|
||||||
lp->comp_object = e_comp_object_util_add(lp->bg_object, 0);
|
lp->comp_object = e_comp_object_util_add(lp->bg_object, 0);
|
||||||
{
|
{
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
@ -469,11 +479,10 @@ _lokker_cb_hide_done(void *data, Evas_Object *obj, const char *sig EINA_UNUSED,
|
||||||
static void
|
static void
|
||||||
_lokker_popup_free(Lokker_Popup *lp)
|
_lokker_popup_free(Lokker_Popup *lp)
|
||||||
{
|
{
|
||||||
const char *s;
|
|
||||||
if (!lp) return;
|
if (!lp) return;
|
||||||
|
|
||||||
s = edje_object_data_get(lp->bg_object, "hide_signal");
|
e_desklock_zone_block_set(lp->zone, !lp->hide_anim);
|
||||||
if ((s) && (atoi(s) == 1))
|
if (lp->hide_anim)
|
||||||
{
|
{
|
||||||
evas_object_data_set(lp->bg_object, "comp_object", lp->comp_object);
|
evas_object_data_set(lp->bg_object, "comp_object", lp->comp_object);
|
||||||
evas_object_data_set(lp->bg_object, "login_box", lp->login_box);
|
evas_object_data_set(lp->bg_object, "login_box", lp->login_box);
|
||||||
|
|
Loading…
Reference in New Issue