struct _E_Policy_Quickpanel
{
E_Client *ec;
+ E_Zone *zone;
E_Service_Quickpanel_Type type;
E_Client *below;
e_service_region_rectangle_get(qp->handler_obj, qp->rotation, &x, &y, &w, &h);
EINA_RECTANGLE_SET(&md->handler_rect, x, y, w, h);
- tx = qp->ec->zone->x;
- ty = qp->ec->zone->y;
+ tx = qp->zone->x;
+ ty = qp->zone->y;
if (e_config->use_desk_smart_obj)
{
- desk = e_desk_current_get(qp->ec->zone);
+ desk = e_desk_current_get(qp->zone);
if (desk)
{
tx = desk->geom.x;
QP_VISIBLE_SET(qp, qp->effect.final_visible_state);
qp->effect.active = EINA_FALSE;
- e_zone_orientation_block_set(qp->ec->zone, "quickpanel-mover", EINA_FALSE);
+ e_zone_orientation_block_set(qp->zone, "quickpanel-mover", EINA_FALSE);
/* send visible event to only client with the same type of quickpanel service */
EINA_LIST_FOREACH(qp_clients, l, qp_client)
static void
_e_qp_srv_effect_finish_job_start(E_Policy_Quickpanel *qp, Eina_Bool visible)
{
- E_Client *ec;
int from;
int to;
double duration;
const double ref = 0.1;
- ec = qp->ec;
-
int tw, th;
if (qp->effect.type == E_SERVICE_QUICKPANEL_EFFECT_TYPE_MOVE)
{
}
else
{
- tw = ec->zone->w;
- th = ec->zone->h;
+ tw = qp->zone->w;
+ th = qp->zone->h;
}
switch (qp->rotation)
static Eina_Bool
_e_qp_srv_visibility_eval_by_mouse_info(E_Policy_Quickpanel *qp)
{
- E_Client *ec;
Eina_Bool is_half;
int tw, th;
const float sensitivity = 1.5; /* hard coded. (arbitary) */
- ec = qp->ec;
-
if (qp->effect.type == E_SERVICE_QUICKPANEL_EFFECT_TYPE_MOVE)
{
tw = qp->geom.w;
}
else
{
- tw = ec->zone->w;
- th = ec->zone->h;
+ tw = qp->zone->w;
+ th = qp->zone->h;
}
switch (qp->rotation)
return;
/* Pause changing zone orientation during mover object is working. */
- e_zone_orientation_block_set(qp->ec->zone, "quickpanel-mover", EINA_TRUE);
+ e_zone_orientation_block_set(qp->zone, "quickpanel-mover", EINA_TRUE);
qp->effect.active = EINA_TRUE;
QP_SHOW(qp);
_e_qp_srv_effect_finish_job_end(qp);
else
{
- e_zone_orientation_block_set(qp->ec->zone, "quickpanel-mover", EINA_FALSE);
+ e_zone_orientation_block_set(qp->zone, "quickpanel-mover", EINA_FALSE);
QP_VISIBLE_SET(qp, EINA_FALSE);
E_FREE_FUNC(qp->mover, evas_object_del);
}
if (!qp) return EINA_FALSE;
if (!qp->ec) return EINA_FALSE;
- e_zone_useful_geometry_get(qp->ec->zone, &zx, &zy, &zw, &zh);
+ e_zone_useful_geometry_get(qp->zone, &zx, &zy, &zw, &zh);
for (ec = e_client_below_get(qp->ec); ec; ec = e_client_below_get(ec))
{
if (e_object_is_del(E_OBJECT(qp->ec)))
return;
- desk = e_desk_current_get(qp->ec->zone);
+ desk = e_desk_current_get(qp->zone);
if (desk)
pos_ec = e_client_under_position_get(desk, x, y, NULL);
if (qp->ec != ec)
return;
- _quickpanel_free(qp);
+ e_zone_orientation_force_update_del(qp->zone, ec);
- e_zone_orientation_force_update_del(ec->zone, ec);
+ _quickpanel_free(qp);
}
static void
evas_object_geometry_get(ec->frame, &x, &y, &w, &h);
if (E_INTERSECTS(x, y, w, h,
- ec->zone->x,
- ec->zone->y,
- ec->zone->w,
- ec->zone->h))
+ qp->zone->x,
+ qp->zone->y,
+ qp->zone->w,
+ qp->zone->h))
vis = evas_object_visible_get(ec->frame);
if (!vis)
/* FIXME supported single rectangle, not tiler */
- tx = qp->ec->zone->x;
- ty = qp->ec->zone->y;
- tw = qp->ec->zone->w;
- th = qp->ec->zone->h;
+ tx = qp->zone->x;
+ ty = qp->zone->y;
+ tw = qp->zone->w;
+ th = qp->zone->h;
if (e_config->use_desk_smart_obj)
{
- desk = e_desk_current_get(qp->ec->zone);
+ desk = e_desk_current_get(qp->zone);
if (desk)
{
tx = desk->geom.x;
switch (qp->rotation)
{
case E_POLICY_ANGLE_MAP_90:
- qp->effect.x = vis ? ec->zone->w : 0;
+ qp->effect.x = vis ? qp->zone->w : 0;
break;
case E_POLICY_ANGLE_MAP_180:
- qp->effect.y = vis ? 0 : ec->zone->h;
+ qp->effect.y = vis ? 0 : qp->zone->h;
break;
case E_POLICY_ANGLE_MAP_270:
- qp->effect.x = vis ? 0 : ec->zone->w;
+ qp->effect.x = vis ? 0 : qp->zone->w;
break;
default:
- qp->effect.y = vis ? ec->zone->h : 0;
+ qp->effect.y = vis ? qp->zone->h : 0;
break;
}
E_Client *ec;
int zx, zy, zw, zh;
- zx = qp->ec->zone->x;
- zy = qp->ec->zone->y;
- zw = qp->ec->zone->w;
- zh = qp->ec->zone->h;
+ zx = qp->zone->x;
+ zy = qp->zone->y;
+ zw = qp->zone->w;
+ zh = qp->zone->h;
for (ec = e_client_below_get(qp->ec); ec; ec = e_client_below_get(ec))
{
ev = event;
EINA_SAFETY_ON_NULL_GOTO(ev, end);
- desk = e_desk_current_get(qp->ec->zone);
+ desk = e_desk_current_get(qp->zone);
EINA_SAFETY_ON_NULL_GOTO(desk, end);
for (angle = E_POLICY_ANGLE_MAP_0; angle < E_POLICY_ANGLE_MAP_NUM; angle++)
return ECORE_CALLBACK_PASS_ON;
}
+static Eina_Bool
+_quickpanel_cb_client_zone_set(void *data, int type EINA_UNUSED, void *event)
+{
+ E_Policy_Quickpanel *qp;
+ E_Event_Client_Zone_Set *ev;
+
+ qp = data;
+ ev = event;
+
+ if (qp->ec != ev->ec)
+ goto end;
+
+ if (qp->zone == ev->zone)
+ goto end;
+
+ ELOGF("QUICKPANEL", "Change Zone | qp %p old(%p) new(%p)", qp->ec, qp, qp->zone, ev->zone);
+
+ qp->zone = ev->zone;
+
+end:
+ return ECORE_CALLBACK_PASS_ON;
+}
+
static Evas_Object *
_quickpanel_indicator_object_new(E_Policy_Quickpanel *qp)
{
ELOGF("QUICKPANEL", "Set Client | qp %p", ec, qp);
qp->ec = ec;
+ qp->zone = e_comp_zone_find_by_ec(ec);
qp->show_block = EINA_TRUE;
qp->effect.type = E_SERVICE_QUICKPANEL_EFFECT_TYPE_SWIPE; /* default effect type */
qp->below = _quickpanel_below_visible_client_get(qp);
evas_object_layer_set(o, E_POLICY_QUICKPANEL_LAYER);
evas_object_name_set(o, "qp::bg_rect");
evas_object_move(o, 0, 0);
- evas_object_resize(o, ec->zone->w, ec->zone->h);
+ evas_object_resize(o, qp->zone->w, qp->zone->h);
evas_object_color_set(o, 0, 0, 0, 0);
evas_object_lower(o);
}
qp->bg_rect = NULL;
/* add quickpanel to force update list of zone */
- e_zone_orientation_force_update_add(ec->zone, ec);
+ e_zone_orientation_force_update_add(qp->zone, ec);
QP_HIDE(qp);
E_LIST_HANDLER_APPEND(qp->events, E_EVENT_CLIENT_REMOVE, _quickpanel_cb_client_remove, qp);
E_LIST_HANDLER_APPEND(qp->events, E_EVENT_CLIENT_BUFFER_CHANGE, _quickpanel_cb_buffer_change, qp);
E_LIST_HANDLER_APPEND(qp->events, E_EVENT_CLIENT_FOCUS_IN, _quickpanel_cb_client_focus_in, qp);
+ E_LIST_HANDLER_APPEND(qp->events, E_EVENT_CLIENT_ZONE_SET, _quickpanel_cb_client_zone_set, qp);
E_LIST_HANDLER_APPEND(qp->events, E_EVENT_DESK_GEOMETRY_CHANGE, _quickpanel_cb_desk_geometry_change, qp);
E_COMP_OBJECT_INTERCEPT_HOOK_APPEND(qp->intercept_hooks, E_COMP_OBJECT_INTERCEPT_HOOK_SHOW_HELPER, _quickpanel_intercept_hook_show, qp);
qp->saved_maximize = ec->maximized;
e_client_unmaximize(ec, ec->maximized);
}
- e_client_util_move_resize_without_frame(ec, 0, 0, ec->zone->w, ec->zone->h);
+ e_client_util_move_resize_without_frame(ec, 0, 0, qp->zone->w, qp->zone->h);
break;
case E_SERVICE_QUICKPANEL_EFFECT_TYPE_APP_CUSTOM:
WRN("APP_CUSTOM effect type is not supported yet");
&x, &y, &w, &h);
if (E_INTERSECTS(x, y, w, h,
- ec->zone->x,
- ec->zone->y,
- ec->zone->w,
- ec->zone->h))
+ qp->zone->x,
+ qp->zone->y,
+ qp->zone->w,
+ qp->zone->h))
{
vis = evas_object_visible_get(ec->frame);
if (vis) return EINA_TRUE;
evas_object_geometry_get(qp->ec->frame, &x, &y, &w, &h);
- if (E_INTERSECTS(x, y, w, h, qp->ec->zone->x, qp->ec->zone->y, qp->ec->zone->w, qp->ec->zone->h))
+ if (E_INTERSECTS(x, y, w, h, qp->zone->x, qp->zone->y, qp->zone->w, qp->zone->h))
vis = evas_object_visible_get(qp->ec->frame);
return vis;