Re: [E-devel] [EGIT] [core/enlightenment] master 01/01: e focus - fix previous commit segv on no windows left

Christopher Michael <[email protected]> Sat, 8 Jan 2022 19:21:09 -0500
Newsgroups gmane.comp.window-managers.enlightenment.devel
Message-ID <[email protected]>
Love It !!!


On 1/6/22 19:11, Carsten Haitzler wrote:
> raster pushed a commit to branch master.
>
> http://git.enlightenment.org/core/enlightenment.git/commit/?id=61584a5f57c27d2a0835410088091d9dbbdfe57f
>
> commit 61584a5f57c27d2a0835410088091d9dbbdfe57f
> Author: Carsten Haitzler <[email protected]>
> Date:   Fri Jan 7 00:10:13 2022 +0000
>
>      e focus - fix previous commit segv on no windows left
>      
>      if window deleted is the focused on... oops - BOOM. not handled.
>      handle it. also revert x focus to root so bindings work.
>      
>      fixes previous 2d86d75139c40e7365e34880b0e3b56f248b0e41
>      
>      @fix
> ---
>   src/bin/e_client.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
>
> diff --git a/src/bin/e_client.c b/src/bin/e_client.c
> index 85f5504a7..f3d01663b 100644
> --- a/src/bin/e_client.c
> +++ b/src/bin/e_client.c
> @@ -459,6 +459,14 @@ e_client_revert_focus(E_Client *ec)
>   static void
>   _e_client_free(E_Client *ec)
>   {
> +   if (focused == ec)
> +     {
> +        focused = NULL;
> +#ifndef HAVE_WAYLAND_ONLY
> +        if (e_comp->comp_type != E_PIXMAP_TYPE_WL)
> +           ecore_x_window_focus(e_comp->root);
> +#endif
> +     }
>      if (ec->desk)
>        ec->desk->fullscreen_clients = eina_list_remove(ec->desk->fullscreen_clients, ec);
>      if (ec->restore_zone_id)
>