9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: andrey mirtchovski <mirtchov@cpsc.ucalgary.ca>
To: 9fans@cse.psu.edu
Subject: [9fans] vncs and warped pointers
Date: Sat, 20 Nov 2004 08:22:09 -0700	[thread overview]
Message-ID: <2d79eb0bf0b59e7429723fc65bd18f0b@plan9.ucalgary.ca> (raw)

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



             reply	other threads:[~2004-11-20 15:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-20 15:22 andrey mirtchovski [this message]
2004-11-20 16:08 ` David Leimbach
2004-11-20 16:17   ` andrey mirtchovski
2004-11-21  6:14     ` [9fans] Booting a new kernel Paul Lalonde
2004-11-21 23:15       ` pat
2004-11-22  6:27       ` [9fans] " Paul Lalonde
2004-11-22  6:51         ` geoff
2004-11-22 18:30           ` [9fans] Video and mouse problems Paul Lalonde
2004-11-22 20:28             ` Paul Lalonde
2004-11-22 20:41               ` andrey mirtchovski
2004-11-22 20:53                 ` Charles Forsyth
2004-11-22 21:31                 ` Paul Lalonde
2004-11-22 21:34                   ` Russ Cox
2004-11-22 21:39                     ` Paul Lalonde
2004-11-21 17:51     ` [9fans] vncs and warped pointers David Leimbach
2004-11-21 21:44       ` David Leimbach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2d79eb0bf0b59e7429723fc65bd18f0b@plan9.ucalgary.ca \
    --to=mirtchov@cpsc.ucalgary.ca \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).