Fix macOS mouselook freeze on window switch + hot-path optimizations#179
Open
deliro wants to merge 2 commits into
Open
Fix macOS mouselook freeze on window switch + hot-path optimizations#179deliro wants to merge 2 commits into
deliro wants to merge 2 commits into
Conversation
289da79 to
110b91a
Compare
110b91a to
8e92ad4
Compare
Collaborator
|
Thanks for the work on this, @deliro! I had no idea about the macOS issue. I'm not currently subscribed to the game, so I can't really test the proposed changes. The next time Blizzard breaks something that requires me to update the addon, I'll merge this and include it in the next release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix — macOS stuck cursor after switching windows
A
MouselookStop()issued while the window is backgrounded (e.g. bags/LFG auto-unlock Mouse Look during an alt-tab) leaves the OS mouse capture stuck: on return the cursor/camera are frozen whileIsMouselooking()no longer reflects reality. There is no focus event to hook.CM.ResyncMouselookOnFocusRegain): when frames halt while backgrounded (fullscreen), the gap betweenOnUpdateframes signals the regain → force a clean mouselook re-grab.Combat Mode - Reset Mouse Lookkeybind): when the window keeps rendering while backgrounded (windowed background FPS), the freeze can't be detected fromOnUpdate, so a keybind re-grabs + releases capture on demand.Optimizations (throttled
OnUpdatehot path)loadstringcompile instead of recompiling every tick — the default empty string was being compiled ~7×/sec for every user.IsUnlockFrameVisible: checkGetUIPanelfirst to short-circuit the ~170-frame visibility scan in the common case;ipairsinstead ofpairs.🤖 Generated with Claude Code