From 0ff2a408d31ff5072e4137841b5bcd279436bf95 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 28 Jan 2014 20:43:19 -0500 Subject: [PATCH] force stacking for all new X clients during add event this fixes a race condition when windows open simultaneously and then are stacked under each other: the previous result was that they would end up hanging out at the top of the window stack (above all windows) until another window was raised above them. now they stack as expected --- src/bin/e_comp_x.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/bin/e_comp_x.c b/src/bin/e_comp_x.c index 4aae3152c..dc904570e 100644 --- a/src/bin/e_comp_x.c +++ b/src/bin/e_comp_x.c @@ -1085,6 +1085,18 @@ _e_comp_x_client_evas_init(E_Client *ec) _e_comp_x_evas_comp_hidden_cb(ec, NULL, NULL); } +static Eina_Bool +_e_comp_x_object_add(void *d EINA_UNUSED, int t EINA_UNUSED, E_Event_Comp_Object *ev) +{ + E_Client *ec; + + ec = e_comp_object_client_get(ev->comp_object); + if (!ec) return ECORE_CALLBACK_RENEW; + _e_comp_x_client_evas_init(ec); + _e_comp_x_client_stack(ec); + return ECORE_CALLBACK_RENEW; +} + static Eina_Bool _e_comp_x_show_request(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_Event_Window_Show_Request *ev) { @@ -5081,6 +5093,8 @@ e_comp_x_init(void) } ecore_x_screensaver_event_listen_set(1); + E_LIST_HANDLER_APPEND(handlers, E_EVENT_COMP_OBJECT_ADD, _e_comp_x_object_add, NULL); + E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_DESTROY, _e_comp_x_destroy, NULL); E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_SHOW, _e_comp_x_show, NULL); E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_SHOW_REQUEST, _e_comp_x_show_request, NULL);