Re: XForms: OpenGL, MotionNotify

Steve Lamont (spl@szechuan.ucsd.edu)
Fri, 19 Sep 97 06:16:52 PDT

To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> I am writing a program with interactive 3D graphics using xforms and
> OpenGL/MESA. To control the scene via the mouse, I have added a
> canvas handler for MotionNotify (fl_add_canvas_handler()). The
> movement of even very small scenes is not smooth. I have the feeling
> that there is a problem with the X event queue such that there are
> not enough MotionNotify events send to the application program, but
> I am not an expert on X programming.

That's exactly the problem. The Canvas Window is created with the
PointerMotionHintMask bit set. As the O'Reilly _Xlib Programming
Manual_ says, this tells the server to "send only one MotionNotify
event when the pointer moves, until a key or button state changes, the
poiner leaves the window, or the client calls XQueryPointer() or
XGetMotionEvents()." This is considered a Good Thing if your
application doesn't need to constantly know where the pointer is but
it's bogus for interactive windows such as you wish.

> Has anybody suggestions how to solve this problem (or even a piece
> of code) ?

fl_add_canvas_handler( display_canvas, MotionNotify,
motion_event_handler, motion_handler_data_ptr );

fl_remove_selected_xevent( FL_ObjWin( display_canvas ),
PointerMotionHintMask );

Refer to the manual and the O'Reilly series or your own favorite Xlib
manual for details.

Is someone still maintaining the FAQ? This should probably go into it
if it's not there already.

spl

_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
Xforms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/