Subject: xsrc/9718: small glitches in XFree86 wsmouse support + XF86Setup wsmouse support
To: None <netbsd-bugs@netbsd.org>
From: John Darrow <John.P.Darrow@wheaton.edu>
List: netbsd-bugs
Date: 04/05/2000 14:58:19
Date: Fri, 23 Apr 1999 10:08:06 +0200 (MEST)
From: Matthieu Herrb <matthieu@laas.fr>
Reply-To: matthieu@laas.fr
To: gnats-bugs@gnats.netbsd.org
Subject: small glitches in XFree86 wsmouse support + XF86Setup wsmouse support


>Number:         9718
>Category:       xsrc
>Synopsis:       small glitches in XFree86 wsmouse support + XF86Setup wsmouse support
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    xsrc-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 30 23:30:33 PST 2000
>Closed-Date:    
>Last-Modified:  
>Originator:     
>Release:        NetBSD-1.4_BETA  of 1999/04/22
>Organization:
 Matthieu Herrb   |  e-mail: matthieu@laas.fr
 CNRS/LAAS        |     url: <A HREF="http://www.laas.fr/~matthieu">
 Toulouse, France |  War, what is it good for ? Absolutely nothing !
>Environment:




>Description:
	There's no support in XF86Setup for the wsmouse mouse
	protocol. While adding support for it, I also found some
	glitches in wsmouse support code in the X servers, which made
	impossible to add it to the XFree96-Misc extension used by
	XF86Setup. 


>How-To-Repeat:
	Try to configure a wsmouse with XF86Setup
>Fix:


I originally did this support in the original XFree86 3.3.3.1
code. The patch below is the diffs between the current xsrc tree and
my modified XFree86-3.3.3.1 tree.


Unfortunatly it has conflicts with the atari mouse support in
xf86_Mouse.c. I edited the patch manually to remove those conflicts,
but it means that the patch will apply with some fuzz, as I was too
lazy to recompute line numbers.


Note: having mouse protocols names and numbers duplicated in so many
places sucks. I hope this will be fixed in the future.


						Matthieu


--- xc/include/extensions/xf86misc.h	Sun Mar  8 13:37:43 1998
+++ /net/cougar/local/X11R6/XFree86-3.3/xc/include/extensions/xf86misc.h	Tue Apr 20 22:17:06 1999
@@ -52,6 +52,8 @@
 #define MTYPE_NETSCROLLPS2	16
 #define MTYPE_SYSMOUSE		17
 #define MTYPE_AUTOMOUSE		18
+#define MTYPE_ACECAD		19
+#define MTYPE_WSMOUSE		20

 
 #define MTYPE_XQUEUE		127
 #define MTYPE_OSMOUSE		126
--- xc/programs/Xserver/Xext/xf86misc.c	Sun Mar  8 13:38:43 1998
+++ /net/cougar/local/X11R6/XFree86-3.3/xc/programs/Xserver/Xext/xf86misc.c	Tue Apr 20 23:46:12 1999
@@ -349,7 +349,8 @@
 	    && stuff->mousetype != MTYPE_GLIDEPOINTPS2
 	    && stuff->mousetype != MTYPE_NETPS2
 	    && stuff->mousetype != MTYPE_NETSCROLLPS2
-	    && stuff->mousetype != MTYPE_SYSMOUSE)
+	    && stuff->mousetype != MTYPE_SYSMOUSE
+	    && stuff->mousetype != MTYPE_WSMOUSE)
     {
         if (stuff->baudrate < 1200)
 	    return miscErrorBase + XF86MiscBadMouseBaudRate;
--- xc/programs/Xserver/hw/xfree86/XF86Setup/mouse.tcl	Sun Mar  8 13:39:38 1998
+++ /net/cougar/local/X11R6/XFree86-3.3/xc/programs/Xserver/hw/xfree86/XF86Setup/mouse.tcl	Tue Apr 20 08:35:11 1999
@@ -40,7 +40,7 @@
 	$canv itemconfigure coord -fill black
 	if {[lsearch -exact {BusMouse Xqueue OSMouse PS/2 IMPS/2
 			     ThinkingMousePS/2 MouseManPlusPS/2 GlidePointPS/2 
-			     NetMousePS/2 NetScrollPS/2 SysMouse} \
+			     NetMousePS/2 NetScrollPS/2 SysMouse wsmouse} \
 			     $mseType] == -1} {
 		foreach rate {1200 2400 4800 9600} {
 			$w.mouse.brate.$rate configure -state normal
@@ -667,6 +667,8 @@
 					/dev/.*bm|/dev/mse.* ] }
 		SysMouse { set idx [lsearch -regexp $mseDevices \
 					/dev/sysmouse.* ] }
+		wsmouse { set idx [lsearch -regexp $mseDevices \
+					/dev/wsmouse.* ] }
 		OsMouse  -
 		Xqueue	 { return "" }
 		default	 { set idx [lsearch -regexp $mseDevices \
--- xc/programs/Xserver/hw/xfree86/XF86Setup/mseproto.cpp	Thu Jan 21 13:53:18 1999
+++ /net/cougar/local/X11R6/XFree86-3.3/xc/programs/Xserver/hw/xfree86/XF86Setup/mseproto.cpp	Tue Apr 20 08:24:08 1999
@@ -52,10 +52,16 @@
 set ExtraMouseTypes [list \
 	"SysMouse" \
 ]
+
 #define MOUSE_TYPES $SerialMouseTypes $BusMouseTypes $StandardPS2Types \
 			$PnpMouseTypes $ExtraMouseTypes
 #elif defined(__NetBSD__)
-#define MOUSE_TYPES $SerialMouseTypes $BusMouseTypes $PnpMouseTypes
+set ExtraMouseTypes [list \
+	"wsmouse" \
+]
+
+#define MOUSE_TYPES $SerialMouseTypes $BusMouseTypes $ExtraMouseTypes \
+			$PnpMouseTypes 
 #elif defined(__OpenBSD__)
 #define MOUSE_TYPES $SerialMouseTypes $BusMouseTypes $StandardPS2Types \
 			$PnpMouseTypes
--- xc/programs/Xserver/hw/xfree86/XF86Setup/tclmisc.c	Sun Mar  8 13:39:41 1998
+++ /net/cougar/local/X11R6/XFree86-3.3/xc/programs/Xserver/hw/xfree86/XF86Setup/tclmisc.c	Tue Apr 20 22:17:41 1999
@@ -311,7 +311,7 @@
 			    "ThinkingMouse", "IMPS/2", "ThinkingMousePS/2",
 			    "MouseManPlusPS/2", "GlidePointPS/2", 
 			    "NetMousePS/2", "NetScrollPS/2", "SysMouse",
-			    "Auto", "Xqueue", "OSMouse" };
+			    "Auto", "AceCad", "wsmouse" };
 #define MSETABLESIZE	(sizeof(msetable)/sizeof(char *))

 
 /*
--- xc/programs/Xserver/hw/xfree86/XF86Setup/tclxfconf.c	Sun Mar  8 13:39:42 1998
+++ /net/cougar/local/X11R6/XFree86-3.3/xc/programs/Xserver/hw/xfree86/XF86Setup/tclxfconf.c	Tue Apr 20 08:40:07 1999
@@ -516,7 +516,7 @@
 		"Logitech", "BusMouse", "Mouseman", "PS/2", "MMHitTab",
 		"GlidePoint", "IntelliMouse", "ThinkingMouse", "IMPS/2",
 		"ThinkingMousePS/2", "MouseManPlusPS/2", "GlidePointPS/2",
-		"NetMousePS/2", "NetScrollPS/2", "SysMouse", "Auto", };
+		"NetMousePS/2", "NetScrollPS/2", "SysMouse", "wsmouse", "Auto", };

 

 
 int
--- xc/programs/Xserver/hw/xfree86/common/xf86_Config.h	Tue Dec 29 13:56:36 1998
+++ /net/cougar/local/X11R6/XFree86-3.3/xc/programs/Xserver/hw/xfree86/common/xf86_Config.h	Tue Apr 20 23:35:27 1999
@@ -186,10 +186,9 @@
 #define SYSMOUSE	1037
 #define AUTOMOUSE	1038
 #define ACECAD		1039
-#define XQUE      	1040
-#define OSMOUSE   	1041
-#define WSMOUSE   	1042
-#define SUNMOUSE	1043
+#define WSMOUSE   	1040
+#define XQUE      	1041
+#define OSMOUSE   	1042

 
 #ifdef INIT_CONFIG
 static SymTabRec MouseTab[] = {
@@ -213,10 +212,9 @@
   { SYSMOUSE,	"sysmouse" },
   { AUTOMOUSE,	"auto" },
   { ACECAD,	"acecad" },
+  { WSMOUSE,	"wsmouse" },
   { XQUE,	"xqueue" },
   { OSMOUSE,	"osmouse" },
-  { WSMOUSE,	"wsmouse" },
-  { SUNMOUSE,	"sun" },
   { -1,		"" },
 };
 #endif /* INIT_CONFIG */
@@ -558,10 +556,7 @@
 #define P_SYSMOUSE	17		/* SysMouse */
 #define P_AUTO		18		/* automatic */
 #define P_ACECAD	19		/* ACECAD protocol */
-#define P_XQUE		20		/* xque */
-#define P_OSMOUSE	21		/* osmouse */
-#define P_WSMOUSE	22		/* NetBSD wsmouse */
-#define P_SUN		23		/* sun */
+#define P_WSMOUSE	20		/* NetBSD wsmouse */

 
 #define EMULATE3	50
 #define BAUDRATE	51
--- xc/programs/Xserver/hw/xfree86/common/xf86_Mouse.c	Sat Feb  6 14:05:50 1999
+++ /net/cougar/local/X11R6/XFree86-3.3/xc/programs/Xserver/hw/xfree86/common/xf86_Mouse.c	Tue Apr 20 22:28:10 1999
@@ -131,8 +131,6 @@
 	FALSE,	/* auto */
 #endif
 	TRUE,	/* ACECAD */
-	FALSE,	/* xque */
-	FALSE,	/* osmouse */
 #if defined(__NetBSD__) && __NetBSD_Version__ >= 103060000
 	TRUE,	/* wsmouse */
 #else
@@ -231,8 +224,6 @@
   {  0xf8,   0x80, 0x00,   0x00, 5,    0x00,   0xff },  /* sysmouse */
   {  0xf8,   0x80, 0x00,   0x00, 5,    0x00,   0xff },  /* dummy entry for auto - used only to fill space */
   {  0x80,   0x80, 0x80,   0x00, 3,    0x00,   0xff },  /* ACECAD */
-  {  0x00,   0x00, 0x00,   0x00, 0,    0x00,   0x00 },  /* xque */
-  {  0x00,   0x00, 0x00,   0x00, 0,    0x00,   0x00 },  /* osmouse */
 #if defined(__NetBSD__) && __NetBSD_Version__ >= 103060000
   {  0x00,   0x00, 0x00,   0x00, sizeof(struct wscons_event),
      				       0x00,   0x00 },  /* wsmouse */
--- xc/programs/xdpyinfo/xdpyinfo.c	Sun Mar  8 13:47:22 1998
+++ /net/cougar/local/X11R6/XFree86-3.3/xc/programs/xdpyinfo/xdpyinfo.c	Tue Apr 20 23:19:58 1999
@@ -682,7 +682,8 @@
 		     "GlidePoint", "IntelliMouse", "ThinkingMouse",
 		     "IMPS/2", "ThinkingMousePS/2", "MouseManPlusPS/2",
 		     "GlidePointPS/2", "NetMousePS/2", "NetScrollPS/2",
-		     "SysMouse", "Auto" };
+		     "SysMouse", "Auto", "AceCad", "wsmouse" };
+
 char *flgtable[] = { "None", "ClearDTR", "ClearRTS",
 		     "ClearDTR and ClearRTS" };

 
@@ -713,10 +714,10 @@
 	printf("Xqueue\n");
       else if (mouseinfo.type == MTYPE_OSMOUSE)
 	printf("OSMouse\n");
-      else if (mouseinfo.type <= MTYPE_AUTOMOUSE)
+      else if (mouseinfo.type <= MTYPE_WSMOUSE)
 	printf("%s\n", msetable[mouseinfo.type+1]);
       else
-	printf("Unknown\n");
+	  printf("Unknown\n");
       printf("                        BaudRate: %d, SampleRate: %d, Resolution: %d\n",
 	mouseinfo.baudrate, mouseinfo.samplerate, mouseinfo.resolution);
       printf("                        Emulate3Buttons: %s, Emulate3Timeout: %d ms\n",


>Release-Note:
>Audit-Trail:
>Unformatted: