Skip to content

Commit 6ff8271

Browse files
authored
Fixed handleClose not being called by VoodooInput (#56)
1 parent f7735a2 commit 6ff8271

File tree

7 files changed

+41
-10
lines changed

7 files changed

+41
-10
lines changed

Changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
VoodooPS2 Changelog
22
============================
33
#### v2.3.4
4-
- Fixed device count detection when `ps2rst=0` is set.
4+
- Fixed device count detection when `ps2rst=0` is set
5+
- Fixed handleClose not being called by VoodooInput
56

67
#### v2.3.3
78
- Fixed rapidly opening pages in browsers while scrolling with the trackpoint

VoodooPS2Trackpad/VoodooPS2ALPSGlidePoint.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,12 +313,21 @@ bool ApplePS2ALPSGlidePoint::handleOpen(IOService *forClient, IOOptionBits optio
313313

314314
return true;
315315
}
316-
return super::handleOpen(forClient, options, arg);
316+
return false;
317+
}
318+
319+
bool ApplePS2ALPSGlidePoint::handleIsOpen(const IOService *forClient) const {
320+
if (forClient == nullptr) {
321+
return voodooInputInstance != nullptr;
322+
} else {
323+
return voodooInputInstance == forClient;
324+
}
317325
}
318326

319327
void ApplePS2ALPSGlidePoint::handleClose(IOService *forClient, IOOptionBits options) {
320-
OSSafeReleaseNULL(voodooInputInstance);
321-
super::handleClose(forClient, options);
328+
if (forClient == voodooInputInstance) {
329+
OSSafeReleaseNULL(voodooInputInstance);
330+
}
322331
}
323332

324333
bool ApplePS2ALPSGlidePoint::start( IOService * provider ) {

VoodooPS2Trackpad/VoodooPS2ALPSGlidePoint.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ class EXPORT ApplePS2ALPSGlidePoint : public IOService {
441441
bool resetMouse();
442442
bool handleOpen(IOService *forClient, IOOptionBits options, void *arg) override;
443443
void handleClose(IOService *forClient, IOOptionBits options) override;
444+
bool handleIsOpen(const IOService *forClient) const override;
444445
PS2InterruptResult interruptOccurred(UInt8 data);
445446
void packetReady();
446447
virtual bool deviceSpecificInit();

VoodooPS2Trackpad/VoodooPS2Elan.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,21 @@ bool ApplePS2Elan::handleOpen(IOService *forClient, IOOptionBits options, void *
183183
return true;
184184
}
185185

186-
return super::handleOpen(forClient, options, arg);
186+
return false;
187+
}
188+
189+
bool ApplePS2Elan::handleIsOpen(const IOService *forClient) const {
190+
if (forClient == nullptr) {
191+
return voodooInputInstance != nullptr;
192+
} else {
193+
return voodooInputInstance == forClient;
194+
}
187195
}
188196

189197
void ApplePS2Elan::handleClose(IOService *forClient, IOOptionBits options) {
190-
OSSafeReleaseNULL(voodooInputInstance);
191-
super::handleClose(forClient, options);
198+
if (forClient == voodooInputInstance) {
199+
OSSafeReleaseNULL(voodooInputInstance);
200+
}
192201
}
193202

194203
bool ApplePS2Elan::start(IOService *provider) {

VoodooPS2Trackpad/VoodooPS2Elan.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ class EXPORT ApplePS2Elan : public IOHIPointing {
281281

282282
bool handleOpen(IOService *forClient, IOOptionBits options, void *arg) override;
283283
void handleClose(IOService *forClient, IOOptionBits options) override;
284+
bool handleIsOpen(const IOService *forClient) const override;
284285

285286
void setParamPropertiesGated(OSDictionary *dict);
286287
void injectVersionDependentProperties(OSDictionary *dict);

VoodooPS2Trackpad/VoodooPS2SynapticsTouchPad.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,12 +391,21 @@ bool ApplePS2SynapticsTouchPad::handleOpen(IOService *forClient, IOOptionBits op
391391
return true;
392392
}
393393

394-
return super::handleOpen(forClient, options, arg);
394+
return false;
395+
}
396+
397+
bool ApplePS2SynapticsTouchPad::handleIsOpen(const IOService *forClient) const {
398+
if (forClient == nullptr) {
399+
return voodooInputInstance != nullptr;
400+
} else {
401+
return voodooInputInstance == forClient;
402+
}
395403
}
396404

397405
void ApplePS2SynapticsTouchPad::handleClose(IOService *forClient, IOOptionBits options) {
398-
OSSafeReleaseNULL(voodooInputInstance);
399-
super::handleClose(forClient, options);
406+
if (forClient == voodooInputInstance) {
407+
OSSafeReleaseNULL(voodooInputInstance);
408+
}
400409
}
401410

402411
bool ApplePS2SynapticsTouchPad::start( IOService * provider )

VoodooPS2Trackpad/VoodooPS2SynapticsTouchPad.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ class EXPORT ApplePS2SynapticsTouchPad : public IOService
361361

362362
bool handleOpen(IOService *forClient, IOOptionBits options, void *arg) override;
363363
void handleClose(IOService *forClient, IOOptionBits options) override;
364+
bool handleIsOpen(const IOService *forClient) const override;
364365

365366
void setPropertiesGated(OSDictionary* dict);
366367
void injectVersionDependentProperties(OSDictionary* dict);

0 commit comments

Comments
 (0)