From d7f7eb9448dc804f0d0d8d09837ad395abb579a8 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 24 Mar 2016 16:41:18 -0400 Subject: [PATCH] redo wayland client unignore mechanism wayland clients were previously set as ignored until they obtained a shell surface in order to avoid early execution of things like placement. this had no effect. the ignore must last until the first commit, at which point surfaces have been sized and can be placed accurately without needing to move the surface around a lot of times due to resize/frame adjust/birthdays --- src/bin/e_comp_wl.c | 23 +++++++++++------------ src/modules/wl_desktop_shell/e_mod_main.c | 12 ++---------- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index 69a698b5a..059a32388 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -1022,7 +1022,7 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state) { Eina_Bool first = EINA_FALSE; Eina_Rectangle *dmg; - Eina_Bool ignored, placed = EINA_TRUE; + Eina_Bool placed = EINA_TRUE; int x = 0, y = 0, w, h; first = !e_pixmap_usable_get(ec->pixmap); @@ -1030,7 +1030,14 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state) if (first && e_client_has_xwindow(ec)) first = !e_pixmap_usable_get(e_comp_x_client_pixmap_get(ec)); #endif - ignored = ec->ignored; + + if (ec->ignored && (ec->comp_data->shell.surface || ec->internal)) + { + EC_CHANGED(ec); + ec->new_client = 1; + e_comp->new_clients++; + e_client_unignore(ec); + } if (state->new_attach) _e_comp_wl_surface_state_attach(ec, state); @@ -1070,7 +1077,7 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state) { if ((ec->comp_data->shell.surface) && (ec->comp_data->shell.unmap)) ec->comp_data->shell.unmap(ec->comp_data->shell.surface); - else if (ec->comp_data->cursor || e_client_has_xwindow(ec) || + else if (ec->comp_data->cursor || e_client_has_xwindow(ec) || ec->internal || (ec->comp_data->sub.data && ec->comp_data->sub.data->parent->comp_data->mapped) || (ec == e_comp_wl->drag_client)) { @@ -1086,7 +1093,7 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state) { if ((ec->comp_data->shell.surface) && (ec->comp_data->shell.map)) ec->comp_data->shell.map(ec->comp_data->shell.surface); - else if (ec->comp_data->cursor || e_client_has_xwindow(ec) || + else if (ec->comp_data->cursor || e_client_has_xwindow(ec) || ec->internal || (ec->comp_data->sub.data && ec->comp_data->sub.data->parent->comp_data->mapped) || (ec == e_comp_wl->drag_client)) { @@ -1149,12 +1156,6 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state) ec->placed = placed; ec->want_focus |= ec->icccm.accepts_focus && (!ec->override); } - else if ((first) && (ec->placed) && (!ec->internal) && (!ec->override)) - { - ec->x = ec->y = 0; - ec->placed = EINA_FALSE; - ec->new_client = EINA_TRUE; - } } state->sx = 0; state->sy = 0; @@ -1166,8 +1167,6 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state) state->frames); state->frames = NULL; - ec->ignored = ignored; - /* put state damages into surface */ if ((!e_comp->nocomp) && (ec->frame)) { diff --git a/src/modules/wl_desktop_shell/e_mod_main.c b/src/modules/wl_desktop_shell/e_mod_main.c index 482d76e2f..5408877ec 100644 --- a/src/modules/wl_desktop_shell/e_mod_main.c +++ b/src/modules/wl_desktop_shell/e_mod_main.c @@ -548,12 +548,7 @@ _e_shell_cb_shell_surface_get(struct wl_client *client, struct wl_resource *reso "No Pixmap Set On Surface"); return; } - - EC_CHANGED(ec); - ec->new_client = ec->netwm.ping = EINA_TRUE; - e_comp->new_clients++; - e_client_unignore(ec); - + ec->netwm.ping = 1; /* get the client data */ if (!(cdata = ec->comp_data)) { @@ -1111,10 +1106,7 @@ _e_xdg_shell_cb_surface_get(struct wl_client *client, struct wl_resource *resour return; } - EC_CHANGED(ec); - ec->new_client = ec->netwm.ping = EINA_TRUE; - e_comp->new_clients++; - e_client_unignore(ec); + ec->netwm.ping = 1; /* get the client data */ if (!(cdata = ec->comp_data))