Bug 497946 - Implement Notifications API for OS-native Notification Support (macOS, Windows 7+, GTK)
Summary: Implement Notifications API for OS-native Notification Support (macOS, Window...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.7   Edit
Hardware: All All
: P3 enhancement with 5 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
: 376820 508153 (view as bug list)
Depends on: 502090
Blocks:
  Show dependency tree
 
Reported: 2016-07-15 03:19 EDT by Alexander Kurtakov CLA
Modified: 2018-11-30 10:07 EST (History)
22 users (show)

See Also:


Attachments
Simple solution based on ToolTip SWT.BALLOON (40.88 KB, image/jpeg)
2018-11-30 04:58 EST, Philippe Brossel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kurtakov CLA 2016-07-15 03:19:15 EDT
It would be nice if SWT gives way to apps to make use of OS notification services. Preliminary research shows that all supported WSs have some sort of support for that. 
	•  Win https://msdn.microsoft.com/en-us/library/windows/desktop/ee330740(v=vs.85).aspx
	•  Gtk https://wiki.gnome.org/HowDoI/GNotification
	•  Mac https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/Introduction.html

I particularly like the simplicity of GNotification (https://developer.gnome.org/gio//2.40/gio-GNotification.html) API and find it good model to base SWT API on.

Refer to bug 229823 for ideas/work on implementing it at Platform.UI level.
Comment 1 Gunnar Wagenknecht CLA 2016-09-22 12:06:08 EDT
Alex, have you done any research on what the different platforms allow and how their API is different?
Comment 2 Eric Williams CLA 2016-09-22 12:17:25 EDT
It's worth noting that GtkStatusIcon is deprecated in favour of using GNotifications. 

Currently we use GtkStatusIcon in TrayItem so porting to GNotifications would be useful.
Comment 3 Andi Thomas CLA 2016-09-22 12:19:56 EDT
Further to Eric's comment on GTK, on the Mac the TrayItem widget is not using the OS Notification services but provides what can only be graciously described as a Windows-equivalent experience.

Moving to the Mac OS notification services would be a huge improvement.
Comment 4 Alexander Kurtakov CLA 2016-09-26 02:57:23 EDT
So if we have someone on the Mac/Cocoa side and assuming we have on the Gtk/Linux side we can start shaping API. 2 out of 3 is fine and win32 can catch up later.
Comment 5 Mikaël Barbero CLA 2016-09-26 04:00:34 EDT
(In reply to Alexander Kurtakov from comment #4)
> So if we have someone on the Mac/Cocoa side and assuming we have on the
> Gtk/Linux side we can start shaping API. 2 out of 3 is fine and win32 can
> catch up later.

Bug 502090 will be a blocker for Cocoa as NSNotification framework is not in bridge support files.
Comment 6 Mikaël Barbero CLA 2016-09-26 04:29:22 EDT
(In reply to Mikaël Barbero from comment #5)
> Bug 502090 will be a blocker for Cocoa as NSNotification framework is not in
> bridge support files.

I meant NSUserNotification framework

(In reply to Alexander Kurtakov from comment #0)
> I particularly like the simplicity of GNotification
> (https://developer.gnome.org/gio//2.40/gio-GNotification.html) API and find
> it good model to base SWT API on.

Here is the API on macOS https://developer.apple.com/reference/foundation/nsusernotification. A common API with GTK should not be hard to find.
Comment 7 Gunnar Wagenknecht CLA 2016-11-25 03:00:23 EST
*** Bug 376820 has been marked as a duplicate of this bug. ***
Comment 8 Gunnar Wagenknecht CLA 2016-11-25 03:00:28 EST
*** Bug 508153 has been marked as a duplicate of this bug. ***
Comment 9 Ivan O CLA 2016-11-25 05:55:38 EST
Probably this will be a good start from :

mac os x
http://www.gbosystems.com/projects/pn0001/
Comment 10 Niraj Modi CLA 2018-05-14 05:59:05 EDT
Moving to 4.9, please re-target as required.
Comment 11 Lakshmi P Shanmugam CLA 2018-08-28 04:23:21 EDT
Moving out of 4.9. Please re-target as required.
Comment 12 Philippe Brossel CLA 2018-11-23 11:31:16 EST
Is there already work in progress ?
Can I contribute something (with some help) ?
Comment 13 Dani Megert CLA 2018-11-23 11:51:40 EST
(In reply to Philippe Brossel from comment #12)
> Is there already work in progress ?
I don't think so.


> Can I contribute something (with some help) ?
Sure, any help is welcome! Alex, can you hold hands here?
Comment 14 Alexander Kurtakov CLA 2018-11-29 13:47:33 EST
(In reply to Dani Megert from comment #13)
> (In reply to Philippe Brossel from comment #12)
> > Is there already work in progress ?
> I don't think so.
> 
> 
> > Can I contribute something (with some help) ?
> Sure, any help is welcome! Alex, can you hold hands here?

IMHO getting bug 229823 first is better and we have pure JFace notification for apps to use (like Mylyn notifications) as it will allow apps to have smth.
I have experimented with Gnotifications one only to face some limitations like mandatory need for desktop file to activate the app in order for notification to be shown on Gnome and IIRC Mikael Barbero pointed me to something similar that has to be set in some config file foreach app to be set in order for notifications to work on Mac OS.
Later on, there could be preference on Platform UI level whether to use JFace or SWT notifications, but I'm afraid we will need changes in many places (including distribution) in order to get native notifications to work proper.
P.S. I have no idea about Windows.
Comment 15 Philippe Brossel CLA 2018-11-29 14:42:49 EST
(In reply to Alexander Kurtakov from comment #14)
> (In reply to Dani Megert from comment #13)
> > (In reply to Philippe Brossel from comment #12)
> > > Is there already work in progress ?
> > I don't think so.
> > 
> > 
> > > Can I contribute something (with some help) ?
> > Sure, any help is welcome! Alex, can you hold hands here?
> 
> IMHO getting bug 229823 first is better and we have pure JFace notification
> for apps to use (like Mylyn notifications) as it will allow apps to have
> smth.
> I have experimented with Gnotifications one only to face some limitations
> like mandatory need for desktop file to activate the app in order for
> notification to be shown on Gnome and IIRC Mikael Barbero pointed me to
> something similar that has to be set in some config file foreach app to be
> set in order for notifications to work on Mac OS.
> Later on, there could be preference on Platform UI level whether to use
> JFace or SWT notifications, but I'm afraid we will need changes in many
> places (including distribution) in order to get native notifications to work
> proper.
> P.S. I have no idea about Windows.

I've already started with bug 229823 because there was hope to get a working solution more quickly : https://git.eclipse.org/r/133272
Would you mind taking a look into it if you find some time to spend ?
Comment 16 Alexander Kurtakov CLA 2018-11-29 14:44:40 EST
(In reply to Philippe Brossel from comment #15)
> (In reply to Alexander Kurtakov from comment #14)
> > (In reply to Dani Megert from comment #13)
> > > (In reply to Philippe Brossel from comment #12)
> > > > Is there already work in progress ?
> > > I don't think so.
> > > 
> > > 
> > > > Can I contribute something (with some help) ?
> > > Sure, any help is welcome! Alex, can you hold hands here?
> > 
> > IMHO getting bug 229823 first is better and we have pure JFace notification
> > for apps to use (like Mylyn notifications) as it will allow apps to have
> > smth.
> > I have experimented with Gnotifications one only to face some limitations
> > like mandatory need for desktop file to activate the app in order for
> > notification to be shown on Gnome and IIRC Mikael Barbero pointed me to
> > something similar that has to be set in some config file foreach app to be
> > set in order for notifications to work on Mac OS.
> > Later on, there could be preference on Platform UI level whether to use
> > JFace or SWT notifications, but I'm afraid we will need changes in many
> > places (including distribution) in order to get native notifications to work
> > proper.
> > P.S. I have no idea about Windows.
> 
> I've already started with bug 229823 because there was hope to get a working
> solution more quickly : https://git.eclipse.org/r/133272
> Would you mind taking a look into it if you find some time to spend ?

Sure, either me or someone else from my team will have a look once 4.11 development opens.
Comment 17 Philippe Brossel CLA 2018-11-30 04:58:33 EST
Created attachment 276778 [details]
Simple solution based on ToolTip SWT.BALLOON

Simple solution based on :

org.eclipse.swt.widgets.ToolTip.ToolTip (style=SWT.BALLOON)
org.eclipse.swt.widgets.TrayItem
Comment 18 Philippe Brossel CLA 2018-11-30 05:13:35 EST
(In reply to Philippe Brossel from comment #17)
> Created attachment 276778 [details]
> Simple solution based on ToolTip SWT.BALLOON
> 
> Simple solution based on :
> 
> org.eclipse.swt.widgets.ToolTip.ToolTip (style=SWT.BALLOON)
> org.eclipse.swt.widgets.TrayItem

I developped this simple solution running on windows a couple of years ago using SWT.

There are some drawbacks :
  - only simple messages with 1 image and 1 text 
  - needs an entry in the system tray
  - cannot control how long it shows  
  - no way to see a 'missed' notification again 

I understand that you are looking for a more 'modern' approach. 

Is there already a clear idea of the expected behaviour/functionnalty ? 

Can I help to further investigate on that ?
Comment 19 Gunnar Wagenknecht CLA 2018-11-30 06:35:44 EST
(In reply to Philippe Brossel from comment #18)

> I understand that you are looking for a more 'modern' approach. 
> 
> Is there already a clear idea of the expected behaviour/functionnalty ? 


It sounds like you want to discuss this in bug 229823. This one here is pretty limited to what the OS offers, i.e. Notification Center on macOS, Windows and Gnome.
Comment 20 Ivan O CLA 2018-11-30 10:01:13 EST
Hopefully here is all about native OS notification...
Comment 21 Ivan O CLA 2018-11-30 10:02:35 EST
Hopefully here is all about native OS notification...
Comment 22 Philippe Brossel CLA 2018-11-30 10:07:31 EST
(In reply to Gunnar Wagenknecht from comment #19)
> (In reply to Philippe Brossel from comment #18)
> 
> > I understand that you are looking for a more 'modern' approach. 
> > 
> > Is there already a clear idea of the expected behaviour/functionnalty ? 
> 
> 
> It sounds like you want to discuss this in bug 229823. This one here is
> pretty limited to what the OS offers, i.e. Notification Center on macOS,
> Windows and Gnome.

Right, bug 229823 is more what I was looking for. 

I'm currently trying to contribute an SWT-Based solution there : https://git.eclipse.org/r/133272

In any case, many thanks to all for the time spent.