Repository navigation
Add a named-event single-instance guard - #88
Merged
Merged
Conversation
Launching the app while it was running (from Start, the installer, or the Run key) started a second copy whose hotkey registration failed with a misleading 'another app may be using it' notification. A named event now lets only the first copy build its window; a later launch asks the running copy to open Settings and exits.
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.
Problem
Launching Radial Actions while it was already running started a second copy. That happened from the Start menu, from the installer after an install or update while a copy was still running, and from the Run key. The second copy's hotkey registration failed, so it showed "Couldn't register Ctrl+Alt+Space. Another app may be using it." on every extra launch, which blames another app for Radial Actions itself. The two copies could also overwrite each other's settings.
Changes
Services/SingleInstance.csuses a named auto-reset event,Local\RadialActions.Local\RadialActions.Debug, so they can run next to an installed copy.App.xamldropsStartupUri, andApp.OnStartupbuilds and showsMainWindowonly for the first copy.AllowSetForegroundWindow), signals it, and callsShutdown()before any window, tray icon, or settings access exists.MainWindow.OpenSettingsForRelaunch).Validation
dotnet buildin Debug and Release: 0 warnings.dotnet test: 598 passed. NewSingleInstanceTestscover four cases:Application.cs:StartupUri,DoStartupdoes nothing;Shutdown()insideOnStartupexits with code 0;Application.MainWindow, whichGeneralSettingsViewrelies on.Risks