public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Magnus Vigerlöf" <wigge@bigfoot.com>
To: "Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Dmitry Torokhov" <dtor@insightbb.com>,
	linux-input@atrey.karlin.mff.cuni.cz,
	linux-kernel@vger.kernel.org, "Vojtech Pavlik" <vojtech@suse.cz>,
	"Zephaniah E. Hull" <warp@aehallh.com>
Subject: Re: input: evdev.c EVIOCGRAB semantics question
Date: Tue, 15 Aug 2006 00:49:50 +0200	[thread overview]
Message-ID: <200608150049.50815.wigge@bigfoot.com> (raw)
In-Reply-To: <d120d5000608140815g121a84a3o58919582d5797305@mail.gmail.com>

On Monday 14 August 2006 17:15, Dmitry Torokhov wrote:
[...]
> > So why not just make EVIOCGRAB mean "don't send events to
> > mousedev but still report data to others opening the device"?
>
> That darn layering thing. We don't want evdev to know about all other
> handlers there are.

Nonono... I think the layers is a good thingy, even in this case..

What if you turn the whole thing around? Let the handler that should not get 
the events in case someone grabs the device (/dev/input/mice, more devices?) 
say it's so. And when the event is forwarded through the input-layer, check 
if the device is grabbed and in that case skip those handlers that shouldn't 
get any.

It would require an additional field in the input_handle struct that should be 
set to non-zero for mousedev and a change in the event-propagation code to 
send events to all handlers except to those with a non-zero value if grabbed 
(I'd estimate it to be less than 5-10 lines that has to be added/changed).

However, this doesn't address the problem I initially described (I think)... 
What if two application open the same device and one of the application do a 
EVIOCGRAB. Should both applications still get events? With the above fix two 
applications that opens /dev/input/mouse2 resp /dev/input/event4 for the same 
hw and the latter grabs the device, both will get events. Using a counter for 
grab (just like the open-counter) on the handler should make them behave the 
same way in both cases I think. Gnnn... I'll make a patch tomorrow (ok today, 
Tuesday) so you can see what I rambling about..

Won't EVIOCGRAB be quite misnamed (not that I propose a change...) if we make 
a change like this though?

 /Magnus

  reply	other threads:[~2006-08-14 22:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-12 15:24 input: evdev.c EVIOCGRAB semantics question Magnus Vigerlöf
2006-08-12 16:52 ` Zephaniah E. Hull
2006-08-12 21:06   ` Magnus Vigerlöf
2006-08-13  0:00   ` Dmitry Torokhov
2006-08-13  3:28     ` Zephaniah E. Hull
2006-08-14 14:20       ` Dmitry Torokhov
2006-08-14 14:28         ` Zephaniah E. Hull
2006-08-14 15:00           ` Dmitry Torokhov
2006-08-14 16:04             ` Ian Stirling
2006-08-14 16:09             ` Zephaniah E. Hull
2006-08-14 16:22               ` Dmitry Torokhov
2006-08-14 14:58         ` Mattia Dongili
2006-08-14 15:15           ` Dmitry Torokhov
2006-08-14 22:49             ` Magnus Vigerlöf [this message]
2006-08-15 11:51               ` Magnus Vigerlöf
2006-08-15 23:20               ` Magnus Vigerlöf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200608150049.50815.wigge@bigfoot.com \
    --to=wigge@bigfoot.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dtor@insightbb.com \
    --cc=linux-input@atrey.karlin.mff.cuni.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vojtech@suse.cz \
    --cc=warp@aehallh.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox