Skip to content
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

Allow notifications on open room if terminal not focused #281

Merged
merged 4 commits into from
Aug 1, 2024

Conversation

Andrew-Collins
Copy link
Contributor

Hi,

This PR is to implement #276.

It does this by putting the focused state of the application into the store and then checks it in the notifications handler.

This results in notifications being muted only if the room is currently displayed and the terminal is in focus.

If you would like a config entry to control this just let me know. :)

…t relates to is open.

Application::focused state is now available in the store.
@benjajaja
Copy link
Contributor

Looks great, thank you!

src/main.rs Show resolved Hide resolved
@ulyssa
Copy link
Owner

ulyssa commented Aug 1, 2024

@Andrew-Collins This is a great addition, thank you! 🙏

And I believe that @benjajaja is correct that we don't get the focused state on startup, but only whenever the window changes. (And that doesn't always happen with every terminal either). Defaulting focused to true is the right move. 👍

@ulyssa ulyssa enabled auto-merge (squash) August 1, 2024 03:21
@ulyssa ulyssa merged commit 9a1adfb into ulyssa:main Aug 1, 2024
3 checks passed
@ulyssa ulyssa mentioned this pull request Aug 21, 2024
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.

4 participants