From nobody@FreeBSD.org  Wed Nov 14 00:03:09 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 80B6137B405
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 14 Nov 2001 00:03:09 -0800 (PST)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.4/8.11.4) id fAE839a50482;
	Wed, 14 Nov 2001 00:03:09 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200111140803.fAE839a50482@freefall.freebsd.org>
Date: Wed, 14 Nov 2001 00:03:09 -0800 (PST)
From: Andrew Milton <akm@theinternet.com.au>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Turbo Vision doesn't handle mouse events correctly at 80x50
X-Send-Pr-Version: www-1.0

>Number:         31973
>Category:       ports
>Synopsis:       Turbo Vision doesn't handle mouse events correctly at 80x50
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 14 00:10:01 PST 2001
>Closed-Date:    Sat Nov 24 10:09:41 PST 2001
>Last-Modified:  Sat Nov 24 10:09:49 PST 2001
>Originator:     Andrew Milton
>Release:        5.0-current
>Organization:
N/A
>Environment:
FreeBSD marty.theinternet.com.au 5.0-CURRENT FreeBSD 5.0-CURRENT #1: Fri Oct  5 21:35:30 EST 2001     akm@marty.theinternet.com.au:/export/src/sys/i386/compile/marty  i386

>Description:
When putting the console into 80x50 the demo that comes with tvision,
detects mouse events on the wrong line (approx 1/2 the actual line
number).

As a result using menus or buttons in anything but 80x25 is impossible.    
>How-To-Repeat:
run the tvision demo at higher console resolutions.
>Fix:
      
>Release-Note:
>Audit-Trail:

From: Andrew Milton <akm@theinternet.com.au>
To: freebsd-gnats-submit@FreeBSD.org, akm@theinternet.com.au
Cc:  
Subject: Re: ports/31973: Turbo Vision doesn't handle mouse events correctly at 80x50
Date: Thu, 15 Nov 2001 02:54:42 +1000

 fbsdmHandle() in system.cc assumes the height divider 16 (hard coded 
 constant).
 I think if the screenHeight is > 25 it should be 8.
 
 I'm not sure what the dividers should be for 132x60.
 

From: Andrew Milton <akm@theinternet.com.au>
To: freebsd-gnats-submit@FreeBSD.org, akm@theinternet.com.au
Cc:  
Subject: Re: ports/31973: Turbo Vision doesn't handle mouse events correctly at 80x50
Date: Thu, 15 Nov 2001 03:03:57 +1000

 This seems to work for me.
 
 --- work/tvision-0.7/lib/system.cc.orig Mon Sep 28 22:16:39 1998
 +++ work/tvision-0.7/lib/system.cc      Thu Nov 15 03:00:19 2001
 @@ -857,13 +857,20 @@
  {
         TEvent event;
         mouse_info_t mi;
 +       int heightDivider=16;
  
         mi.operation = MOUSE_GETINFO;
         ioctl(STDOUT_FILENO, CONS_MOUSECTL, &mi);
 +
 +       if(TScreen::screenHeight > 25)
 +       {
 +               heightDivider=8;
 +       }
 +
         event.mouse.controlKeyState = kbReadShiftState();
         event.mouse.where.x = range(mi.u.data.x / 8, 0,
                 TScreen::screenWidth - 1);
 -       event.mouse.where.y = range(mi.u.data.y / 16, 0,
 +       event.mouse.where.y = range(mi.u.data.y / heightDivider, 0,
                 TScreen::screenHeight - 1);
  
         /* convert button bits to TV standard */
 
 
State-Changed-From-To: open->closed 
State-Changed-By: ijliao 
State-Changed-When: Sat Nov 24 10:09:41 PST 2001 
State-Changed-Why:  
committed, thanks 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=31973 
>Unformatted:
