summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpingc <pingc>2006-09-12 22:51:24 +0000
committerpingc <pingc>2006-09-12 22:51:24 +0000
commit377432da2abc73994d8680a5b7d45a6b5bad1ae6 (patch)
treecd2f69704d1f9752394a740b5796f59d8a88d9b6
parent2dbb99e1ee8a65dfbb6da1b565e575b191d8ea75 (diff)
downloadxf86-input-wacom-release-0_7_5-1.tar.gz
Free Device instead close itrelease-0_7_5-1release-0.7.5-1
-rwxr-xr-xsrc/util/wacomcfg.c3
-rwxr-xr-xsrc/util/xidump.c20
2 files changed, 6 insertions, 17 deletions
diff --git a/src/util/wacomcfg.c b/src/util/wacomcfg.c
index 192a9b6..f229522 100755
--- a/src/util/wacomcfg.c
+++ b/src/util/wacomcfg.c
@@ -245,7 +245,8 @@ int WacomConfigCloseDevice(WACOMDEVICE *hDevice)
{
if (!hDevice) { errno=EINVAL; return -1; }
- (void)XCloseDevice(hDevice->pCfg->pDisp, hDevice->pDev);
+ if (hDevice->pDev)
+ XFree(hDevice->pDev);
free(hDevice);
return 0;
}
diff --git a/src/util/xidump.c b/src/util/xidump.c
index 7368234..d66eed2 100755
--- a/src/util/xidump.c
+++ b/src/util/xidump.c
@@ -486,15 +486,6 @@ static int CursesRun(Display* pDisp, XDeviceInfo* pDevInfo, FORMATTYPE fmt)
wacscrn_output(nValRow+4,12 + k * 10, chBuf);
}
}
- else
- {
- /* This is a workaround for device type "pad" after incorporated Anrew's patch.
- * The peoper place to fix it should be in wacom_drv.o.
- */
- fprintf(stderr,"Valuators are not ready for input device '%s' yet. ",pDevInfo->name);
- fprintf(stderr,"Please launch the program again. \n");
- return 1;
- }
nPressRow = nRow++;
nProxRow = nRow++;
@@ -507,8 +498,6 @@ static int CursesRun(Display* pDisp, XDeviceInfo* pDevInfo, FORMATTYPE fmt)
wacscrn_output(nButtonRow,0," Buttons:");
wacscrn_output(nKeyRow ,0," Keys:");
-
-
/* handle events */
while (1)
@@ -617,8 +606,7 @@ static int CursesRun(Display* pDisp, XDeviceInfo* pDevInfo, FORMATTYPE fmt)
XDeviceButtonEvent* pBtn = (XDeviceButtonEvent*)pAny;
bDown = (pAny->type == gnInputEvent[INPUTEVENT_BTN_PRESS]);
nBtn = pBtn->button;
- while (nBtn > 5) nBtn -= 5;
- if (nBtn < 1) nBtn=6;
+ if ((nBtn < 1) || (nBtn > 5)) nBtn=6;
snprintf(chBuf,sizeof(chBuf),"%d-%s",pBtn->button,
bDown ? "DOWN" : "UP ");
if (bDown) wacscrn_standout();
@@ -631,8 +619,7 @@ static int CursesRun(Display* pDisp, XDeviceInfo* pDevInfo, FORMATTYPE fmt)
XDeviceKeyEvent* pKey = (XDeviceKeyEvent*)pAny;
bDown = (pAny->type == gnInputEvent[INPUTEVENT_KEY_PRESS]);
nBtn = pKey->keycode - 7; /* first key is always 8 */
- while (nBtn > 5) nBtn -= 5;
- if (nBtn < 1) nBtn=6;
+ if ((nBtn < 1) || (nBtn > 5)) nBtn=6;
snprintf(chBuf,sizeof(chBuf),"%d-%s",pKey->keycode - 7,
bDown ? "DOWN" : "UP ");
if (bDown) wacscrn_standout();
@@ -1029,7 +1016,8 @@ int Run(Display* pDisp, UI* pUI, FORMATTYPE fmt, const char* pszDeviceName)
}
XUngrabDevice(pDisp,pDev,CurrentTime);
- XCloseDevice(pDisp,pDev);
+ XFree(pDev);
+ XCloseDisplay(pDisp);
XDestroyWindow(pDisp,wnd);
return nRtn;