Path: utzoo!attcan!utgpu!watmath!att!dptg!rutgers!cs.utexas.edu!csd4.csd.uwm.edu!mailrus!ncar!ico!auto-trol!marbru From: marbru@auto-trol.UUCP (Martin Brunecky) Newsgroups: comp.windows.x Subject: Re: rubberbanding with Xlib Message-ID: <260@auto-trol.UUCP> Date: 30 Aug 89 22:33:21 GMT References: <123886@sun.Eng.Sun.COM> <2449@srava.sra.JUNET> Reply-To: marbru@auto-trol.UUCP (Martin Brunecky) Organization: Auto-trol Technology, Denver Lines: 29 > Implement rubberbanding .... I'v seen some advices so far. What I do is as follows (and it DID generate good results on VS2000 running FT of DECWINDOWS long time ago. However, you will NEVER track the pointer EXACTLY, there is always a delay due to the roundtrip. We solve this by using NONE cursor (which is unfortunatelly missing in the standard cursors, you have to create one by hand using XCreatePixmapCursor... with a "blank" pixmap 1x1 pixel). 1) we set pointer motions hint in the window event mask so that we don't get swamped with hundreds of motion events. Or in Xt, specify compress_motion in core part to TRUE. 2) when we get a motion event, we call XQueryPointer. It costs a round-trip, but we get the true LAST pointer position. 3) we compare position to the previous one = no move, skip it 4) we try to do the undraw-draw in one protocol request (using Xor) if possible - i.e. using XDrawSegments. Till about 50 (?) segments you get good results. Above that, blt from pixmap may be better. ############################################################################### Martin Brunecky, Auto-trol Technology Corporation, 12500 North Washington Street, Denver, CO-80241-2404 (303) 252-2499 ncar!ico!auto-trol!marbru ###############################################################################