Repository navigation
Fix gestures losing global input after retrying the hook - #126
Merged
Merged
Conversation
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.
What does this change?
Retrying gestures can leave Filee reporting a running global input hook while Ctrl+drag no longer opens the radial toolbar and Explorer performs its normal copy operation. Wait for the previous hook's native cleanup to finish before starting its replacement.
RetryHookcallsDispose()followed immediately byStart(). SharpHook requests shutdown asynchronously, and itsRunAsync()task completes before thefinallyblock clears the process-wide dispatch callback (SharpHook 8.0.1 source). The old thread can therefore clear the new hook's callback.This change runs the hook on an owned background thread and joins it after disposal, with a five-second limit. If stopping fails or times out, ownership is retained so a second hook cannot overlap. The existing Linux backend diagnostics are preserved. A failed stop also suppresses SharpHook's finalizer when it has already marked the hook disposed, avoiding a second disposal of its completed event queue.
How was it tested?
dotnet format Filee.slnx --verify-no-changes --no-restoredotnet test tests/Filee.App.Tests/Filee.App.Tests.csproj -c Release --filter FullyQualifiedName~TriggerServiceLifecycleTests— 3 passed.dotnet test tests/Filee.App.Tests/Filee.App.Tests.csproj -c Release --no-build --filter "FullyQualifiedName~GestureDetectorTests|FullyQualifiedName~TriggerServiceLifecycleTests|FullyQualifiedName~HookFailureTests"— 13 passed, 0 failed, 0 skipped. This includes the existing gesture state machine and Linux hook-error diagnostics.DonutGroupTestscases executingLocalizationService.SetLanguage, rather than waiting in the hook lifecycle code. There is no completed full-suite result for this PR. Two Explorer-menu packaging tests skipped because the native DLL/MSIX build artifacts were absent locally.EventLoopGlobalHook: delayed native cleanup, 30 successive restarts that each deliver input, and a failed stop that must not start another hook. No OS input is hooked by these tests.main: 10 consecutive clicks of Retry gestures retained input; two real Ctrl+drag attempts opened the radial toolbar, confirmed by the user and gesture logs. A radial-toolbar PNG-to-PDF conversion also completed.Native Linux/macOS gestures and the other test projects were not run locally. The installed-build manual checks above are separate from the automated checks against this PR's current-main build.
Screenshots (UI changes)
No layout or visual changes.
Checklist