mkiol / GNotifier

Thunderbird add-on that replaces built-in notifications with the OS native notifications
https://addons.mozilla.org/thunderbird/addon/gnotifier/
GNU General Public License v3.0
164 stars 25 forks source link

linux: Provide both image and icon to servers when possible #69

Closed sardemff7 closed 8 years ago

sardemff7 commented 8 years ago

First try for the feature discussed in #67.

mkiol commented 8 years ago

I see following error: console.error: gnotifier: Message: Error: not a ctypes type Stack: linux.checkAvailable@resource://gre/modules/commonjs/toolkit/loader.js -> resource://jid1-oonoa6xbjznvlq-at-jetpack/gnotifier/lib/linux.js:219:40

so probably something is wrong with this declaration: notify_notification_set_hint = libc.declare( "notify_notification_set_hint", ctypes.default_abi, ctypes.void, struct_notification.ptr, ctypes.char.ptr, struct_gvariant.ptr);

sardemff7 commented 8 years ago

I never used this JS API (libc) so yes. Where is the documentation?

sardemff7 commented 8 years ago

Ok, I found the error (void instead of void_t).

I also updated the icon/image code to match the spec, and it should work fine for KDE too, since the image-path/image_path hint is indeed parsed as an URI.

mkiol commented 8 years ago

First of all, thank you for trying to fix it. Now, it works on all servers with spec ver 1.1, so including my KDE DE :-)

Unfortunately I see few issues on distros with 1.2 spec servers. I've made tests on:

Results are:

sardemff7 commented 8 years ago

Ok. First, to my knowledge, only one server can display both image and icon: eventd, which is my server.

The Mint error is strange, do you know which server they are using? Cinnamon? MATE?

The Ubuntu error is… an implementation error. When the server cannot display both, it should pick the image-path hint, not the icon. From the GNOME-Shell code, they do that on purpose, breaking their own spec. And since they really want to break everything, they only ever use image-path as … a path! While the spec is explicit that it should be an URI.

I will then just put either the icon or the image for servers lacking the capability, and do my best regarding URIs.

sardemff7 commented 8 years ago

Simple solution: I expect servers with the x-eventd-overlay-icon capability (so they can display both) to be using the 1.2 spec and to support it strictly (at least to support URIs everywhere). Does that suit you?

mkiol commented 8 years ago

It seems very rational to me. Thank you.