Skip to content

Commit

Permalink
Fix init arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
1Revenger1 committed Feb 14, 2023
1 parent 9d483ef commit dcb8134
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions VoodooInput/VoodooInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ bool VoodooInput::start(IOService *provider) {
return false;
}

OSDictionary *simInitArg = nullptr;
trackpoint = OSTypeAlloc(TrackpointDevice);
if (isSierraOrNewer()) {
simulator = OSTypeAlloc(VoodooInputSimulatorDevice);
simInitArg = OSDynamicCast(OSDictionary, getProperty("MT1Props"));
} else {
simulator = OSTypeAlloc(VoodooInputWellspringSimulator);
}
Expand All @@ -43,9 +45,9 @@ bool VoodooInput::start(IOService *provider) {
OSSafeReleaseNULL(trackpoint);
return false;
}

// Initialize simulator device
if (!simulator->init(OSDynamicCast(OSDictionary, getProperty("MT1Props"))) || !simulator->attach(this)) {
if (!simulator->init(simInitArg) || !simulator->attach(this)) {
IOLog("VoodooInput could not attach simulator!\n");
goto exit;
}
Expand All @@ -66,7 +68,7 @@ bool VoodooInput::start(IOService *provider) {
goto exit;
}

// Actuator is only needed for pressure, which is only useful for newer macOS versions with force touch
// Actuator is only needed for Magic Trackpad 2 emulation
if (isSierraOrNewer()) {
actuator = OSTypeAlloc(VoodooInputActuatorDevice);

Expand Down

0 comments on commit dcb8134

Please sign in to comment.