return NULL;
}
+EINTERN void
+e_comp_default_zone_set(E_Comp *comp, E_Zone *zone)
+{
+ EINA_SAFETY_ON_NULL_RETURN(comp);
+ EINA_SAFETY_ON_NULL_RETURN(zone);
+
+ ELOGF("COMP", "Changed default zone from ID:%d(%p) -> ID:%d(%p)", NULL,
+ e_zone_id_get(comp->default_zone), comp->default_zone, e_zone_id_get(zone), zone);
+ comp->default_zone = zone;
+}
+
+EINTERN E_Zone *
+e_comp_default_zone_get(E_Comp *comp)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp, NULL);
+
+ if (comp->default_zone)
+ return comp->default_zone;
+ else
+ return eina_list_data_get(e_comp->zones);
+}
+
E_API Evas *
e_comp_evas_get(void)
{
_e_comp_screen_screen_policy_setup(void)
{
Eina_List *screens;
+ E_Comp *comp;
+ E_Zone *first_zone = NULL;
E_Screen *scr;
Eina_List *l;
+ comp = e_comp_get();
e_policy_desk_init();
e_policy_desk_area_init();
&scr->tizen_screen_destroy);
if (scr->id) scr->zone->output_id = strdup(scr->id);
+ if (!first_zone) first_zone = scr->zone;
+
printf("@@@ NEW ZONE = %p, %p\n", scr->zone, scr->tz_screen);
}
E_LIST_HANDLER_APPEND(event_handlers, E_EVENT_ZONE_ADD, _e_comp_cb_zone_change, NULL);
E_LIST_HANDLER_APPEND(event_handlers, E_EVENT_COMPOSITOR_ENABLE, _e_comp_cb_compositor_enabled, NULL);
+ e_comp_default_zone_set(comp, first_zone);
+
return EINA_TRUE;
}
{
E_Policy_Zone_Client *zone_client;
E_Policy_Zone *policy_zone;
- E_Zone *zone;
+ E_Zone *default_zone, *zone;
E_Client *ec;
+ E_Comp *comp;
int tx, ty, tw, th;
int nw, nh;
int zx = 0, zy = 0, zw = 0, zh = 0;
policy_zone = zone_client->policy_zone;
zone = policy_zone->zone;
ec = zone_client->ec;
+ comp = e_comp_get();
e_zone_useful_geometry_get(zone, &zx, &zy, &zw, &zh);
/* enforce wm size hints for initial sizing */
if ((!ec->re_manage) && ((ec->x != x) || (ec->y != y)))
zone1 = e_comp_zone_xy_get(x, y);
+ if (!zone1)
+ {
+ default_zone = e_comp_default_zone_get(comp);
+ e_zone_useful_geometry_get(default_zone, &zx, &zy, &zw, &zh);
+ if (default_zone && E_INSIDE(x, y, zx, zy, zw, zh))
+ zone1 = default_zone;
+ }
+
if (!zone1)
{
zone1 = e_comp_zone_xy_get(ec->x + (ec->w / 2), ec->y + (ec->h / 2));
static void
_e_policy_zone_cb_hook_client_new_client_post(void *d, E_Client *ec)
{
- E_Zone *zone;
+ E_Comp *comp;
+ E_Zone *default_zone, *zone;
EINA_SAFETY_ON_NULL_RETURN(ec);
zone = (E_Zone *)d;
EINA_SAFETY_ON_NULL_RETURN(zone);
- // FIXME: A ec is set the current zone now.
- // We need to make a policy for the placement of the ec at the zone.
- if (zone != e_zone_current_get()) return;
+ comp = e_comp_get();
+ default_zone = e_comp_default_zone_get(comp);
+ if (default_zone)
+ {
+ if (default_zone != zone) return;
+ }
+ else
+ {
+ if (e_zone_current_get() != zone) return;
+ }
e_policy_client_add(ec);
e_zone_client_add(zone, ec);