Deliver input events only to window owner

Peter Hutterer peter.hutterer at who-t.net
Thu Dec 3 00:34:04 PST 2015


On Thu, Dec 03, 2015 at 01:51:35AM -0600, Keith Packard wrote:
> Peter Hutterer <peter.hutterer at who-t.net> writes:
> 
> > note that this does not handle XI2 raw keyboard events, they will need to be
> > handled as well.
> 
> Hrm. So, there's a problem here -- raw events get delivered separately
> From core events. Having the window owner select for core events will
> have no effect on whether another client would receive the raw
> events.
> 
> For devices connected to the core keyboard, could we restrict their raw
> events to the client owning the window which would receive any
> corresponding core events?

that's going to be fun to work out. raw events are delivered to the root
window only so you don't really know which client they get delivered to.
They're before the actual event in the pipe, and in some cases the event
isn't delivered to the client (e.g. if a grab deactivates or activates).
Short of folding the raw event into the DeviceEvent and then extracting it
out just before event deliver, I'm not sure how to sensibly work around
this.

Raw keyboard events were a mistake but we already had so many ways to write
a keylogger that one more didn't seem to matter. If we're cutting off all
avenues for keyboard sniffing and we're ok with breaking things (see
synclient), maybe it's worth to to discard raw keyboard events altogether,
possibly based on a ServerFlag.

Cheers,
   Peter



More information about the xorg-devel mailing list