The Smell of Molten Projects in the Morning

Ed Nisley's Blog: Shop notes, electronics, firmware, machinery, 3D printing, laser cuttery, and curiosities. Contents: 100% human thinking, 0% AI slop.

Dual Displays vs Wacom Tablet vs xorg.conf

So, as I wondered there, it turns out that the tablet cursor can fall into the crack between my landscape left monitor and portrait right monitor, with the distressing result that the X server jams with the pointer jittering between the two displays. Worse, the keyboard isn’t active, so I can’t switch to a console screen and shoot X in the head.

I’m guessing this is a picket-fence error, where Something Bad Happens when the cursor hits the maximum possible value: X=16704, in this case.

The solution seems to be telling the Wacom driver that the tablet is just slightly wider than it really is, so that the X value can’t ever reach the maximum. Having done this before, the line is already in my xorg.conf, just waiting to be un-commented:

Section "InputDevice"
    Identifier      "Wacom - stylus"
    Driver          "wacom"
    Option          "Device" "/dev/input/wacom"
    Option          "USB" "on"
    Option          "Type" "stylus"
    Option          "Button2" "3"
    Option          "Button3" "2"
    Option          "MMonitor" "off"
    Option          "ScreenNo" "0"
    Option          "BottomX" "16710"
#    Option          "BottomY" "11893"
EndSection

Section "InputDevice"
    Identifier      "Wacom - eraser"
    Option          "Device" "/dev/input/wacom"
    Driver          "wacom"
    Option          "USB" "on"
    Option          "Type" "eraser"
    Option          "MMonitor" "off"
    Option          "ScreenNo" "0"
    Option          "BottomX" "16710"
#    Option          "BottomY" "11893"
EndSection

That seems to work, but the failure was intermittent. We shall see…

Comments

5 responses to “Dual Displays vs Wacom Tablet vs xorg.conf”

  1. X Server 1.18 vs Wacom: Back to the Mainline « The Smell of Molten Projects in the Morning Avatar

    […] recently tweaked the tablet coordinates to keep the pointer out of the gutter, I first thought I’d killed something… but that […]

  2. Georgiy Avatar
    Georgiy

    As a workaround for cursor jitter between two screens I found what using non-identity coordinate transformation matrix may help. It appears some shortcuts/optimizations inside X not always work as expected:

    In short:

    xinput set-prop Stylus0 –type=float “Coordinate Transformation Matrix” 0.999738 0 0 0 1 0 0 0 1

    fixed an issue for me.

    0.99973 is a value closest to 1.0 but not quite – so X will not consider that matrix as identity, possibly skipping all shortcuts/optimizations

    1. Ed Avatar

      Wow! I had no idea X did that sort of thing under the covers.

      Perhaps the integer identity matrix maps one particular tablet coordinate to both screens, after which X suffers a nervous breakdown. Most of the time the tablet doesn’t produce that value and everything works perfectly.

      I’m getting ready to upgrade this box and plan to start with a clean install, so that trick may be very useful!

      Thanks …

      1. Georgiy Avatar
        Georgiy

        No problem, glad to help.

        And just one note (or warning?) on update – newer version of X wacom driver does not have ‘Screen_No’ option anymore. CTM-way became the only “official” way to map (and calibrate?) tablets in the multi-screen/multi-tablet configuration.

        This bug might be still there though (at least it was in wacom_drv.so v0.11 + last ubuntu natty’s Xorg update). I’ve noticed cursor will jump to the right-most side of next screen (on the right). And the only way to bring it back to the left screen is by mouse. So I had to bring back ‘Screen_No’ function to xorg wacom driver (v0.11).

        Not sure how well it will work in 0.12 (last release?) + latest Xorg. They might have purged functionality required by wacom’s Screen_No from the newest X as well…

        Anyway, if you encounter this bug in a latest version of X/wacom I can send you a patch file for sources of wacom driver (works for version 0.10 and 0.11) – if you dont mind compile linuxwacom from sources.

        1. Ed Avatar

          newer version of X wacom driver

          I also recall there’s some weird interaction with QT4 (or some such) in the 12.04 Ubuntu that killed the Wacom driver; with any luck, I’m either wrong or that’s been fixed…

          It may be time to give up on the base Ubuntu distro and try something like Mint. I’ve always resisted doing that, because I figured it’d just add another layer of bugs, but maybe that’s not the case any more. [grumble]

          I’ll write up what I do, of course, and perhaps your patches will be in the middle of it!