diff options
author | Aaron Campbell <aaron@cvs.openbsd.org> | 2000-11-12 19:15:20 +0000 |
---|---|---|
committer | Aaron Campbell <aaron@cvs.openbsd.org> | 2000-11-12 19:15:20 +0000 |
commit | 4bd022ed91b4335e2a93ecc0f362502599edb9ea (patch) | |
tree | faf4af1b1917ca12631493b57f61555c48e018a0 /usr.sbin | |
parent | 093b73ef056ee302c5fedeb446fb83fb8c9a51ca (diff) |
Fix XFree86/console mouse transparency for serial mice. Tested with both a
serial and PS/2 mouse, seems to do the trick; Jean-Baptiste.Marchand@epita.fr
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/moused/moused.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/usr.sbin/moused/moused.c b/usr.sbin/moused/moused.c index 4ed83634090..d23a5af153c 100644 --- a/usr.sbin/moused/moused.c +++ b/usr.sbin/moused/moused.c @@ -80,6 +80,7 @@ int background = FALSE; int identify = ID_NONE; char *pidfile = "/var/run/moused.pid"; static sigjmp_buf env; +static jmp_buf restart_env; /* * Most of the structures are from the Xfree Project @@ -416,10 +417,19 @@ freedev(int sig) errno = save_errno; } +static void mouse_init(void); + static void opendev(int sig) { - siglongjmp(env, 1); + /* re-open the mouse device */ + if ((mouse.mfd = open(mouse.portname, O_RDWR | O_NONBLOCK, 0)) == -1) { + logerr(1, "unable to open %s", mouse.portname); + exit(1); + } + /* re-init the mouse */ + mouse_init(); + longjmp(restart_env, 1); } static void @@ -1754,7 +1764,10 @@ moused(void) } } } - + + /* restart point when coming from X */ + setjmp(restart_env); + /* display initial cursor */ mouse_infos.operation = MOUSE_INIT; |