What's the user-visible aspect of this patch?

Which (mis)behavior it fixes?


On Fri, 22 Mar 2013 at 23:23:36 +0100, [email protected] wrote:
> From: Daniel Déchelotte <[email protected]>
> 
> ---
>  src/workspace.c |   19 ++++++++++++++++++-
>  1 file changed, 18 insertions(+), 1 deletion(-)
> 
> diff --git a/src/workspace.c b/src/workspace.c
> index 7b62798..adcf653 100644
> --- a/src/workspace.c
> +++ b/src/workspace.c
> @@ -462,6 +462,8 @@ void wWorkspaceRelativeChange(WScreen * scr, int amount)
>  void wWorkspaceForceChange(WScreen * scr, int workspace)
>  {
>       WWindow *tmp, *foc = NULL, *foc2 = NULL;
> +     WWindow **toUnmap;
> +     int toUnmapSize, toUnmapCount;
>  
>       if (workspace >= MAX_WORKSPACES || workspace < 0)
>               return;
> @@ -480,6 +482,10 @@ void wWorkspaceForceChange(WScreen * scr, int workspace)
>  
>       wWorkspaceMenuUpdate(scr, scr->clip_ws_menu);
>  
> +     toUnmapSize = 16;
> +     toUnmapCount = 0;
> +     toUnmap = wmalloc(toUnmapSize * sizeof(WWindow *));
> +
>       if ((tmp = scr->focused_window) != NULL) {
>               if ((IS_OMNIPRESENT(tmp) && (tmp->flags.mapped || 
> tmp->flags.shaded) &&
>                    !WFLAGP(tmp, no_focusable)) || 
> tmp->flags.changing_workspace) {
> @@ -494,7 +500,12 @@ void wWorkspaceForceChange(WScreen * scr, int workspace)
>                               /* unmap windows not on this workspace */
>                               if ((tmp->flags.mapped || tmp->flags.shaded) &&
>                                   !IS_OMNIPRESENT(tmp) && 
> !tmp->flags.changing_workspace) {
> -                                     wWindowUnmap(tmp);
> +                                     if (toUnmapCount == toUnmapSize)
> +                                     {
> +                                             toUnmapSize *= 2;
> +                                             toUnmap = wrealloc(toUnmap, 
> toUnmapSize * sizeof(WWindow *));
> +                                     }
> +                                     toUnmap[toUnmapCount++] = tmp;
>                               }
>                               /* also unmap miniwindows not on this workspace 
> */
>                               if (!wPreferences.sticky_icons && 
> tmp->flags.miniaturized &&
> @@ -543,6 +554,12 @@ void wWorkspaceForceChange(WScreen * scr, int workspace)
>                       tmp = tmp->prev;
>               }
>  
> +             while (toUnmapCount > 0)
> +             {
> +                     wWindowUnmap(toUnmap[--toUnmapCount]);
> +             }
> +             wfree(toUnmap);
> +
>               /* Gobble up events unleashed by our mapping & unmapping.
>                * These may trigger various grab-initiated focus &
>                * crossing events. However, we don't care about them,
> -- 
> 1.7.10.4
> 
> 
> -- 
> To unsubscribe, send mail to [email protected].


-- 
To unsubscribe, send mail to [email protected].

Reply via email to