From e5f293214dc69022596e662db471c6323182fa1c Mon Sep 17 00:00:00 2001 From: Seunghun Lee Date: Fri, 11 Jul 2014 09:15:22 -0400 Subject: [PATCH] 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 --- src/bin/e_comp_wl.c | 29 ----------------------- src/modules/wl_desktop_shell/e_mod_main.c | 21 ++++++++++++++++ 2 files changed, 21 insertions(+), 29 deletions(-) diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index 46abd1863..26a849e05 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -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); diff --git a/src/modules/wl_desktop_shell/e_mod_main.c b/src/modules/wl_desktop_shell/e_mod_main.c index e22e6be62..976aa077e 100644 --- a/src/modules/wl_desktop_shell/e_mod_main.c +++ b/src/modules/wl_desktop_shell/e_mod_main.c @@ -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; }