Bug 526825

Summary: KRandR should rotate tablet when rotating screen on Tablet PCs
Product: [openSUSE] openSUSE 11.2 Reporter: Forgotten User tCnyPY8iPq <forgotten_tCnyPY8iPq>
Component: KDE4 WorkspaceAssignee: Stefan Dirsch <sndirsch>
Status: RESOLVED UPSTREAM QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P2 - High CC: cfeck
Version: RC 1   
Target Milestone: ---   
Hardware: x86-64   
OS: SUSE Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Forgotten User tCnyPY8iPq 2009-07-30 16:24:30 UTC
User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.0) Gecko/20090623 SUSE/3.5.0-4.6 Firefox/3.5

On tablet PCs, KRandR should rotate the tablet orientation according to the screen orientation. It should execute something like:

  0°:    xsetwacom set "Mouse[7]" Rotate NONE
 90°:    xsetwacom set "Mouse[7]" Rotate CW
180°:    xsetwacom set "Mouse[7]" Rotate HALF
270°:    xsetwacom set "Mouse[7]" Rotate CCW

"Mouse[7]" should be substituted with the correct entry defined in xorg.conf. (It's the right setting for my Tablet).

Reproducible: Always

Steps to Reproduce:
0. Own a Tablet PC
1. Open KRandR
2. Rotate 90° using KRandR
3. Try moving the cursor
Actual Results:  
The cursor is not under the pen, because its coordinates remained the same, while the screen coordinates rotated.

Expected Results:  
The cursor is approximately under the pen.
Comment 1 Forgotten User tCnyPY8iPq 2009-07-30 16:31:30 UTC
I confused the 90° and 270° commands, the correct ones are:

 90°: xsetwacom set "Mouse[7]" Rotate CCW
270°: xsetwacom set "Mouse[7]" Rotate CW
Comment 2 Stephan Binner 2009-08-19 06:04:26 UTC
Have a look at kdebase3/rotate-wacom-pointers.diff maybe
Comment 3 Forgotten User tCnyPY8iPq 2009-10-16 17:48:01 UTC
Still an issue in RC1.
Comment 4 Lubos Lunak 2009-11-11 09:18:24 UTC
I do not have the hardware to actually test this. Can you try from home:llunak:bnc526825 repository?
Comment 5 Forgotten User tCnyPY8iPq 2009-11-11 11:56:14 UTC
It still doesn't work.

With those packages, krandr prints this on the command-line (not sure if it did this before):

  X Error: BadMatch (invalid parameter attributes) 8
  Extension:    149 (RANDR)
  Minor opcode: 7 (RRSetScreenSize)
  Resource id:  0x10a

But I think this is not related to this bug.
(Maybe it could be related to bug 531343)

Looking at your patch I saw that you execute "xsetwacom list" to get the list of available Wacom tablets. I tried executing this command from the command-line and it prints:

invalid escape %D found in path template
invalid escape %D found in path template
Unable to open config file
Comment 6 Lubos Lunak 2009-11-11 12:22:29 UTC
Maybe it's the xsetwacom tool broken then? Does it work otherwise? Is there some way to find the identified for the tablet?
Comment 7 Christoph Feck 2009-11-11 12:33:43 UTC
On my system, I get "xsetwacom list":

Mouse[3]         cursor
Mouse[5]         stylus
Mouse[7]         eraser
Comment 8 Forgotten User tCnyPY8iPq 2009-11-11 13:58:25 UTC
@Christoph:

You're using an xorg.conf, aren't you?
Those names are usually contained in SaX-generated xorg.conf .

I'm not using a xorg.conf, I've never run SaX because I use X HW autodetection.

@Lunak:

I can find the Wacom tablet running (as root) "hwinfo". The interesting parts (on my Tablet) are:

  14: udi = '/org/freedesktop/Hal/devices/pnp_WACf004_serial_platform_4'
  linux.hotplug_type = 2 (0x2)
  linux.subsystem = 'tty'
  serial.originating_device = '/org/freedesktop/Hal/devices/pnp_WACf004'
  serial.device = '/dev/ttyS4'
  serial.port = 4 (0x4)
  serial.type = 'platform'
  input.device = '/dev/ttyS4'
  info.subsystem = 'tty'
  info.product = 'Wacom Serial Tablet PC Pen Tablet/Digitizer'
  linux.sysfs_path = '/sys/devices/pnp0/00:02/tty/ttyS4'
  info.parent = '/org/freedesktop/Hal/devices/pnp_WACf004'
  input.x11_driver = 'wacom'
  info.udi = '/org/freedesktop/Hal/devices/pnp_WACf004_serial_platform_4'
  info.category = 'serial'
  info.capabilities = { 'serial', 'input' }
  wacom.types = { 'eraser' }
  linux.device_file = '/dev/ttyS4'
  input.x11_options.Type = 'stylus'
  input.x11_options.ForceDevice = 'ISDV4'
  info.callouts.add = { 'hal-setup-wacom' }

  15: udi = '/org/freedesktop/Hal/devices/pnp_WACf004_serial_platform_4_subdev'
  input.x11_options.Type = 'eraser'
  info.product = 'Wacom Serial Tablet PC Pen Tablet/Digitizer eraser'
  input.x11_options.ForceDevice = 'ISDV4'
  input.device = '/dev/ttyS4'
  info.parent = '/org/freedesktop/Hal/devices/pnp_WACf004_serial_platform_4'
  info.capabilities = { 'input' }
  input.x11_driver = 'wacom'
  info.udi = '/org/freedesktop/Hal/devices/pnp_WACf004_serial_platform_4_subdev'

You can recognise the interesting parts because they contain
«input.x11_driver = 'wacom'»
and then you should use the value specified in «info.product» (removing the single quotes).

So, instead of "Mouse[7]" you should use "Wacom Serial Tablet PC Pen Tablet/Digitizer" and "Wacom Serial Tablet PC Pen Tablet/Digitizer eraser".

I don't know other ways to query these things (an user-mode query would be useful).
Comment 9 Lubos Lunak 2009-11-11 14:19:26 UTC
I would consider this to be a xsetwacom bug then, reassigning.
x11-input-wacom maintainer: see comment #5.
Comment 10 Stefan Dirsch 2009-11-11 17:42:32 UTC
I remember. xsetwacom uses the identifier for the wacom sections from xorg.conf. If there isn't any xorg.conf this cannot work. This needs to be fixed upstream. Workaround is to use a xorg.conf created by SaX2. Actually there is hope that things become better. Peter Hutterer, the X.Org input expert is currently taking care of wacom driver. :-)