From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <2d79eb0bf0b59e7429723fc65bd18f0b@plan9.ucalgary.ca> To: 9fans@cse.psu.edu Date: Sat, 20 Nov 2004 08:22:09 -0700 From: andrey mirtchovski MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] vncs and warped pointers Topicbox-Message-UUID: 07986966-eace-11e9-9e20-41e7f4b1d025 If you've tried vnc-ing to a Plan 9 machine from UNIX you'll know that it doesn't really work 100% because the mouse pointer isn't warping properly, which brings down the mood of acme editing sessions. there are provisions made (EncMouseWarp) for supporting this but i'm not sure where exactly are they supposed to work. not in tightvnc. If you prefer vnc to drawterm however and if you'd like to have mouse warping in acme, here are instructions on how to modify both vncs and TightVNC to get proper warping behaviour using the protocol extensions used by TightVNC (Plan 9 must conform to lUNIX, as usual): On the Plan 9 side: plan9% diff vncs.c /sys/src/cmd/vnc/vncs.c 684d683 < v->canwarp = 1; 1019c1018 < vncwrlong(v, 0xFFFFFF18); /* extension to the protocol used by tightvnc, at least */ --- > vncwrlong(v, EncMouseWarp); plan9% On the TightVNC side, download tightvnc from www.tightvnc.com, uncompress do the 'xmkmf; make World' dance and edit vncviewer/cursor.c's HandleCursorPos() thusly: mirtchov@localrob$ diff cursor.c cursor.c.old 322c322,324 < XWarpPointer(dpy, None, desktopWin, 0, 0, 0, 0, x, y); --- > if (appData.useX11Cursor) { > if (appData.fullScreen) > XWarpPointer(dpy, None, desktopWin, 0, 0, 0, 0, x, y); 324c326,335 < return True; --- > return True; > } > > if (x >= si.framebufferWidth) > x = si.framebufferWidth - 1; > if (y >= si.framebufferHeight) > y = si.framebufferHeight - 1; > > SoftCursorMove(x, y); > return True; Essentially hardcoding TightVNC to warp always. Hope you find it useful. There are a few things that are still annoying -- if acme wants to warp the cursor while you're moving it the warp will be lost. That's just how vncviewer was written. andrey, who woke up way too early this morning... ps: crashes under plan9port's rio when attempting to hide the window... works with twm though! :) pps: this mail written using vncs/vncviewer + warping