[PATCH 07/11] mi: Factor out visibility notify check/send

Aaron Plattner aplattner at nvidia.com
Fri Sep 19 14:17:48 PDT 2014


On 09/18/2014 10:23 AM, Adam Jackson wrote:
> Signed-off-by: Adam Jackson <ajax at redhat.com>
> ---
>   mi/mivaltree.c | 19 +++++++++++--------
>   1 file changed, 11 insertions(+), 8 deletions(-)
>
> diff --git a/mi/mivaltree.c b/mi/mivaltree.c
> index c1cc431..2a39c56 100644
> --- a/mi/mivaltree.c
> +++ b/mi/mivaltree.c
> @@ -171,6 +171,14 @@ miRegisterRedirectBorderClipProc(SetRedirectBorderClipProcPtr setBorderClip,
>       miGetRedirectBorderClipProc = getBorderClip;
>   }
>
> +static void
> +doVisibilityNotify(WindowPtr pWin, unsigned oldVis)
> +{
> +    if (oldVis != pWin->visibility &&
> +        ((pWin->eventMask | wOtherEventMasks(pWin)) & VisibilityChangeMask))
> +        SendVisibilityNotify(pWin);
> +}
> +
>   /*
>    * Manual redirected windows are treated as transparent; they do not obscure
>    * siblings or parent windows
> @@ -281,10 +289,7 @@ miComputeClips(WindowPtr pParent,
>           break;
>       }
>       pParent->visibility = newVis;
> -    if (oldVis != newVis &&
> -        ((pParent->
> -          eventMask | wOtherEventMasks(pParent)) & VisibilityChangeMask))
> -        SendVisibilityNotify(pParent);
> +    doVisibilityNotify(pParent, oldVis);
>
>       dx = pParent->drawable.x - pParent->valdata->before.oldAbsCorner.x;
>       dy = pParent->drawable.y - pParent->valdata->before.oldAbsCorner.y;
> @@ -499,10 +504,8 @@ miTreeObscured(WindowPtr pParent)
>       while (1) {
>           if (pChild->viewable) {
>               oldVis = pChild->visibility;
> -            if (oldVis != (pChild->visibility = VisibilityFullyObscured) &&

... because this is completely obvious.  <eyeroll/>

> -                ((pChild->
> -                  eventMask | wOtherEventMasks(pChild)) & VisibilityChangeMask))
> -                SendVisibilityNotify(pChild);
> +            pChild->visibility = VisibilityFullyObscured;
> +            doVisibilityNotify(pChild, oldVis);
>               if (pChild->firstChild) {
>                   pChild = pChild->firstChild;
>                   continue;
>

Reviewed-by: Aaron Plattner <aplattner at nvidia.com>

-- 
Aaron


More information about the xorg-devel mailing list