[PATCH xserver] Input: Send XI2 FocusOut NotifyPointer events to the pointer window.

Peter Hutterer peter.hutterer at who-t.net
Mon May 16 05:17:24 UTC 2016


On Tue, Dec 29, 2015 at 11:41:27PM -0800, Andrew Comminos wrote:
> This changes XInput 2's propagation of NotifyPointer focus out events to
> include the pointer window as well, similar to core events. This fixes
> a potential permanent focus in GDK when the focus moves to PointerRoot.
> 
> Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=93539
> 
> Signed-off-by: Andrew Comminos <andrew at comminos.com>

sorry about the delay here, this one slipped through.

I merged it locally now, with a minor change to the first hunk, it was
missing the curly braces like the other hunks.

Cheers,
   Peter

> ---
>  dix/enterleave.c | 17 ++++++++++++++---
>  1 file changed, 14 insertions(+), 3 deletions(-)
> 
> diff --git a/dix/enterleave.c b/dix/enterleave.c
> index f0b1572..ecca4b8 100644
> --- a/dix/enterleave.c
> +++ b/dix/enterleave.c
> @@ -1447,6 +1447,8 @@ DeviceFocusEvents(DeviceIntPtr dev, WindowPtr from, WindowPtr to, int mode)
>      if ((to == NullWindow) || (to == PointerRootWin)) {
>          if ((from == NullWindow) || (from == PointerRootWin)) {
>              if (from == PointerRootWin)
> +                DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyPointer,
> +                                 sprite->win);
>                  DeviceFocusOutEvents(dev, sprite->win,
>                                       GetCurrentRootWindow(dev), mode,
>                                       NotifyPointer);
> @@ -1456,9 +1458,12 @@ DeviceFocusEvents(DeviceIntPtr dev, WindowPtr from, WindowPtr to, int mode)
>                                   screenInfo.screens[i]->root);
>          }
>          else {
> -            if (IsParent(from, sprite->win))
> +            if (IsParent(from, sprite->win)) {
> +                DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyPointer,
> +                                 sprite->win);
>                  DeviceFocusOutEvents(dev, sprite->win, from, mode,
>                                       NotifyPointer);
> +            }
>              DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyNonlinear, from);
>              /* next call catches the root too, if the screen changed */
>              DeviceFocusOutEvents(dev, from, NullWindow, mode,
> @@ -1476,10 +1481,13 @@ DeviceFocusEvents(DeviceIntPtr dev, WindowPtr from, WindowPtr to, int mode)
>      }
>      else {
>          if ((from == NullWindow) || (from == PointerRootWin)) {
> -            if (from == PointerRootWin)
> +            if (from == PointerRootWin) {
> +                DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyPointer,
> +                                 sprite->win);
>                  DeviceFocusOutEvents(dev, sprite->win,
>                                       GetCurrentRootWindow(dev), mode,
>                                       NotifyPointer);
> +            }
>              for (i = 0; i < nscreens; i++)
>                  DeviceFocusEvent(dev, XI_FocusOut, mode, out,
>                                   screenInfo.screens[i]->root);
> @@ -1506,9 +1514,12 @@ DeviceFocusEvents(DeviceIntPtr dev, WindowPtr from, WindowPtr to, int mode)
>                  if ((IsParent(from, sprite->win)) &&
>                      (sprite->win != from) &&
>                      (!IsParent(to, sprite->win)) &&
> -                    (!IsParent(sprite->win, to)))
> +                    (!IsParent(sprite->win, to))) {
> +                    DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyPointer,
> +                                     sprite->win);
>                      DeviceFocusOutEvents(dev, sprite->win, from, mode,
>                                           NotifyPointer);
> +                }
>                  DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyInferior, from);
>                  DeviceFocusInEvents(dev, from, to, mode, NotifyVirtual);
>                  DeviceFocusEvent(dev, XI_FocusIn, mode, NotifyAncestor, to);
> -- 
> 2.6.4
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
> 


More information about the xorg-devel mailing list