open-src/driver/xf86-input-mouse/6892799.patch
changeset 817 1222f638a16b
child 919 425233ae7236
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/driver/xf86-input-mouse/6892799.patch	Sun Oct 25 21:19:31 2009 -0700
@@ -0,0 +1,73 @@
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, and/or sell copies of the Software, and to permit persons
+# to whom the Software is furnished to do so, provided that the above
+# copyright notice(s) and this permission notice appear in all copies of
+# the Software and that both the above copyright notice(s) and this
+# permission notice appear in supporting documentation.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+# 
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in this Software without prior written authorization
+# of the copyright holder.
+
+diff -urp -x '*~' -x '*.orig' src/mouse.c src/mouse.c
+--- src/mouse.c	2009-10-21 15:54:31.146864000 +0800
++++ src/mouse.c	2009-10-21 15:54:31.343475000 +0800
+@@ -1744,13 +1744,14 @@ MouseProc(DeviceIntPtr device, int what)
+ 	ErrorF("assigning %p atom=%d name=%s\n", device, pInfo->atom,
+ 		pInfo->name);
+ #endif
+-	break;
+-
+-    case DEVICE_ON:
+ 	pInfo->fd = xf86OpenSerial(pInfo->options);
+ 	if (pInfo->fd == -1)
+ 	    xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
+-	else {
++
++	break;
++
++    case DEVICE_ON:
++	if (pInfo->fd != -1) {
+ 	    if (pMse->xisbscale)
+ 		pMse->buffer = XisbNew(pInfo->fd, pMse->xisbscale * 4);
+ 	    else
+@@ -1800,6 +1801,22 @@ MouseProc(DeviceIntPtr device, int what)
+ 	break;
+ 	    
+     case DEVICE_OFF:
++	if (pInfo->fd != -1) {
++	    xf86RemoveEnabledDevice(pInfo);
++	    if (pMse->buffer) {
++		XisbFree(pMse->buffer);
++		pMse->buffer = NULL;
++	    }
++	    if (pMse->emulate3Buttons || pMse->emulate3ButtonsSoft)
++	    {
++		RemoveBlockAndWakeupHandlers (MouseBlockHandler,
++					      MouseWakeupHandler,
++					      (pointer) pInfo);
++	    }
++	}
++	device->public.on = FALSE;
++	break;
++
+     case DEVICE_CLOSE:
+ 	if (pInfo->fd != -1) {
+ 	    xf86RemoveEnabledDevice(pInfo);