Some problem about writing a x driver

antilife bamboo9527 at gmail.com
Sat Dec 29 04:15:42 PST 2007


x driver:
......
......
xf86PostMotionEvent(device, 1, 0, 3, x, y, p);//for example: x=50,y=100

user program:
use xlib to fetch motion event:

XEvent event;
XNextEvent(disp, &event);
...
XDeviceMotionEvent *me = (XDeviceMotionEvent*)&event;
x = me->axis_data[0];//x=50
y = me->axis_data[1];//y=100

I get the correct values.

But use gtk, i get the wrong values:
 
static gint 
motion_notify_event(GtkWidget *widget, GdkEventMotion *event)
{
...
x = event->x;// x less than the xf86PostMotionEvent'x
y = event->y;// y less than the xf86PostMotionEvent'y
...
return TRUE;
}
Anybody who can tell me the truth? many thanks...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg/attachments/20071229/389fcc52/attachment.html>


More information about the xorg mailing list