elementary / notifications

Gtk Notifications Server
https://elementary.io
GNU General Public License v3.0
38 stars 6 forks source link

Provide an API to request DND #58

Open elementaryBot opened 7 years ago

elementaryBot commented 7 years ago

Not sure if it's more appropriate here or in Gala...

Corentin and I were just discussing a way for apps to request Do Not Disturb mode. Some use cases:

Launchpad Details: #LP1505385 Daniel Fore - 2015-10-12 20:39:52 +0000

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/44131859-provide-an-api-to-request-dnd?utm_campaign=plugin&utm_content=tracker%2F60185593&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F60185593&utm_medium=issues&utm_source=github).
elementaryBot commented 7 years ago

Yeah, this would be awesome. In Android Marshmallow they introduced it and it's pretty cool to not have to handle such things. Here is an article with some screenshots that can help for the implementation: http://www.androidcentral.com/inside-android-ms-new-do-not-disturb-mode

Launchpad Details: #LPC Corentin Noël - 2015-10-12 20:51:01 +0000

elementaryBot commented 7 years ago

Maybe an integer with the number of apps that request the DND would be sufficient. E.g. every apps that require it adds +1 when it wants it, and remove 1 once it's done. That would create some problem if one of these applications crashed though.

On 12/10/2015 22:39, Daniel Fore wrote:

Public bug reported:

Not sure if it's more appropriate here or in Gala...

Corentin and I were just discussing a way for apps to request Do Not Disturb mode. Some use cases:

  • Calendar wants to set Do Not Disturb during an event (like a meeting)
  • Videos wants to set Do Not Disturb while watching video full screen
  • A presentation app wants to set Do Not Disturb while presenting
  • A writing app has an "Focus Mode" (like iA writer) and wants to set Do Not Disturb while in this mode

** Affects: gala Importance: Undecided Status: New

** Affects: switchboard-plug-notifications Importance: Undecided Status: New

** Also affects: gala Importance: Undecided Status: New

Launchpad Details: #LPC xapantu - 2015-10-12 21:03:19 +0000

elementaryBot commented 7 years ago

In the moment that is possible using the public dconf-key. Or isn't that enough?

Launchpad Details: #LPC Marcus Wichelmann - 2015-10-12 22:03:30 +0000

elementaryBot commented 7 years ago

Not really, for instance :

State 0, do not disturb not enabled

App 1 is started, switches DND on

App 2 is started, is happy about DND on

App 1 shut down, disable DND as it enables it itself

BOOM, app 2 is launched but DND is off

On 13/10/2015 00:03, Marcus Wichelmann wrote:

In the moment that is possible using the public dconf-key. Or isn't that enough?

Launchpad Details: #LPC xapantu - 2015-10-12 22:30:56 +0000

elementaryBot commented 7 years ago

I guess a smart thing to do would be also to watch for the process to end in case it did (for example) crash or the developer simply forget to end the request for DnD

Launchpad Details: #LPC Daniel Fore - 2015-10-13 18:35:41 +0000

elementaryBot commented 7 years ago

Maybe use file descriptors so it is closed when the process exits? That way no messy watching of the processes. Make sure the CLOEXEC flag is on so child processes (e.g. a mail application triggered from the about dialog) do not activate DND.

Launchpad Details: #LPC Cameron Norman - 2015-10-13 19:04:26 +0000

ibnesayeed commented 3 years ago

An option to enable DND when an app is running in full screen or the screen is shared by any app (including web-based screen sharing) would be great. This has become even more important now (post-pandemic) as people are using Zoom or other apps like that more often for remote meetings and presentations.