From 8f3c9dd796576e00fe2ddf2878b8655d9e69e4e1 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 10 Feb 2017 17:23:44 -0500 Subject: [PATCH] do not use new_client to determine placement-related paths during wl client commit this is a remnant from xdg5-only code where new_client meant "first buffer". with xdg6, this is no longer the case since a surface can receive infinite commits without ever having a buffer attached ref 9a82f7bcb0650000e31fc34f299af8c7080313ae --- src/bin/e_comp_wl.c | 14 +++++++------- src/bin/e_comp_wl.h | 3 ++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index f01a7b41d..e636ce94c 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -1314,7 +1314,6 @@ _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 placed = EINA_TRUE; int x = 0, y = 0, w, h; first = !e_pixmap_usable_get(ec->pixmap); @@ -1393,13 +1392,11 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state) else { x = ec->client.x, y = ec->client.y; - if (ec->new_client) + if (first) x -= ec->comp_data->shell.window.x, y -= ec->comp_data->shell.window.y; } - if (ec->new_client) placed = ec->placed; - - if (first && e_client_has_xwindow(ec)) + if ((!ec->comp_data->buffer_commit) && e_client_has_xwindow(ec)) /* use client geometry to avoid race condition from x11 configure request */ x = ec->x, y = ec->y; else @@ -1493,9 +1490,10 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state) e_client_util_move_resize_without_frame(ec, x, y, w, h); } - if (ec->new_client) + if ((!ec->comp_data->sub.data) && (!ec->comp_data->buffer_commit)) { - ec->placed = placed; + if (!ec->internal_elm_win) + ec->placed = (!e_client_has_xwindow(ec)) && (ec->netwm.type != E_WINDOW_TYPE_NORMAL); ec->want_focus |= ec->icccm.accepts_focus && (!ec->override); } } @@ -1504,6 +1502,8 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state) state->sx = 0; state->sy = 0; + if (state->new_attach) + ec->comp_data->buffer_commit = 1; state->new_attach = EINA_FALSE; /* insert state frame callbacks into comp_data->frames diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h index dd7fc0eba..b0421ae24 100644 --- a/src/bin/e_comp_wl.h +++ b/src/bin/e_comp_wl.h @@ -355,7 +355,8 @@ struct _E_Comp_Wl_Client_Data Eina_Bool maximizing : 1; Eina_Bool in_commit : 1; Eina_Bool is_xdg_surface : 1; - Eina_Bool grab; + Eina_Bool grab : 1; + Eina_Bool buffer_commit : 1; }; struct _E_Comp_Wl_Output