Skip to content

Fixes issue 2697 clickthrublocker #2729

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 8, 2020

Conversation

Dunbaratu
Copy link
Member

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. )

Dunbaratu added 7 commits May 9, 2020 17:43
instead so it can tolerate having no ClickThruBlocker installed.
After a long back and forth on the KSP forum with a CKAN
expert, it seems I cannot put the kOS.netkan edit into
the master branch until *after* I've cut a release from it
or else CKAN's crawlerbot will incorrrectly associate that
netkan change with the old previous release of kOS.  (Thus
making the old kOS say it's dependant on ClickThrougBlocker
even though it's not.)

That means I have to move the kOS.netkan edit into a separate PR
that MUST come later after release (which feels very wrong).
In case someone installs kOS without using CKAN, they
won't know about the ClickThroughBlocker requirement.
This addes a popup on Start() that will tell them
what's going on with ClickThroughBlocker and warn them
that kOS won't work without it.
@Dunbaratu
Copy link
Member Author

Dunbaratu commented Dec 30, 2020

REVERTED REVERTED REVERTED

NOTE that although this PR is merged, I have had to revert the changes in this merge because I need to put kOS's window handling back to what it was before ClickThroughBlocker until it adds an API that's pending.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant