cw->ready_timeout = NULL;
}
if (cw->show_ready) return;
- if (cw->counter) return;
// FIXME: make show_ready option
if (0)
{
cw->update = 0;
cw->c->updates = eina_list_remove(cw->c->updates, cw);
}
- if (cw->counter)
- {
- if (cw->bd)
- ecore_x_e_comp_sync_cancel_send(cw->bd->client.win);
- else
- ecore_x_e_comp_sync_cancel_send(cw->win);
- ecore_x_sync_counter_inc(cw->counter, 1);
- }
DBG("JOB2...");
_e_comp_render_queue(c);
}
_e_comp_event_source_visibility(cw);
// no need for effect
}
- if (cw->counter)
- {
- if (cw->bd)
- ecore_x_e_comp_sync_begin_send(cw->bd->client.win);
- else
- ecore_x_e_comp_sync_begin_send(cw->win);
- }
}
}
{
E_Comp_Win *cw;
Eina_List *new_updates = NULL; // for failed pixmap fetches - get them next frame
- Eina_List *update_done = NULL;
// static int doframeinfo = -1;
if (!c) return EINA_FALSE;
}
EINA_LIST_FREE(c->updates, cw)
{
- if (conf->efl_sync)
- {
- if (((cw->counter) && (cw->drawme)) || (!cw->counter))
- {
- _e_comp_win_update(cw);
- if (cw->drawme)
- {
- update_done = eina_list_append(update_done, cw);
- cw->drawme = 0;
- }
- }
- else
- cw->update = 0;
- }
- else
- _e_comp_win_update(cw);
+ _e_comp_win_update(cw);
if (cw->update)
{
new_updates = eina_list_append(new_updates, cw);
DBG("MANUAL RENDER...");
// if (!c->nocomp) ecore_evas_manual_render(c->ee);
}
- if (conf->efl_sync)
- {
- EINA_LIST_FREE(update_done, cw)
- {
- ecore_x_sync_counter_inc(cw->counter, 1);
- }
- }
if (conf->grab)
{
if (c->grabbed)
return 1;
}
-static Eina_Bool
-_e_comp_win_damage_timeout(void *data)
-{
- E_Comp_Win *cw = data;
-
- if (!cw->update)
- {
- if (cw->update_timeout)
- {
- ecore_timer_del(cw->update_timeout);
- cw->update_timeout = NULL;
- }
- cw->update = 1;
- cw->c->updates = eina_list_append(cw->c->updates, cw);
- }
- cw->drawme = 1;
- _e_comp_win_render_queue(cw);
- cw->update_timeout = NULL;
- return ECORE_CALLBACK_CANCEL;
-}
-
static void
_e_comp_object_del(void *data, void *obj)
{
_e_comp_win_render_queue(cw);
if (obj == cw->bd)
{
- if (cw->counter)
- {
- if (cw->bd)
- ecore_x_e_comp_sync_cancel_send(cw->bd->client.win);
- else
- ecore_x_e_comp_sync_cancel_send(cw->win);
- ecore_x_sync_counter_inc(cw->counter, 1);
- }
if (cw->bd) eina_hash_del(borders, e_util_winid_str_get(cw->bd->client.win), cw);
cw->bd->cw = NULL;
cw->bd = NULL;
evas_object_data_del(cw->shobj, "border");
- // hmm - lockup?
- // cw->counter = 0;
}
else if (obj == cw->pop)
{
}
static void
-_e_comp_win_sync_setup(E_Comp_Win *cw, Ecore_X_Window win)
-{
- if (!conf->efl_sync) return;
-
- if (cw->bd)
- {
- if (_e_comp_win_is_borderless(cw) ||
- (conf->loose_sync))
- cw->counter = ecore_x_e_comp_sync_counter_get(win);
- else
- ecore_x_e_comp_sync_cancel_send(win);
- }
- else
- cw->counter = ecore_x_e_comp_sync_counter_get(win);
- if (cw->counter)
- {
- ecore_x_e_comp_sync_begin_send(win);
- ecore_x_sync_counter_inc(cw->counter, 1);
- }
-}
-
-static void
_e_comp_win_shadow_setup(E_Comp_Win *cw)
{
Evas_Object *o;
cw->opacity = cw->bd->client.netwm.opacity;
cw->eobj = E_OBJECT(cw->bd);
e_object_ref(cw->eobj);
- // setup on show
- // _e_comp_win_sync_setup(cw, cw->bd->client.win);
cw->input_only = cw->bd->client.initial_attributes.input_only;
cw->override = cw->bd->client.initial_attributes.override;
cw->vis = cw->bd->client.initial_attributes.visual;
cw->bg_win = (con && (cw->win == con->bg_win));
}
cw->free_shape = 1;
- // setup on show
- // _e_comp_win_sync_setup(cw, cw->win);
_e_comp_win_shape_create(cw, x, y, w, h);
}
- if (!cw->counter)
- {
- // FIXME: config - disable ready timeout for non-counter wins
- // cw->show_ready = 1;
- }
-
if (cw->bd)
cw->argb = cw->bd->client.argb;
else
}
cw->show_anim = EINA_FALSE;
- // setup on show
- if (cw->bd)
- _e_comp_win_sync_setup(cw, cw->bd->client.win);
- else if (cw->win)
- _e_comp_win_sync_setup(cw, cw->win);
-
if (cw->real_hid)
{
DBG(" [0x%x] real hid - fix", cw->win);
}
cw->hidden.w = w;
cw->hidden.h = h;
- if (cw->counter)
+ if (!((w == cw->w) && (h == cw->h)))
{
- if (!((w == cw->w) && (h == cw->h)))
+ DBG(" [0x%x] rsz %4ix%4i", cw->win, w, h);
+ cw->w = w;
+ cw->h = h;
+ resized = EINA_TRUE;
+ if ((!cw->bd) || ((!cw->bd->shading) && (!cw->bd->shaded)))
{
-#if 1
- cw->w = w;
- cw->h = h;
- resized = EINA_TRUE;
- if (cw->visible && ((!cw->bd) || ((!cw->bd->shading) && (!cw->bd->shaded))))
- {
- cw->needpix = 1;
- // was cw->w / cw->h
- // evas_object_resize(cw->effect_obj, cw->pw, cw->ph);
- _e_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0);
- }
-#else
- if (cw->bd)
- {
- if ((cw->bd->shading) || (cw->bd->shaded))
- {
- resized = EINA_TRUE;
- /* don't need pixmap fetch! */
- _e_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0);
- }
- else
- cw->update = 0;
- }
- else
- {
- cw->update = 0;
- //if (cw->ready_timeout) ecore_timer_del(cw->ready_timeout);
- //cw->ready_timeout = ecore_timer_add(conf->first_draw_delay, _e_comp_cb_win_show_ready_timeout, cw);
- }
-#endif
- }
- if (cw->border != border)
- {
- cw->border = border;
cw->needpix = 1;
// was cw->w / cw->h
// evas_object_resize(cw->effect_obj, cw->pw, cw->ph);
- resized = EINA_TRUE;
- _e_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0);
+ if (!cw->real_obj) _e_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0);
}
- if ((cw->input_only) || (cw->invalid)) return;
}
- else
+ if (cw->border != border)
{
- if (!((w == cw->w) && (h == cw->h)))
- {
- DBG(" [0x%x] rsz %4ix%4i", cw->win, w, h);
- cw->w = w;
- cw->h = h;
- resized = EINA_TRUE;
- if ((!cw->bd) || ((!cw->bd->shading) && (!cw->bd->shaded)))
- {
- cw->needpix = 1;
- // was cw->w / cw->h
- // evas_object_resize(cw->effect_obj, cw->pw, cw->ph);
- if (!cw->real_obj) _e_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0);
- }
- }
- if (cw->border != border)
- {
- cw->border = border;
- cw->needpix = 1;
- // evas_object_resize(cw->effect_obj, cw->pw, cw->ph);
- resized = EINA_TRUE;
- _e_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0);
- }
- if ((cw->input_only) || (cw->invalid)) return;
- _e_comp_win_render_queue(cw);
+ cw->border = border;
+ cw->needpix = 1;
+ // evas_object_resize(cw->effect_obj, cw->pw, cw->ph);
+ resized = EINA_TRUE;
+ _e_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0);
}
+ if ((cw->input_only) || (cw->invalid)) return;
+ _e_comp_win_render_queue(cw);
/* need to block move/resize of the edje for real objects so the external object doesn't
* accidentally get shown and block our show callback
*/
return;
}
e_comp_render_update_add(cw->up, x, y, w, h);
- if (dmg)
- {
- if (cw->counter)
- {
- if (!cw->update_timeout)
- cw->update_timeout = ecore_timer_add
- (ecore_animator_frametime_get() * 2, _e_comp_win_damage_timeout, cw);
- return;
- }
- }
if (!cw->update)
{
//INF("RENDER QUEUE: %p:%u", cw, cw->win);
}
static Eina_Bool
-_e_comp_message(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
-{
- Ecore_X_Event_Client_Message *ev = event;
- E_Comp_Win *cw = NULL;
- int version, w = 0, h = 0;
- Eina_Bool force = 0;
-
- if ((ev->message_type != ECORE_X_ATOM_E_COMP_SYNC_DRAW_DONE) ||
- (ev->format != 32)) return ECORE_CALLBACK_PASS_ON;
- version = ev->data.l[1];
- cw = _e_comp_border_client_find(ev->data.l[0]);
- if (cw)
- {
- if (!cw->bd) return ECORE_CALLBACK_PASS_ON;
- if (ev->data.l[0] != (int)cw->bd->client.win) return ECORE_CALLBACK_PASS_ON;
- }
- else
- {
- cw = _e_comp_win_find(ev->data.l[0]);
- if (!cw) return ECORE_CALLBACK_PASS_ON;
- if (ev->data.l[0] != (int)cw->win) return ECORE_CALLBACK_PASS_ON;
- }
- if (version == 1) // v 0 was first, v1 added size params
- {
- w = ev->data.l[2];
- h = ev->data.l[3];
- if (cw->bd)
- {
- int clw, clh;
-
- if ((cw->bd->shading) || (cw->bd->shaded)) force = 1;
- clw = cw->hidden.w - e_border_inset_width_get(cw->bd);
- clh = cw->hidden.h - e_border_inset_height_get(cw->bd);
- DBG(" [0x%x] sync draw done @%4ix%4i, bd %4ix%4i",
- cw->win, w, h, cw->bd->client.w, cw->bd->client.h);
- if ((w != clw) || (h != clh))
- {
- cw->misses++;
- if (cw->misses > 1)
- {
- cw->misses = 0;
- force = 1;
- }
- else return ECORE_CALLBACK_PASS_ON;
- }
- cw->misses = 0;
- }
- else
- {
- DBG(" [0x%x] sync draw done @%4ix%4i, cw %4ix%4i",
- cw->win, w, h, cw->hidden.w, cw->hidden.h);
- if ((w != cw->hidden.w) || (h != cw->hidden.h))
- {
- if (cw->misses > 1)
- {
- cw->misses = 0;
- force = 1;
- }
- else return ECORE_CALLBACK_PASS_ON;
- }
- cw->misses = 0;
- }
- }
- DBG(" [0x%x] sync draw done %4ix%4i", cw->win, cw->w, cw->h);
- // if (cw->bd)
- {
- if (cw->counter)
- {
- DBG(" [0x%x] have counter", cw->win);
- cw->show_ready = 1;
- if (!cw->update)
- {
- DBG(" [0x%x] set update", cw->win);
- if (cw->update_timeout)
- {
- DBG(" [0x%x] del timeout", cw->win);
- ecore_timer_del(cw->update_timeout);
- cw->update_timeout = NULL;
- }
- cw->update = 1;
- cw->c->updates = eina_list_append(cw->c->updates, cw);
- }
- if ((cw->w != cw->hidden.w) ||
- (cw->h != cw->hidden.h) ||
- (force))
- {
- DBG(" [0x%x] rsz done msg %4ix%4i", cw->win, cw->hidden.w, cw->hidden.h);
- cw->w = cw->hidden.w;
- cw->h = cw->hidden.h;
- cw->needpix = 1;
- // was cw->w / cw->h
- // evas_object_resize(cw->effect_obj, cw->pw, cw->ph);
- _e_comp_win_geometry_update(cw);
- _e_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0);
- }
- cw->drawme = 1;
- _e_comp_win_render_queue(cw);
- }
- }
- return ECORE_CALLBACK_PASS_ON;
-}
-
-static Eina_Bool
_e_comp_shape(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
{
Ecore_X_Event_Window_Shape *ev = event;
}
ecore_x_screen_is_composited_set(man->num, c->cm_selection);
- ecore_x_e_comp_sync_supported_set(man->root, conf->efl_sync);
-
c->man = man;
man->comp = c;
c->win = ecore_x_composite_render_window_enable(man->root);
ecore_job_add(_e_comp_add_fail_job, NULL);
}
- ecore_evas_comp_sync_set(c->ee, 0);
ecore_evas_name_class_set(c->ee, "E", "Comp_EE");
// ecore_evas_manual_render_set(c->ee, conf->lock_fps);
c->evas = ecore_evas_get(c->ee);
while (c->wins)
{
cw = (E_Comp_Win *)(c->wins);
- if (cw->counter)
- {
- ecore_x_sync_counter_free(cw->counter);
- cw->counter = 0;
- }
cw->force = 1;
_e_comp_win_hide(cw);
cw->force = 1;
if (c->nocomp_override_timer) ecore_timer_del(c->nocomp_override_timer);
ecore_x_window_free(c->cm_selection);
- ecore_x_e_comp_sync_supported_set(c->man->root, 0);
ecore_x_screen_is_composited_set(c->man->num, 0);
free(c);
E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_REPARENT, _e_comp_reparent, NULL);
E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_CONFIGURE, _e_comp_configure, NULL);
E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_STACK, _e_comp_stack, NULL);
- E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_CLIENT_MESSAGE, _e_comp_message, NULL);
E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_SHAPE, _e_comp_shape, NULL);
E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_DAMAGE_NOTIFY, _e_comp_damage, NULL);
E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_DAMAGE, _e_comp_damage_win, NULL);
int texture_from_pixmap;
int smooth_windows;
int lock_fps;
- int efl_sync;
- int loose_sync;
int grab;
int vsync;
int swap_mode;
cfdata->texture_from_pixmap = _comp_mod->conf->texture_from_pixmap;
cfdata->smooth_windows = _comp_mod->conf->smooth_windows;
cfdata->lock_fps = _comp_mod->conf->lock_fps;
- cfdata->efl_sync = _comp_mod->conf->efl_sync;
- cfdata->loose_sync = _comp_mod->conf->loose_sync;
cfdata->grab = _comp_mod->conf->grab;
cfdata->vsync = _comp_mod->conf->vsync;
cfdata->swap_mode = _comp_mod->conf->swap_mode;
e_widget_list_object_append(ol, of, 1, 1, 0.5);
*/
of = e_widget_framelist_add(evas, _("Sync"), 0);
- ob = e_widget_check_add(evas, _("Sync windows"), &(cfdata->efl_sync));
- e_widget_framelist_object_append(of, ob);
- ob = e_widget_check_add(evas, _("Loose sync"), &(cfdata->loose_sync));
- e_widget_framelist_object_append(of, ob);
ob = e_widget_check_add(evas, _("Grab Server during draw"), &(cfdata->grab));
e_widget_framelist_object_append(of, ob);
ob = e_widget_label_add(evas, _("Initial draw timeout for newly mapped windows"));
if ((cfdata->engine != _comp_mod->conf->engine) ||
(cfdata->indirect != _comp_mod->conf->indirect) ||
(cfdata->texture_from_pixmap != _comp_mod->conf->texture_from_pixmap) ||
- (cfdata->efl_sync != _comp_mod->conf->efl_sync) ||
- (cfdata->loose_sync != _comp_mod->conf->loose_sync) ||
(cfdata->vsync != _comp_mod->conf->vsync) ||
(cfdata->swap_mode != _comp_mod->conf->swap_mode))
{
_comp_mod->conf->engine = cfdata->engine;
_comp_mod->conf->indirect = cfdata->indirect;
_comp_mod->conf->texture_from_pixmap = cfdata->texture_from_pixmap;
- _comp_mod->conf->efl_sync = cfdata->efl_sync;
- _comp_mod->conf->loose_sync = cfdata->loose_sync;
_comp_mod->conf->vsync = cfdata->vsync;
_comp_mod->conf->swap_mode = cfdata->swap_mode;
if ((cfdata->engine != _comp_mod->conf->engine) ||
(cfdata->indirect != _comp_mod->conf->indirect) ||
(cfdata->texture_from_pixmap != _comp_mod->conf->texture_from_pixmap) ||
- (cfdata->efl_sync != _comp_mod->conf->efl_sync) ||
- (cfdata->loose_sync != _comp_mod->conf->loose_sync) ||
(cfdata->vsync != _comp_mod->conf->vsync))
{
E_Action *a;
_comp_mod->conf->engine = cfdata->engine;
_comp_mod->conf->indirect = cfdata->indirect;
_comp_mod->conf->texture_from_pixmap = cfdata->texture_from_pixmap;
- _comp_mod->conf->efl_sync = cfdata->efl_sync;
- _comp_mod->conf->loose_sync = cfdata->loose_sync;
_comp_mod->conf->vsync = cfdata->vsync;
a = e_action_find("restart");