Merge pull request #221 from electron/no-link-libnotify

Do not link with libnotify
This commit is contained in:
Cheng Zhao 2016-05-17 11:33:03 +00:00
commit d27a20f1cd
2 changed files with 4 additions and 3 deletions

View file

@ -1,7 +1,7 @@
{ {
'variables': { 'variables': {
# The libraries brightray will be compiled to. # The libraries brightray will be compiled to.
'linux_system_libraries': 'gtk+-2.0 libnotify dbus-1 x11 xi xcursor xdamage xrandr xcomposite xext xfixes xrender xtst gconf-2.0 gmodule-2.0 nss' 'linux_system_libraries': 'gtk+-2.0 dbus-1 x11 xi xcursor xdamage xrandr xcomposite xext xfixes xrender xtst gconf-2.0 gmodule-2.0 nss'
}, },
'includes': [ 'includes': [
'filenames.gypi', 'filenames.gypi',

View file

@ -15,6 +15,7 @@
namespace brightray { namespace brightray {
namespace { namespace {
LibNotifyLoader libnotify_loader_; LibNotifyLoader libnotify_loader_;
bool HasCapability(const std::string& capability) { bool HasCapability(const std::string& capability) {
@ -35,7 +36,6 @@ bool NotifierSupportsActions() {
static bool notify_has_result = false; static bool notify_has_result = false;
static bool notify_result = false; static bool notify_result = false;
GList *capabilities = NULL;
if (notify_has_result) if (notify_has_result)
return notify_result; return notify_result;
@ -62,7 +62,8 @@ Notification* Notification::Create(NotificationDelegate* delegate,
// static // static
bool LibnotifyNotification::Initialize() { bool LibnotifyNotification::Initialize() {
if (!libnotify_loader_.Load("libnotify.so.4") && if (!libnotify_loader_.Load("libnotify.so.4") && // most common one
!libnotify_loader_.Load("libnotify.so.5") &&
!libnotify_loader_.Load("libnotify.so.1") && !libnotify_loader_.Load("libnotify.so.1") &&
!libnotify_loader_.Load("libnotify.so")) { !libnotify_loader_.Load("libnotify.so")) {
return false; return false;