← Back to team overview

multi-touch-dev team mailing list archive

Re: tablets and auto-rotation

 

> > There's a few steps to handle autorotation:
> > 
> > 1. Detect rotation
> >   - Listen for lid switch events?
> >   - Listen for accelerometer events?
> > 2. Rotate screen using XRandR
> > 3. Rotate touchscreen input devices
> >   - X server has a "Coordinate Transformation Matrix" property for each
> > device, use it to perform input coordinate transformation
> > 
> > I have a feeling that step 1 will be hardest, because I don't think
> > there's any standard way to determine device orientation. We probably
> > need some system-wide service to watch for these types of events and
> > handle them appropriately.
> > 
> > Step 2 is already performed by gnome-settings-daemon (g-s-d) when you
> > connect or disconnect a monitor. I would think it could be extended for
> > this purpose.
> > 
> > For step 3 we need a mapping from touchscreens to Xinerama screens. We
> > don't currently have any tool to do this. If you have a touchscreen on
> > one monitor, and you plug in another, you will need to set the transform
> > matrix manually or else your touchscreen will operate over the entire X
> > screen! I don't know where this mapping should live, but if g-s-d could
> > get to it then it could also handle this too.
> > 
> >> The good news is that kernel input subsystem has added (maybe not in the
> >> tree yet, Henrik should be able to tell us more) a new set of ioctl so
> >> we can retrieve the device types directly from the kernel. With this new
> >> ioctl, generic "device self-identification" is available.
> > 
> > Yep, this will be very useful for setting up devices. In XI 2.1, devices
> > will have a "mode" that tells us whether it's being used as a
> > touchscreen or a touchpad or something else. g-s-d could look for these
> > devices to map them to xinerama displays.
> > 
> > I have a feeling we should revisit this at UDS to map out how this
> > should be tackled. There's a good chunk of development here, but it
> > shouldn't be too difficult with the apis and interfaces we have already.
> 
> Agreed :-) In fact, I agreed so much, the first uTouch (and maybe DX
> Team?) blueprint has been created for UDS O in Budapest:
> 
> https://blueprints.launchpad.net/ubuntu/+spec/dx-o-auto-rotate
> 
> Already looking forward to more good discussions :-)

Sounds like a good plan!

Henrik



Follow ups

References