Patchwork Xi: allow passive keygrabs on the XIAll(Master)Devices fake devices

login
register
mail settings
Submitter Peter Hutterer
Date Oct. 27, 2011, 1:51 a.m.
Message ID <20111027015125.GA22525@yabbi.HOME>
Download mbox | patch
Permalink /patch/7707/
State Accepted
Commit 22715e465b415b3351b83b8279a4f44157f63199
Headers show

Comments

Peter Hutterer - Oct. 27, 2011, 1:51 a.m.
They don't have a KeyClassRec, but we must still allow passive grabs on
them.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
 Xi/exevents.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Peter Hutterer - Nov. 1, 2011, 10:58 p.m.
ping?

this issue affects all XI2-capable servers.

On Thu, Oct 27, 2011 at 11:51:25AM +1000, Peter Hutterer wrote:
> They don't have a KeyClassRec, but we must still allow passive grabs on
> them.
> 
> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
> ---
>  Xi/exevents.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/Xi/exevents.c b/Xi/exevents.c
> index 053c76f..edf2c39 100644
> --- a/Xi/exevents.c
> +++ b/Xi/exevents.c
> @@ -1495,7 +1495,7 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device,
>      rc = CheckGrabValues(client, param);
>      if (rc != Success)
>          return rc;
> -    if (k == NULL)
> +    if ((dev->id != XIAllDevices && dev->id != XIAllMasterDevices) && k == NULL)
>  	return BadMatch;
>      if (grabtype == GRABTYPE_XI)
>      {
> -- 
> 1.7.7
Bastien Nocera - Nov. 2, 2011, 7:25 p.m.
On Wed, 2011-11-02 at 08:58 +1000, Peter Hutterer wrote:
> ping?
> 
> this issue affects all XI2-capable servers.

Works for me, but is the same thing needed for the XIUngrabKeycode()
path as well? I get errors when ungrabbing keys with the same parameters
as they have been grabbed with.

> On Thu, Oct 27, 2011 at 11:51:25AM +1000, Peter Hutterer wrote:
> > They don't have a KeyClassRec, but we must still allow passive grabs on
> > them.
> > 
> > Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
> > ---
> >  Xi/exevents.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/Xi/exevents.c b/Xi/exevents.c
> > index 053c76f..edf2c39 100644
> > --- a/Xi/exevents.c
> > +++ b/Xi/exevents.c
> > @@ -1495,7 +1495,7 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device,
> >      rc = CheckGrabValues(client, param);
> >      if (rc != Success)
> >          return rc;
> > -    if (k == NULL)
> > +    if ((dev->id != XIAllDevices && dev->id != XIAllMasterDevices) && k == NULL)
> >  	return BadMatch;
> >      if (grabtype == GRABTYPE_XI)
> >      {
> > -- 
> > 1.7.7
>
Peter Hutterer - Nov. 4, 2011, 1:40 a.m.
On Wed, Nov 02, 2011 at 07:25:50PM +0000, Bastien Nocera wrote:
> On Wed, 2011-11-02 at 08:58 +1000, Peter Hutterer wrote:
> > ping?
> > 
> > this issue affects all XI2-capable servers.
> 
> Works for me, but is the same thing needed for the XIUngrabKeycode()
> path as well? I get errors when ungrabbing keys with the same parameters
> as they have been grabbed with.

For the archives, this issue was unrelated to this patch and already fixed
in xorg-server-1.10.99.902-39-gf52d5cd

    Xi: Fix passive XI2 ungrabs on XIAll[Master]Devices

Cheers,
  Peter

> 
> > On Thu, Oct 27, 2011 at 11:51:25AM +1000, Peter Hutterer wrote:
> > > They don't have a KeyClassRec, but we must still allow passive grabs on
> > > them.
> > > 
> > > Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
> > > ---
> > >  Xi/exevents.c |    2 +-
> > >  1 files changed, 1 insertions(+), 1 deletions(-)
> > > 
> > > diff --git a/Xi/exevents.c b/Xi/exevents.c
> > > index 053c76f..edf2c39 100644
> > > --- a/Xi/exevents.c
> > > +++ b/Xi/exevents.c
> > > @@ -1495,7 +1495,7 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device,
> > >      rc = CheckGrabValues(client, param);
> > >      if (rc != Success)
> > >          return rc;
> > > -    if (k == NULL)
> > > +    if ((dev->id != XIAllDevices && dev->id != XIAllMasterDevices) && k == NULL)
> > >  	return BadMatch;
> > >      if (grabtype == GRABTYPE_XI)
> > >      {
> > > -- 
> > > 1.7.7
> > 
> 
>
Daniel Stone - Nov. 8, 2011, 1:59 p.m.
Hi,

On 27 October 2011 02:51, Peter Hutterer <peter.hutterer@who-t.net> wrote:
> They don't have a KeyClassRec, but we must still allow passive grabs on
> them.
>
> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

Reviewed-by: Daniel Stone <daniel@fooishbar.org>

Cheers,
Daniel

Patch

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 053c76f..edf2c39 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1495,7 +1495,7 @@  GrabKey(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device,
     rc = CheckGrabValues(client, param);
     if (rc != Success)
         return rc;
-    if (k == NULL)
+    if ((dev->id != XIAllDevices && dev->id != XIAllMasterDevices) && k == NULL)
 	return BadMatch;
     if (grabtype == GRABTYPE_XI)
     {