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

Clicking on a notification opens a new instance of the app #129

Open
aral opened this issue Aug 22, 2021 · 1 comment
Open

Clicking on a notification opens a new instance of the app #129

aral opened this issue Aug 22, 2021 · 1 comment

Comments

@aral
Copy link
Contributor

aral commented Aug 22, 2021

In the notifications tutorial (https://docs.elementary.io/develop/apis/notifications), clicking on the notification opens a new instance of the app.

Is this the expected default behaviour?

If so, should there be a note about this in the tutorial (perhaps with a link to how to turn the behaviour off so that your app regains focus instead of a new instance being spawned?)

@danirabbit
Copy link
Member

If you don't set a default action for a notification it will activate, whatever that means for your app. So this should be the same as if it was clicked in the dock or applications menu or activated from anywhere else in the UI.

If you want a single window app, you can override that behavior in the activate function of your application class. I believe that Gtk.Application has a way to make your app single window built in, but otherwise you can check if get_active_window () returns null and use present_with_time () instead

Worth documenting for sure!

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

No branches or pull requests

2 participants