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
This commit is contained in:
Mike Blumenkrantz 2014-01-28 20:43:19 -05:00
parent 576f0bab2d
commit 0ff2a408d3
1 changed files with 14 additions and 0 deletions

View File

@ -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);