Use isFocused() instead of isVisible() in tray service to refocus Signal window #7048
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.
First time contributor checklist:
Contributor checklist:
main
branchnpm run ready
run passes successfully (more about tests here)Description
This PR should close #6429.
As suggested by @Sajito, it changes the
SystemTrayService
in a way that instead of using theisVisible
method it now makes use of theisFocused
method in the click handler/ menu builder to determine, whether the Signal Desktop app should be hidden or shown.While in theory
isVisible
should also lead to the desired behavior, on platforms like KDE Plasma this doesn't work and reports true even if the window is out of focus.With the
isFocused
method, this is not the case anymore.I only tested this PR on Manjaro Linux running KDE Plasma 6 (Wayland), so it would be helpful to test the new behavior on other platforms as well.
I can maybe do the Windows 11 test as well.