-
-
Notifications
You must be signed in to change notification settings - Fork 308
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
Feature: Only one instance of albert #158
Closed
Closed
Conversation
This file contains 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
Added method const QString &originalSearchTerm() const; to the Query and QueryPrivate class. This is intended for plugins that have case sensitive functionality. E.g. a shell launcher.
Now writing the pid into the running-indicator-file. If the file already exists check if the pid is still running. If so, terminate. If not, proceed with "not graciously terminated" message. If the file does not exist, create it and proceed.
If the pid in the running-indicator-file is valid. Send SIGUSR1 to this pid. When receiving SIGUSR1 bring the widget to front.
It is unnecessary to send two signals to the other albert instance. One is enough to get the functionality. Bug fix: If albert was not terminated cleanly the file has still the invalid PID. If albert starts and detects an invalid PID it will proceed but not update the PID. So if a second instance is started the invalid PID will be detected agail and still not updated and so multiple alberts will be running. To fix this, invalid PIDs will simply be updated.
Conflicts: src/application/albertapp.cpp
Hi, thanks! |
Hi, if you're coming to this via the issue 123, I'm sorry but this was a mistake at my side. This issue is completely unrelated to 123. |
Hi there, Thanks for the clarification, got it! looking forward for the fix of issue 123. |
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.
Solving issue #23 and #123:
Write the PID into the running-indicator file.
If the file already exists check if the PID is still valid.
If so, send SIGUSR1 to cause the running instance to bring its widget to front and terminate the new instance.
If the PID is invalid, start normally and print the error message.
Also there is a little update for the Query object.
If you want to launch shell applications from albert you have case-sensitive input. So I implemented Query::originalSearchTerm() which returns the original user input untrimmed.