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

Add System Notification Support #1932

Open
SDLBugzilla opened this issue Feb 11, 2021 · 3 comments
Open

Add System Notification Support #1932

SDLBugzilla opened this issue Feb 11, 2021 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 2.1
Reported for operating system, platform: Other, All

Comments on the original bug report:

On 2015-07-27 09:30:06 +0000, wrote:

Some systems have notification server which the application can use. These are available on OSX, iOS, Linux, Android, etc.

Add a simple notification message api similar to the SimpleMessageBox such as:

SDL_ShowNotification(SDL_Surface* icon,
Uint32 type,
const char* title,
const char* message)

On systems that do not support notifications or the notification server is not running this can be faked similar to the message box based on SDL creating a window which will fade in and fade out after a certain time.

On 2015-08-07 11:33:09 +0000, Amit Jain wrote:

HI
Any updates for this defect/feature ?
Is there any plan to add such Notification API in SDL ?

On 2016-11-12 12:18:49 +0000, wrote:

Created attachment 2612
Example notifications API working on Linux (dbus)

I have created a quick patch which is working on Linux in dbus. This could be converted over to libnotify as well which would then work on other platforms that do not use dbus for notifications. But as libnotify uses dbus there was no reason to put in support at the moment.

The idea would be to have two interfaces one simple interface which is just to display a quick notification similar to a messagebox. The second one (not implemented yet) where you retain a pointer to an SDL_Notification and can call update on it allowing updating progress notifications etc.

I am also thinking about the best way to implement the Icon. The dbus notification protocol excepts both a filename and also raw image data (but some platforms might not).

On 2016-11-12 13:51:22 +0000, wrote:

Created attachment 2613
Example notifications API working on Linux (dbus)

On 2017-08-12 23:30:02 +0000, Sam Lantinga wrote:

Ryan, do you think this is a generally useful addition for SDL 2.1?

@SDLBugzilla SDLBugzilla added the enhancement New feature or request label Feb 11, 2021
@icculus
Copy link
Collaborator

icculus commented Aug 13, 2021

I think this would be neat. Linux, Mac and Windows all have a notification interface now, and of course iOS and Android do, too. Let's toss this into 2.0.20, since we're probably spending all of 2.0.18 cutting down open bugs instead of building new things.

@icculus icculus added this to the 2.0.20 milestone Aug 13, 2021
@icculus
Copy link
Collaborator

icculus commented Jan 27, 2022

Bump this to SDL3.

@slouken slouken modified the milestones: 2.0.22, 3.0 Jan 27, 2022
@smcv
Copy link
Contributor

smcv commented Mar 21, 2022

For the Linux implementation, it would be best if this was container-friendly by trying both org.freedesktop.portal.Notification and org.freedesktop.Notifications, in some order (try one, and if it fails with a D-Bus error, try the other).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants