int x, y, w, h;
};
-typedef enum
-{
- E_GEOMETRY_NONE = 0,
- E_GEOMETRY_POS = (1 << 0),
- E_GEOMETRY_SIZE = (1 << 1)
-} E_Client_Demand_Geometry;
-
struct _E_Client_Pending_Geometry
{
- E_Client_Demand_Geometry mode;
int x, y, w, h;
unsigned int serial;
};
EINTERN void e_client_pending_geometry_flush(E_Client *ec);
EINTERN Eina_Bool e_client_pending_geometry_has(E_Client *ec);
+EINTERN void e_client_pending_geometry_last_geometry_get(E_Client *ec, int *x, int *y, int *w, int *h);
E_API void e_client_frame_focus_set(E_Client *ec, Eina_Bool focus);
E_API void e_client_frame_geometry_set(E_Client *ec, int x, int y, int w, int h);
// --------------------------------------------------------
EINTERN Eina_Bool
e_comp_wl_commit_sync_client_geometry_add(E_Client *ec,
- E_Client_Demand_Geometry mode,
uint32_t serial,
int32_t x,
int32_t y,
if (!ec) goto ret;
if (e_object_is_del(E_OBJECT(ec))) goto ret;
if (ec->fullscreen || ec->maximized) goto err;
- if (mode == E_GEOMETRY_NONE) goto err;
geo = E_NEW(E_Client_Pending_Geometry, 1);
if (!geo) goto err;
geo->serial = serial;
- geo->mode = mode;
- if (mode & E_GEOMETRY_POS)
- {
- geo->x = x;
- geo->y = y;
- }
- if (mode & E_GEOMETRY_SIZE)
- {
- geo->w = w;
- geo->h = h;
- }
+ geo->x = x;
+ geo->y = y;
+ geo->w = w;
+ geo->h = h;
ec->surface_sync.pending_geometry = eina_list_append(ec->surface_sync.pending_geometry, geo);
ec->surface_sync.wait_commit = EINA_TRUE;
{
Eina_List *l;
E_Client_Pending_Geometry *geo;
- E_Client_Demand_Geometry change = 0;
int bw, bh;
+ Eina_Bool match_size = EINA_FALSE;
+
struct
{
int x, y, w, h;
if (eina_list_count(ec->surface_sync.pending_geometry))
{
Eina_List *ll = NULL;
- Eina_Bool match_size = EINA_FALSE;
EINA_LIST_REVERSE_FOREACH_SAFE(ec->surface_sync.pending_geometry, l, ll, geo)
{
if (match_size)
if ((geo->w == bw) && (geo->h == bh))
{
match_size = EINA_TRUE;
- if (geo->mode & E_GEOMETRY_SIZE)
- {
- config.w = geo->w;
- config.h = geo->h;
- }
- if (geo->mode & E_GEOMETRY_POS)
- {
- config.x = geo->x;
- config.y = geo->y;
- }
- change |= geo->mode;
+ config.w = geo->w;
+ config.h = geo->h;
+ config.x = geo->x;
+ config.y = geo->y;
ec->surface_sync.pending_geometry = eina_list_remove(ec->surface_sync.pending_geometry, geo);
E_FREE(geo);
}
}
- if (change & E_GEOMETRY_SIZE)
+ if (match_size)
{
if ((config.w != ec->w) || (config.h != ec->h))
{
ec->changes.size = EINA_TRUE;
EC_CHANGED(ec);
}
- }
- if (change & E_GEOMETRY_POS)
- {
ec->client.x = ec->desk->geom.x + config.x;
ec->client.y = ec->desk->geom.y + config.y;
- e_client_pos_set(ec, ec->client.x, ec->client.y);
- ec->placed = 1;
- ec->changes.pos = 1;
- EC_CHANGED(ec);
- }
+ if ((ec->client.x != ec->x) || (ec->client.y != ec->y))
+ {
+ e_client_pos_set(ec, ec->client.x, ec->client.y);
+ ec->placed = 1;
+ ec->changes.pos = 1;
+ EC_CHANGED(ec);
+ }
- if (change)
- ELOGF("POSSIZE", "Configure pending geometry mode:%d(%d,%d - %dx%d)", ec, change, ec->x, ec->y, ec->w, ec->h);
+ ELOGF("POSSIZE", "Configure pending geometry (%d,%d,%dx%d)", ec, ec->x, ec->y, ec->w, ec->h);
+ }
}
// cw interceptor(move,resize) won't work if wait_commit is TRUE
}
}
- if (!e_comp_wl_commit_sync_client_geometry_add(ec, E_GEOMETRY_POS | E_GEOMETRY_SIZE, serial, x, y, w, h)) goto err;
+ if (!e_comp_wl_commit_sync_client_geometry_add(ec, serial, x, y, w, h)) goto err;
return;
err:
EINTERN extern int E_EVENT_WAYLAND_GLOBAL_ADD;
-EINTERN Eina_Bool e_comp_wl_commit_sync_client_geometry_add(E_Client *ec, E_Client_Demand_Geometry mode, uint32_t serial, int32_t x, int32_t y, int32_t w, int32_t h);
+EINTERN Eina_Bool e_comp_wl_commit_sync_client_geometry_add(E_Client *ec, uint32_t serial, int32_t x, int32_t y, int32_t w, int32_t h);
EINTERN Eina_Bool e_comp_wl_commit_sync_configure(E_Client *ec);
EINTERN Eina_Bool e_comp_wl_pid_output_configured_resolution_send(pid_t pid, int w, int h);
// if there is geometry pending list, add move job at the end of the list.
// so client to be applied new position at the same time with the pending requests
// pending geometries are flushed when 'wl surface commit' and matched serial are delivered.
- e_comp_wl_commit_sync_client_geometry_add(ec, E_GEOMETRY_POS, ec->surface_sync.serial, x, y, 0, 0);
+ int w, h;
+ e_client_pending_geometry_last_geometry_get(ec, NULL, NULL, &w, &h);
+ e_comp_wl_commit_sync_client_geometry_add(ec, ec->surface_sync.serial, x, y, w, h);
}
else
{