Fix for CSD clients

This commit is contained in:
Davide Andreoli 2023-12-09 10:26:24 +01:00
parent 27f8152634
commit b51262749c
1 changed files with 20 additions and 6 deletions

View File

@ -191,7 +191,7 @@ _load_action(char *name, int id)
data = edje_file_data_get(population->conf->theme, name);
if (!data) return NULL;
ret = sscanf(data, "%d %d %d", &w, &h, &speed);
free(data);
if (ret != 3) return NULL;
@ -386,7 +386,7 @@ _reborn(Penguins_Actor *tux)
tux->reverse = random() % (2);
tux->x = tux->zone->x + (random() % (tux->zone->w - tux->action->w));
tux->y = tux->zone->y - 100;
evas_object_move(tux->obj, (int)tux->x, (int)tux->y);
_start_falling_at(tux, tux->x);
evas_object_resize(tux->obj, tux->action->w, tux->action->h);
@ -588,21 +588,35 @@ _cb_animator(void *data)
static int
_is_inside_any_win(Penguins_Actor *tux, int x, int y, int ret_value)
{
Evas *canvas;
Evas_Object *o;
E_Client *ec;
int xx, yy, ww, hh;
int l, r, t, b;
#if E_VERSION_MAJOR >= 20
o = evas_object_top_get(e_comp->evas);
canvas = e_comp->evas;
#else
o = evas_object_top_get(tux->zone->comp->evas);
canvas = tux->zone->comp->evas;
#endif
o = evas_object_top_get(canvas);
while (o)
{
int xx, yy, ww, hh;
if (evas_object_data_get(o, "comp_object") && evas_object_visible_get(o))
{
evas_object_geometry_get(o, &xx, &yy, &ww, &hh);
if ((ww > 1) && (hh > 1))
{
// E_Clients (windows) need frame adjustment (fe: CSD)
ec = evas_object_data_get(o, "E_Client");
if (ec) {
e_comp_object_frame_geometry_get(o, &l, &r, &t, &b);
xx = ec->client.x - l;
yy = ec->client.y - t;
ww = ec->client.w + l + r;
hh = ec->client.h + t + b;
}
// printf("* LAYER: %d OBJ: %p - %s || %d,%d @ %dx%d\n",
// evas_object_layer_get(o), o, evas_object_name_get(o), xx, yy, ww, hh);