move the part of code for fetch transient_for in eval time to _e_shell_surface_parent_set().

Summary:
we need to set ec->parent before eval time.
that's because client can request to commit surface calling shell.configure() before eval time.
in this case, ec->parent isn't set yet, configure(move) will be failed.

in order to fix it, we have to set ec->parent in _e_shell_surface_parent_set() before eval time,
but we should check if ec already have parent, and if so, remove its parent's transients before change the value of ec->parent.

Test Plan: N/A

Reviewers: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1177
This commit is contained in:
Seunghun Lee 2014-07-11 09:15:22 -04:00 committed by Chris Michael
parent 6248f11b80
commit e5f293214d
2 changed files with 21 additions and 29 deletions

View File

@ -2238,35 +2238,6 @@ _e_comp_wl_cb_hook_client_eval_fetch(void *data EINA_UNUSED, E_Client *ec)
if (ec->icccm.fetch.transient_for)
{
E_Client *pc = NULL;
if (ec->icccm.transient_for)
{
pc = eina_hash_find(clients_win_hash, &ec->icccm.transient_for);
if ((pc) && (e_object_is_del(E_OBJECT(pc)))) pc = NULL;
}
/* If we already have a parent, remove it */
if (ec->parent)
{
if (pc != ec->parent)
{
ec->parent->transients =
eina_list_remove(ec->parent->transients, ec);
if (ec->parent->modal == ec) ec->parent->modal = NULL;
ec->parent = NULL;
}
else
pc = NULL;
}
if ((pc) && (pc != ec) &&
(eina_list_data_find(ec->transients, pc) != pc))
{
pc->transients = eina_list_append(pc->transients, ec);
ec->parent = pc;
}
if (ec->parent)
{
evas_object_layer_set(ec->frame, ec->parent->layer);

View File

@ -28,6 +28,27 @@ _e_shell_surface_parent_set(E_Client *ec, struct wl_resource *parent_resource)
e_pixmap_parent_window_set(ec->pixmap, pwin);
/* If we already have a parent, remove it */
if (ec->parent)
{
if (pc != ec->parent)
{
ec->parent->transients =
eina_list_remove(ec->parent->transients, ec);
if (ec->parent->modal == ec) ec->parent->modal = NULL;
ec->parent = NULL;
}
else
pc = NULL;
}
if ((pc) && (pc != ec) &&
(eina_list_data_find(pc->transients, ec) != ec))
{
pc->transients = eina_list_append(pc->transients, ec);
ec->parent = pc;
}
ec->icccm.fetch.transient_for = EINA_TRUE;
ec->icccm.transient_for = pwin;
}