On Wed, Aug 10, 2011 at 05:07:56PM -0700, Jason Gerecke wrote:
> On Wed, Aug 10, 2011 at 3:44 PM, Peter Hutterer
> <peter.hutte...@who-t.net> wrote:
> > On Tue, Aug 09, 2011 at 06:05:00PM -0700, Jason Gerecke wrote:
> >> I've been recently trying to resurrect the DisplayToggle button
> >> command without much success. Most of the data I need access to (e.g.
> >> the contents of the coordinate transformation matrix) are only
> >> accessible with a Display object. I quickly learned that calling
> >> XOpenDisplay from within the driver is a recipe for disaster, and
> >> haven't had any luck finding functions that work without a Display. I
> >> also took at the old TwinView code for inspiration, but couldn't track
> >> down how the driver wound up with the necessary info...
> >
> > write a client (or integrate into an existing one) that catches the assigned
> > button and reassigns the matrix.  This way you also end up being
> > configurable (toggle left-to-right?  toggle right-to-left? etc)
> >
> 
> I was afraid of being told that. I suppose DisplayToggle makes sense
> as a client application since it wouldn't be doing anything
> particularly specific to our driver. I imagine you could probably even
> hack together a stateless bash script that analyzes the output of the
> xinput and xrandr commands to do it in a pinch... On the downside, not
> having DisplayToggle in the driver does make implementing a
> 'MatchAspectRatio' option uglier... I was really looking forward to
> not needing to touch the 'Area' property :)

this came up on the list months ago (before you started I think) and the
last word was I think that we could just have a property that defines the
aspect ratio in x:y. Haven't thought about it much more than that, but the
area property and the aspect ratio are imo two different things that
probably shouldn't be munged together.

> > That aside, note that any property is accessible from within the driver
> > through XIChangeDeviceProperty. You just need the atom name (MakeAtom()) and
> > the rest is pretty much like the property init code in wcmXCommand.c
> > of course, you don't have access to the screen dimensions in the driver, so
> > you'd have to guess the matrix values.
> >
> 
> Good to know. I figured with the name 'MakeAtom' that it would be
> creating new atoms on the server, not also giving me references to
> existing ones. I'll have to keep that in mind.

fwiw, I really recommend keeping a server source tree around, even if you
don't necessary build or run against it. Set up a global ctags file (or
whatever integrates with your IDE) and then it's quite trivial to find out
what various server functions do. The whole of MakeAtom is ~75 LOC, quite
trivial to understand too. Last parameter to MakeAtom is "Bool makeit", if
false you either get None (atom not defined) or the Atom that you can then
pass into XIChangeDeviceProperty.
 
Cheers,
  Peter

------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. 
http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to