Fixes issue 2697 clickthrublocker #2729
Merged
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.
This edit makes kOS use the ClickThroughBlocker mod to handle its keyboard focus. ClickThroughBlocker is a nice mod, but it does require all mods to get on board and use it or else it starts acting very hostile toward the ones that don't, stealing their focus away. (Ironically it was causing clickthrough bugs when one of ClickThroughBlocker's windows was stacked underneath kOS's terminal window and stealing its focus.)
The only way to fix the fact that CTB windows were stealing focus from the kOS terminal even when they were stacked underneath it was to make the kOS terminal become a CTB window too so CTB knows it exists and can track its
rect
and stacking order relative to the other CTB windows.To make this work, I spoke at length with @linuxgurugamer (maintainer of ClickThroughBlocker) on our Twitch channels and spoke of how moving kOS to using ClickThroughBlocker would change its behavior to focus-follows-mouse, which wasn't necessarily desired. At the time focus-follows-mouse was the only option ClickThroughBlocker had. He has since added the option to use click-to-focus depending on player preference. It is for THAT reason that this mod requires ClickThroughBloocker to be at least version 0.10. Old versions of ClickThroughBlocker will be missing the
focusFollowsClick
boolean field that our code in kOS explicitly reads to change its own behavior. With that field missing, there would be errors.A NOTE ABOUT THIS PR and the kOS.netkan file:
This PR "wants" to edit the kOS.netkan file to reflect the new mod dependency on ClickThroughBlocker, but it can't. That had to be put in a separate PR ( To be called #2730 ). For reasons, see the edits to documentation files in PR #2730. )