Re[2]: [PATCH] Revamp mouse support in GPE
Paul Sokolovsky <[email protected]> Fri, 25 Aug 2006 13:37:54 +0300
| Newsgroups | gmane.comp.handhelds.gpe |
|---|---|
| Message-ID | <[email protected]> |
Hello Florian, Thursday, August 24, 2006, 2:09:30 AM, you wrote: > Hi, > Paul Sokolovsky wrote: >> I'm working on QEMU support for running OpenEmbedded images. >> Specifically, my aim is to be able to run the same rootfs image on >> both real device and QEMU. > very nice! >> 1. Touchscreen calibration utility (xtscal) is hardcoded to expect >> tocuhscreen device. The obvious solution is just skip it in case >> [there's only] mouse in use. Logic of this detection is a question, >> and I alreday posted about this recently. I ended up backporting >> OE.dev udev rule for /dev/input/touchscreen0 to Familiar 0.8.4 I'm >> doing experiments on and checking for its presence: > Usually detect-stylus should do the trick for you. Maybe we can simply move the > calibration after the stylus detection. After this the tslib environment > variables should be set up. In this case you would know if there is a detected > touchscreen device. Yes, the idea is of course right, but it's not that easy in details. detect-stylus doesn't itself set envvars, and can work in two modes: 1) detect-stylus --device, when it outputs TS dev name to stdout (can be ``'ed and envvar set, which is done by tslib.sh), and 2) just "detect-stylus", in which case it just checks if TS dev is present and if so, sets some X & other apps' params, like no mouse cursor; it leave detection of actual device to use to Xfdev/tslib. tslib.sh is called from /etc/profile, which means it is set only for bash sessions. Unfortunately, starting X with init does not appear to set bash session - at least not on the stage Xinit works. So, tslib.sh is not called, and TSLIB_TSDEVICE is not set. Even if it was, gpe-dm clears environment, as I wrote in the previous mail, so it's empty in Xinit, which calls That aleady sounds pretty tangled, isn't it? ;-) >> +if [ -e /dev/input/touchscreen0 ]; then > That could simply be changed to testing if TSLIB_TSDEVICE is not empty and the > file it points to exists. So, that envvar is not set in context of 30xTs_Calibrate. The heck to pull it in might be to call tslib.sh or detect-stylus directly. But how many times detect-stylus will be called over and over again, and why add to alreday tangled mix? This really should be solved at the appropriate general level (udev) (plus testing for lack of mouse actually). >> 2. It turned out that that tslib conflicts with Xfbdev's -mouse >> switch. While Xfbdev is compiled with both mouse and tslib input >> handlers, the latter appears to have presedence. If there's a device >> passed via -mouse, it is first checked by tslib, and if it's not >> touchscreen, it reports error and keeps device grabbed, not bothering >> to let other handlers try it. (note: this is the behavior which is >> exhibited with Familiar 0.8.4 version of Xfbdev (0.0cvs20050207-r11)). >> >> The solution was, while ensuring that TSLIB_TSDEVICE is not set, not >> pass -mouse argument at all. tslib handler then will fail to grab >> something, and normal Xfbdev's detection procedure will happen, and >> /dev/input/mice will be used. > That's really good to know. It might be a good idea to check a more recent > version if this issue still persists. As long as /dev/input/mice is used > automatically it sould be safe to add add this workaround to the upstream > xserver-common package. It should be easy to merge... I'm going to check situation in Angstrom/OpenZaurus/Poky, as was suggested, but eventually it's indeed would be good to solve it on GPE level, so any tree/distro benefited form it. > Greetings > Florian -- Best regards, Paul mailto:[email protected]