open-src/driver/xf86-input-mouse/6892799.patch
changeset 1265 0b5cc5c013e4
parent 1156 973b7daad782
child 1351 9ad483eabd22
equal deleted inserted replaced
1264:a3323e4f263f 1265:0b5cc5c013e4
     1 # Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
     1 # Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
     2 #
     2 #
     3 # Permission is hereby granted, free of charge, to any person obtaining a
     3 # Permission is hereby granted, free of charge, to any person obtaining a
     4 # copy of this software and associated documentation files (the "Software"),
     4 # copy of this software and associated documentation files (the "Software"),
     5 # to deal in the Software without restriction, including without limitation
     5 # to deal in the Software without restriction, including without limitation
     6 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
     6 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
    18 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    18 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    19 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    19 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    20 # DEALINGS IN THE SOFTWARE.
    20 # DEALINGS IN THE SOFTWARE.
    21 
    21 
    22 diff --git a/src/mouse.c b/src/mouse.c
    22 diff --git a/src/mouse.c b/src/mouse.c
    23 index d981f6f..298f042 100644
    23 index f4c7c82..0e577b3 100644
    24 --- a/src/mouse.c
    24 --- a/src/mouse.c
    25 +++ b/src/mouse.c
    25 +++ b/src/mouse.c
    26 @@ -1614,13 +1614,14 @@ MouseProc(DeviceIntPtr device, int what)
    26 @@ -1616,13 +1616,14 @@ MouseProc(DeviceIntPtr device, int what)
    27  	ErrorF("assigning %p atom=%d name=%s\n", device, pInfo->atom,
    27  	ErrorF("assigning %p atom=%d name=%s\n", device, pInfo->atom,
    28  		pInfo->name);
    28  		pInfo->name);
    29  #endif
    29  #endif
    30 -	break;
    30 -	break;
    31 -
    31 -
    40 +    case DEVICE_ON:
    40 +    case DEVICE_ON:
    41 +	if (pInfo->fd != -1) {
    41 +	if (pInfo->fd != -1) {
    42  	    if (pMse->xisbscale)
    42  	    if (pMse->xisbscale)
    43  		pMse->buffer = XisbNew(pInfo->fd, pMse->xisbscale * 4);
    43  		pMse->buffer = XisbNew(pInfo->fd, pMse->xisbscale * 4);
    44  	    else
    44  	    else
    45 @@ -1676,8 +1677,6 @@ MouseProc(DeviceIntPtr device, int what)
    45 @@ -1678,8 +1679,6 @@ MouseProc(DeviceIntPtr device, int what)
    46  		XisbFree(pMse->buffer);
    46  		XisbFree(pMse->buffer);
    47  		pMse->buffer = NULL;
    47  		pMse->buffer = NULL;
    48  	    }
    48  	    }
    49 -	    xf86CloseSerial(pInfo->fd);
    49 -	    xf86CloseSerial(pInfo->fd);
    50 -	    pInfo->fd = -1;
    50 -	    pInfo->fd = -1;
    51  	    if (pMse->emulate3Buttons || pMse->emulate3ButtonsSoft)
    51  	    if (pMse->emulate3Buttons || pMse->emulate3ButtonsSoft)
    52  	    {
    52  	    {
    53  		RemoveBlockAndWakeupHandlers (MouseBlockHandler,
    53  		RemoveBlockAndWakeupHandlers (MouseBlockHandler,
    54 @@ -1688,6 +1687,10 @@ MouseProc(DeviceIntPtr device, int what)
    54 @@ -1690,6 +1689,10 @@ MouseProc(DeviceIntPtr device, int what)
    55  	device->public.on = FALSE;
    55  	device->public.on = FALSE;
    56  	break;
    56  	break;
    57      case DEVICE_CLOSE:
    57      case DEVICE_CLOSE:
    58 + 	if (pInfo->fd != -1) {
    58 + 	if (pInfo->fd != -1) {
    59 +	    xf86CloseSerial(pInfo->fd);
    59 +	    xf86CloseSerial(pInfo->fd);