On 01/04/2011 03:30 PM, Denis Auroux wrote:
> Correct. It's a GTK+ bug (GTK+ doesn't update its information when the
> screen gets rotated) that's really hard to overcome.
>
> Xournal should do very slightly better at it than GIMP and other
> programs, because it bypasses GTK+'s event coordinate conversion and
> does its own, assuming the aspect ratio of the digitizer matches that of
> the screen and the upper-left corner never moves (which of course are
> not quite correct, hence the frequent loss of calibration upon rotation).

To be more precise: this is what #define ENABLE_XINPUT_BUGFIX is about.
(It used to be much more broken in older GTK+ versions, which made it 
even more desirable). In main.c it sets the device axes to IGNORE mode 
instead of being the X and Y axes, so that GTK+ does NOT attempt to 
convert to x/y coordinates (which it is extremely confused about after 
rotation), and instead converts to a range from 0 to 1. Subsequently, 
the code in fix_xinput_coords() in xo-misc.c (called from the button 
event handlers of xo-callbacks.c) converts these 0-1 ranges back into 
canvas-relative coordinates, in a way that's slightly more robust than 
GTK+'s.

The main problem is that, since GTK+ never notices that everything gets 
recalibrated by display rotation, and never tells xournal either, I 
think the only way to really know what's going on might be to talk 
directly to the X server, bypassing GTK+ completely for XInput event 
handling. (Or maybe there is an event like ConfigureNotify that one can 
try to listen for that might get triggered when the display gets 
rotated? I am not sure).

Anyway: this hack helps everyone for whom the tablet display starts at 
(0,0) both in screen coordinates and in wacom device coordinates, which 
is why some people will say "xournal works just fine with rotation".
If those assumptions are not satisfied then most likely strokes will be 
off by some amount.

Denis

-- 
Denis Auroux
MIT Department of Mathematics           aur...@math.mit.edu
    (on leave) and
University of California, Berkeley      aur...@math.berkeley.edu
Department of Mathematics               Tel: 510-642-4367
817 Evans Hall # 3840                   Fax: 510-642-8204
Berkeley, CA 94720-3840

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Xournal-devel mailing list
Xournal-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xournal-devel

Reply via email to