SnosMe / uiohook-napi

MIT License
162 stars 37 forks source link

Update patch to fix libuiohook hanging on Mac #37

Closed hsource closed 5 months ago

hsource commented 6 months ago

Motivation/Fix

awakened-poe-trade on Mac would hang after running a while. I debugged it and submitted a PR to libuiohook, which has more details:

https://github.com/kwhat/libuiohook/pull/184

This PR just includes that change as a patch.

Alternatively, we can also wait for libuiohook to merge in the PR and then just update the version.

Testing

# Build the branch
git clone git@github.com:hsource/uiohook-napi.git --recursive
cd uiohook-napi
git checkout harry-patch-mac
yarn install
yarn apply-libuiohook-patch
yarn prebuild

# Install in awakened-poe-trade
git clone git@github.com:SnosMe/awakened-poe-trade.git
cd awakened-poe-trade/renderer
yarn install
yarn make-index-files
yarn build
cd ../main
yarn install
yarn remove uiohook-napi && yarn add ../../uiohook-napi
yarn build
yarn package

I then used it until I got the "CGEventTap timeout" error and verified events still worked after that

maneetgoyal commented 5 months ago

@hsource Is this PR still needed given https://github.com/kwhat/libuiohook/pull/184 is merged? uiohook-napi is also released https://www.npmjs.com/package/uiohook-napi/v/1.5.3 it seems.

Can you please suggest if your new fix addresses https://github.com/SnosMe/uiohook-napi/issues/24 too?