[Linuxwacom-devel] Tool ID not updating

2012-02-20 Thread Bastien Nocera
Heya,

I'm having a bit of trouble with this code:
http://git.gnome.org/browse/gnome-settings-daemon/tree/plugins/common/gsd-input-helper.c#n292

It's supposed to send the last used tool ID, except that it doesn't seem
to update when I bring my pen closer, only when I remove it. Which
offset of Wacom Serial IDs is supposed to contain the _current_ tool
ID? All my attempts so far have resulted in even more bizarre
occurrences.

I'm confused. This is stopping me from implementing automatic page
switching in the GNOME panel based on the last used stylus.

Cheers


--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] Tool ID not updating

2012-02-20 Thread Chris Bagwell
On Mon, Feb 20, 2012 at 11:39 AM, Bastien Nocera had...@hadess.net wrote:
 Heya,

 I'm having a bit of trouble with this code:
 http://git.gnome.org/browse/gnome-settings-daemon/tree/plugins/common/gsd-input-helper.c#n292

 It's supposed to send the last used tool ID, except that it doesn't seem
 to update when I bring my pen closer, only when I remove it. Which
 offset of Wacom Serial IDs is supposed to contain the _current_ tool
 ID? All my attempts so far have resulted in even more bizarre
 occurrences.

 I'm confused. This is stopping me from implementing automatic page
 switching in the GNOME panel based on the last used stylus.


It looks to me that there is logic to update the current serial #
(data[3]) in related property but nothing to update the old serial #
(data[1]).

On the other hand, if you polled the property, it does get the real
time value for data[3].  So that probably explains strange combination
of behavior your see.

I think a big improvement in behavior will occur if you modify
wcmXCommand.c::serialTimerFunc() to update both old_serial and
cur_serial.

In addition, a nice cleanup would be to update
wcmXCommand.c::wcmUpdateSerial() to set old_serial = cur_serial when
it see's current serial # changing to 0.  And then to delete that same
line in wcmSendEvents() where its calling wcmUpdateSerial(0).

I do not have a device that reports serial #'s so I have a hard time
helping out with patches in this area.

Chris

--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel