Skip to content

Commit ba1c01f

Browse files
committed
Merge pull request nwjs#2818 from Arteris/notification_api_version
Add version check for libnotify.
2 parents e43e19b + 42adc3b commit ba1c01f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/nw_notification_manager_linux.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,18 @@ bool NotificationManagerLinux::AddDesktopNotification(const content::ShowDesktop
113113
NotifyNotification * notif;
114114
NotificationMap::iterator i = getNotification(notification_id);
115115
if (i==mNotificationIDmap.end()) {
116+
#ifdef NOTIFY_CHECK_VERSION
117+
#if NOTIFY_CHECK_VERSION(0,7,0)
116118
notif = notify_notification_new (
117119
base::UTF16ToUTF8(params.title).c_str(), base::UTF16ToUTF8(params.body).c_str(), NULL);
120+
#else
121+
notif = notify_notification_new (
122+
base::UTF16ToUTF8(params.title).c_str(), base::UTF16ToUTF8(params.body).c_str(), NULL, NULL);
123+
#endif
124+
#else
125+
notif = notify_notification_new (
126+
base::UTF16ToUTF8(params.title).c_str(), base::UTF16ToUTF8(params.body).c_str(), NULL, NULL);
127+
#endif
118128
NotificationData data;
119129
data.mNotification = notif;
120130
data.mRenderProcessId = render_process_id;

0 commit comments

Comments
 (0)