VT switch event
Peter Hutterer
peter.hutterer at who-t.net
Sun Dec 6 17:07:19 PST 2009
On Sat, Dec 05, 2009 at 01:38:20PM +0200, Andriy Gapon wrote:
> on 05/12/2009 13:27 Peter Hutterer said the following:
> > On Sat, Dec 05, 2009 at 12:40:12PM +0200, Andriy Gapon wrote:
> >> So indeed, I used a small program xinput and here is its output around VT switch:
> >> $ xinput watch-props "Logitech Deluxe 104"
> >> Device 'Logitech Deluxe 104':
> >> Device Enabled (93): 1
> >> ===> the above printed right after start
> >> Property 'Device Enabled' changed.
> >> Device Enabled (93): 0
> >> Property 'Device Enabled' changed.
> >> Device Enabled (93): 1
> >> ===> this got printed after switching there and back
> >>
> >> I wonder why if this behavior is controllable by X configuration.
> >
> > no, that's a fixed behaviour. all input devices are disabled on VT switch
> > and re-enabled when you switch back.
> > amongst other things this causes some drivers to release the device so it is
> > usable from the tty.
>
> I realized that driver are called for VT switch-out and -in, but I didn't
> realize that X client apps also get notified.
note that this isn't an event for the VT switch as such, it's simply a
enabled/disabled notification for the device.
You'll get the same event when you add/remove a device (preceeded/followed
by a DeviceAdded/DeviceRemoved message) or when a client intentionally
disables that device, either by changing the property or by issuing an
XChangeDeviceControl request.
so you can't rely on those events to determine whether a VT switch has
happened.
Cheers,
Peter
More information about the xorg
mailing list