Skip to content

Add System Notification Support #1932

Open
@SDLBugzilla

Description

@SDLBugzilla

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions