and some more compositor work - now its looking mroe solid.

SVN revision: 46045
This commit is contained in:
Carsten Haitzler 2010-02-10 14:13:29 +00:00
parent 8296dcf1a2
commit eed1782f5f
5 changed files with 103 additions and 27 deletions

View File

@ -3,6 +3,8 @@
*/
#include "e.h"
EAPI int E_EVENT_INIT_DONE = 0;
/* local function prototypes */
static int _e_init_cb_exe_event_del(void *data __UNUSED__, int type __UNUSED__, void *event);
@ -20,6 +22,7 @@ static Eina_List *stats = NULL;
EAPI int
e_init_init(void)
{
E_EVENT_INIT_DONE = ecore_event_type_new();
exe_del_handler =
ecore_event_handler_add(ECORE_EXE_EVENT_DEL,
_e_init_cb_exe_event_del, NULL);
@ -122,6 +125,7 @@ e_init_done(void)
undone--;
if (undone > 0) return;
done = 1;
ecore_event_add(E_EVENT_INIT_DONE, NULL, NULL, NULL);
// printf("---DONE %p\n", client);
if (!client) return;
ecore_ipc_client_send(client, E_IPC_DOMAIN_INIT, 2, 0, 0, 0, NULL, 0);
@ -199,6 +203,12 @@ e_init_client_del(Ecore_Ipc_Event_Client_Del *e)
}
}
EAPI int
e_init_count_get(void)
{
return undone;
}
/* local functions */
static int
_e_init_cb_exe_event_del(void *data __UNUSED__, int type __UNUSED__, void *event)

View File

@ -17,6 +17,9 @@ EAPI void e_init_done(void);
EAPI void e_init_undone(void);
EAPI void e_init_client_data(Ecore_Ipc_Event_Client_Data *e);
EAPI void e_init_client_del(Ecore_Ipc_Event_Client_Del *e);
EAPI int e_init_count_get(void);
extern EAPI int E_EVENT_INIT_DONE;
#endif
#endif

View File

@ -662,8 +662,6 @@ main(int argc, char **argv)
_e_main_shutdown_push(e_moveresize_shutdown);
TS("splash");
if (!((!e_config->show_splash) || (after_restart)))
{
/* setup init status window/screen */
if (!e_init_init())
{
@ -671,10 +669,12 @@ main(int argc, char **argv)
"Perhaps you are out of memory?"));
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_init_shutdown);
if (!((!e_config->show_splash) || (after_restart)))
{
e_init_title_set(_("Enlightenment"));
e_init_version_set(VERSION);
e_init_show();
_e_main_shutdown_push(e_init_shutdown);
pause();
}
if (!really_know)

View File

@ -255,7 +255,7 @@ _e_mod_comp_win_move_effects_add(E_Comp_Win *cw)
//////////////////////////////////////////////////////////////////////////
#if 1
#if 0
#define DBG(f, x...) printf(f, ##x)
#else
#define DBG(f, x...)
@ -351,8 +351,9 @@ static void
_e_mod_comp_win_update(E_Comp_Win *cw)
{
E_Update_Rect *r;
int i, new_pixmap = 0;
int i/*, new_pixmap = 0*/;
ecore_x_grab();
cw->update = 0;
if (!cw->pixmap)
{
@ -382,11 +383,15 @@ _e_mod_comp_win_update(E_Comp_Win *cw)
cw->pw = 0;
cw->ph = 0;
}
else
new_pixmap = 1;
// else
// new_pixmap = 1;
cw->native = 0;
}
if (!((cw->pw > 0) && (cw->ph > 0))) return;
if (!((cw->pw > 0) && (cw->ph > 0)))
{
ecore_x_ungrab();
return;
}
if ((cw->pw != cw->w) || (cw->ph != cw->h))
{
@ -408,6 +413,7 @@ _e_mod_comp_win_update(E_Comp_Win *cw)
cw->h + (cw->border * 2));
}
}
ecore_x_ungrab();
if ((cw->c->gl) && (_comp_mod->conf->texture_from_pixmap) &&
(!cw->shaped) && (!cw->shape_changed))
@ -415,6 +421,7 @@ _e_mod_comp_win_update(E_Comp_Win *cw)
//y if (new_pixmap)
//y e_mod_comp_update_add(cw->up, 0, 0, cw->pw, cw->ph);
// DBG("DEBUG - pm now %x\n", ecore_x_composite_name_window_pixmap_get(cw->win));
evas_object_image_size_set(cw->obj, cw->pw, cw->ph);
if (!cw->native)
{
@ -436,7 +443,7 @@ _e_mod_comp_win_update(E_Comp_Win *cw)
x = r[i].x; y = r[i].y;
w = r[i].w; h = r[i].h;
DBG("UPDATE [0x%x] %i %i %ix%i\n", cw->win, x, y, w, h);
DBG("UPDATE [0x%x] pm [0x%x] %i %i %ix%i\n", cw->win, cw->pixmap, x, y, w, h);
evas_object_image_data_update_add(cw->obj, x, y, w, h);
}
free(r);
@ -764,7 +771,7 @@ _e_mod_comp_win_add(E_Comp *c, Ecore_X_Window win)
{
cw->redirected = 1;
ecore_x_composite_redirect_window(cw->win, ECORE_X_COMPOSITE_UPDATE_MANUAL);
_e_mod_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0);
//z _e_mod_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0);
}
DBG(" [0x%x] add\n", cw->win);
return cw;
@ -873,7 +880,7 @@ _e_mod_comp_win_show(E_Comp_Win *cw)
{
cw->redirected = 1;
ecore_x_composite_redirect_window(cw->win, ECORE_X_COMPOSITE_UPDATE_MANUAL);
_e_mod_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0);
//z _e_mod_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0);
}
// FIXME: only do this if no bd set
@ -1016,7 +1023,38 @@ _e_mod_comp_win_hide(E_Comp_Win *cw)
evas_object_hide(cw->obj);
if (cw->shobj) evas_object_hide(cw->shobj);
if (_comp_mod->conf->keep_unmapped) return;
if (_comp_mod->conf->keep_unmapped)
{
// fixme: ask the x homies. why does this need to be done?
// why free pixmap (+texture bound), undriect, then redirect again
// getting pixmap againand well - getting texture too again. why?
if (cw->redirected)
{
if (cw->native) evas_object_image_native_surface_set(cw->obj, NULL);
if (cw->pixmap) ecore_x_pixmap_free(cw->pixmap);
evas_object_image_size_set(cw->obj, 1, 1);
cw->pixmap = 0;
cw->pw = 0;
cw->ph = 0;
cw->native = 0;
ecore_x_composite_unredirect_window(cw->win, ECORE_X_COMPOSITE_UPDATE_MANUAL);
ecore_x_composite_redirect_window(cw->win, ECORE_X_COMPOSITE_UPDATE_MANUAL);
cw->pixmap = ecore_x_composite_name_window_pixmap_get(cw->win);
if (cw->pixmap)
ecore_x_pixmap_geometry_get(cw->pixmap, NULL, NULL, &(cw->pw), &(cw->ph));
else
{
cw->pw = 0;
cw->ph = 0;
}
if ((cw->pw <= 0) || (cw->ph <= 0))
{
ecore_x_pixmap_free(cw->pixmap);
cw->pixmap = 0;
}
}
return;
}
if (cw->redirected)
{
@ -1161,7 +1199,7 @@ static void
_e_mod_comp_win_damage(E_Comp_Win *cw, int x, int y, int w, int h, Eina_Bool dmg)
{
if ((cw->input_only) || (cw->invalid)) return;
DBG(" [0x%x] dmg %4i %4i %4ix%4i\n", cw->win, x, y, w, h);
DBG(" [0x%x] dmg [%x] %4i %4i %4ix%4i\n", cw->win, cw->damage, x, y, w, h);
if ((dmg) && (cw->damage))
{
Ecore_X_Region parts;
@ -1171,6 +1209,8 @@ _e_mod_comp_win_damage(E_Comp_Win *cw, int x, int y, int w, int h, Eina_Bool dmg
ecore_x_region_free(parts);
}
e_mod_comp_update_add(cw->up, x, y, w, h);
if (dmg)
{
if (cw->counter)
{
if (!cw->update_timeout)
@ -1179,6 +1219,7 @@ _e_mod_comp_win_damage(E_Comp_Win *cw, int x, int y, int w, int h, Eina_Bool dmg
_e_mod_comp_win_damage_timeout, cw);
return;
}
}
if (!cw->update)
{
cw->update = 1;

View File

@ -3,6 +3,20 @@
#include "e_mod_config.h"
#include "e_mod_comp.h"
static Ecore_Event_Handler *init_done_handler = NULL;
static int
_e_init_done(void *data, int type, void *event)
{
ecore_event_handler_del(init_done_handler);
init_done_handler = NULL;
if (!e_mod_comp_init())
{
// FIXME: handle if comp init fails
}
return 1;
}
/* module private routines */
Mod *_comp_mod = NULL;
@ -75,10 +89,18 @@ e_modapi_init(E_Module *m)
_comp_mod = mod;
if (e_init_count_get() <= 0)
{
if (!e_mod_comp_init())
{
// FIXME: handle if comp init fails
}
}
else
{
init_done_handler = ecore_event_handler_add(E_EVENT_INIT_DONE,
_e_init_done, NULL);
}
return mod;
}