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

[Linux] Notifications Not Showing Properly #465

Closed
Subash opened this issue Jul 7, 2014 · 47 comments
Closed

[Linux] Notifications Not Showing Properly #465

Subash opened this issue Jul 7, 2014 · 47 comments

Comments

@Subash
Copy link

Subash commented Jul 7, 2014

Notifications on Ubuntu are shown as alerts instead of regular notification.
Is this how notifications are supposed to look on ubuntu ?
ubuntu____running_

@Subash Subash changed the title [Linux] Notifications Alert Only [Linux] Notifications Not Showing Properly Jul 7, 2014
@zcbenz zcbenz added the linux label Aug 19, 2014
@zcbenz
Copy link
Member

zcbenz commented Aug 19, 2014

What's the version of Ubuntu and were you using Unity?

@Subash
Copy link
Author

Subash commented Aug 21, 2014

It's a virtualbox VM with ubuntu 14.xx LTS.

@zcbenz
Copy link
Member

zcbenz commented Aug 21, 2014

Can you run notify-send summary body under terminal and see if it shows a proper notification? Notifications on Linux sometimes can not work very well in virtual machines.

@zcbenz
Copy link
Member

zcbenz commented Oct 14, 2014

I'm closing this for lack of information, please reopen if you can provide more information.

@zcbenz zcbenz closed this as completed Oct 14, 2014
@sidoh
Copy link

sidoh commented Apr 1, 2015

I'm having this issue as well. I'm running ubutnu 14.04.2 LTS.

notify-send shows the system notifications I'd expect to see (growl-esque notifications in the top-right of my screen).

Notifications in the atom-shell app I'm trying to use and when I create them manually (with new Notification("msg")) show these ugly alert boxes:

screenshot

Any idea how to resolve this?

@zcbenz
Copy link
Member

zcbenz commented Apr 2, 2015

@sidoh Can you download Atom editor and see if the sending a notification works in its devtools? On some distributions the notification can only show correctly if the application is "installed".

@sidoh
Copy link

sidoh commented Apr 2, 2015

I installed atom from this PPA:

http://www.webupd8.org/2014/05/atom-text-editor-ubuntu-ppa-update.html

Within atom's DevTools I'm getting the same thing (ugly alert with new Notification).

@anaisbetts
Copy link
Contributor

I've seen this bug too, it's super distro-specific 😿

@zcbenz
Copy link
Member

zcbenz commented Apr 2, 2015

Can you try removing the libnotify.so shipped with atom-shell? It possible that the one shipped with atom-shell is too old. You may have to create a symbol link to system's libnotify library to make it run.

@sidoh
Copy link

sidoh commented Apr 2, 2015

I tried removing it. I relaunched atom and ran the same test with the same result.

I also dropped /usr/lib/x86_64-linux-gnu/libnotify.so.4 into the atom install folder with the same result.

Is this what you intended for me to do?

@zcbenz
Copy link
Member

zcbenz commented Apr 2, 2015

Yeah that is what I intended, thanks.

I think maybe the distribution has some kind of whitelist of sending notifications since different distribution yields different results, so reporting it to the distribution's bug tracker could probably gets some solution from the developers there.

pekim added a commit to pekim/slack-wrapped that referenced this issue May 17, 2015
There was a problem with notifications rendering incorrectly on Ubuntu.
Somewhat similar to that reported in electron/electron#465 .
This appears to have been fixed in electron v0.25.0, so the use of node-notify is
no longer necessary.
@markbaas
Copy link

This bug is valid again. Worked fine with 0.28.3, but with 0.36.7 it fails.

@anaisbetts
Copy link
Contributor

@markbaas Install Unity (you don't have to use it, just have it)

@markbaas
Copy link

@paulcbetts I'm using unity

@markbaas
Copy link

Major applications such as N1 and Slack are affected.

@markbaas
Copy link

Tried all electron versions from 0.28.3 until 0.36.6 and it breaks on 0.33.5

@markbaas
Copy link

Perhaps this worked in previous versions of Ubuntu, at least not in 16.04. On unity electron wants to use unity specific variables, this code breaks that:
https://github.com/atom/brightray/blob/master/browser/linux/libnotify_notification.cc#L31

// Look for the presence of libunity as our hint that we're under Ubuntu.
  base::FileEnumerator enumerator(base::FilePath("/usr/lib"),
                                  false, base::FileEnumerator::FILES);
  base::FilePath haystack;
  while (!((haystack = enumerator.Next()).empty())) {
    if (base::StartsWith(haystack.value(), "/usr/lib/libunity-",
                         base::CompareCase::SENSITIVE)) {
      unity_result = true;
      break;
    }
  }

Instead it should look at running processes IMO.

@anaisbetts
Copy link
Contributor

@markbaas The problem is that fundamentally, the thing we need to detect is, "Does libnotify (or in reality, the service it signals via DBus) have Ubuntu's special patches applied that disable actions". There is no sane way to detect this.

Even if Unity isn't being used at all (i.e. Xubuntu based on Xfce, etc), if libnotify is patched, you'll get the dialog box. You can't detect based on distro name either, because lots of distros like Elementary OS are based on Ubuntu and therefore inherit Ubuntu's brain-damaged notifications while not being called "Ubuntu". While I'm totally on-board with coming up with a better heuristic (since this one fails too in a number of scenarios), it's Not So Easy to do so.

@anaisbetts
Copy link
Contributor

It appears that Ubuntu 16.04 will break the code in Brightray to detect this, we'll have to update it or come up with a better plan

@markbaas
Copy link

I propose the following file change. electron-archive/brightray#197

I couldn't test it as I wasn't able to compile electron (tried all weekend).

@3v1n0
Copy link
Contributor

3v1n0 commented Apr 13, 2016

@paulcbetts I think the best way is just getting the server info from libnotify or the supported caps.

Just for being clear, here's what you get when running notify-osd:

>>> from gi.repository import Notify
>>> Notify.get_server_info()
(True, 'notify-osd', 'Canonical Ltd', '1.0', '1.1')
>>> Notify.get_server_caps()
['body', 'body-markup', 'icon-static', 'image/svg+xml', 'x-canonical-private-synchronous', 'x-canonical-append', 'x-canonical-private-icon-only', 'x-canonical-truncation', 'private-synchronous', 'append', 'private-icon-only', 'truncation']

@marcosfede
Copy link

slacknotification
still present for the slack app on ubuntu 16.04. any fix for this?

@MarshallOfSound
Copy link
Member

@marcosfede The slack app will have to update electron versions before it is fixed

@marie-meister
Copy link

marie-meister commented Apr 25, 2016

I got the same bug in Slack since updating to Ubuntu 16.04 .. no virtual machine

@philippgerard
Copy link

Same here with 16.04 in Franz app and Nylas N1.

@MarshallOfSound
Copy link
Member

@philippgerard I'm just going to reiterate. Just because it is fixed here (upstream) doesn't mean that the individual apps that use electron have updated to a version of electron that has the fix....

@Arihantar
Copy link

So do we have a solution to this above issue. My Slack and every other notifications are coming as alerts after updating to Ubuntu 16.04.

@mcg
Copy link

mcg commented Apr 25, 2016

@Arihantar Workaround posted in this thread, and you can also export ELECTRON_USE_UBUNTU_NOTIFIER=1

@xzitlou
Copy link

xzitlou commented Apr 25, 2016

I tried export ELECTRON_USE_UBUNTU_NOTIFIER=1 but I'm still getting the same annoying Electron alerts on my Slack application..

@mcg
Copy link

mcg commented Apr 25, 2016

@xzitlou How to use that workaround is probably not for this bug thread. See #465 (comment) for another option that may work for you.

@cYbercOsmOnauT
Copy link

Had the same problem with Slack. #465 (comment) helped me

@marie-meister
Copy link

thanks @jamesadney #465 (comment) solved the Slack notification bug!

@jurgenhaas
Copy link

I'm on Ubuntu 16.04 using Mattermost desktop and #465 (comment) removed the annoying notifications but now I'm not getting any notifications at all.

@weeman1337
Copy link

Since I updated to Ubuntu 16.04 I'm also affected by this bug.

@mhsiddiqui
Copy link

I am having same bug in ubuntu 16.04.

@cYbercOsmOnauT
Copy link

Guys... read the comment that was linked in this thread several times

@ildella
Copy link

ildella commented May 16, 2016

@MarshallOfSound is there a specific commit with the electron fix? Or better, is the fix inluded in one of the last release? https://github.com/electron/electron/releases Thanks

@MarshallOfSound
Copy link
Member

@ildella It was fixed in electron release 0.37.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests