Defer initial xdg configure for iconified wayland clients

Under wayland, if a client declares itself iconified before its first
commit, we should wait until it's no longer iconified before sending it
a configure.  This way it can avoid uselessly rendering buffers that
will never be displayed.

ref T6834
This commit is contained in:
Derek Foreman 2018-04-18 12:55:35 -05:00 committed by Chris Michael
parent 8d5d0dd5b8
commit 1fccd31c73
1 changed files with 15 additions and 1 deletions

View File

@ -1559,7 +1559,7 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state)
ec->want_focus |= ec->icccm.accepts_focus && (!ec->override);
}
}
else if (ec->comp_data->need_xdg_configure && ec->comp_data->shell.surface)
else if (ec->comp_data->need_xdg_configure && ec->comp_data->shell.surface && !ec->iconic)
_e_comp_wl_configure_send(ec, 0);
state->sx = 0;
@ -2980,6 +2980,17 @@ end:
_e_comp_wl_gl_shutdown();
}
static Eina_Bool
_e_comp_wl_cb_uniconify(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
{
E_Event_Client *ev = event;
E_Client *ec = ev->ec;
if (ec->comp_data->need_xdg_configure)
ec->comp_data->shell.configure_send(ec->comp_data->shell.surface, 0, 0, 0);
return ECORE_CALLBACK_PASS_ON;
}
/* public functions */
/**
@ -3038,6 +3049,9 @@ e_comp_wl_init(void)
E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_MOUSE_MOVE,
_e_comp_wl_cb_mouse_move, NULL);
E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_UNICONIFY,
_e_comp_wl_cb_uniconify, NULL);
/* add hooks to catch e_client events */
e_client_hook_add(E_CLIENT_HOOK_NEW_CLIENT, _e_comp_wl_client_cb_new, NULL);
e_client_hook_add(E_CLIENT_HOOK_DEL, _e_comp_wl_client_cb_del, NULL);