Fix libnotify compatibility across its versions
|Assignee:||Jan Dolinár||% Done:|
I noticed that since libnotify-0.7.0, the API has changed and more specifically the prototype of
The attached patch attempts to make the code in
TrayIconX11.cpp compatible with both APIs.
I only tested it with libnotify-0.7.1, so I'd like someone to check if it still compiles with an older libnotify (0.6 or 0.5 branch).
#3 Updated by Jan Dolinár over 8 years ago
Tested on Arch with libnotify 0.5.2 and it fails to compile. I believe that the check in TrayIconX11 should look like this:
#if !defined(flagNOGTK) #include <glib.h> #include <libnotify/notify.h> #if NOTIFY_CHECK_VERSION(0,7,0) #define NOTIFY_VERSION_GT_0_7_0 #endif #endif
Natty has the same version (I will test in few minutes), some of the previous versions of Ubuntu go as deep as 4.5 :) We will see detailed results for each tomorrow morning in launchpad ;) Mirek, it would be great if you can commit the above snippet tonight, otherwise the NOGTK builds will most probably fail.
#5 Updated by Jan Dolinár over 8 years ago
Jan Dolinár wrote:
Mirek, it would be great if you can commit the above snippet tonight, otherwise the NOGTK builds will most probably fail.
Meh, talking nonsense here :) Actually the non-NOGTK (that is normal) builds would fail :)
Also, since the check is at one place only the
#if NOTIFY_CHECK_VERSION(0,7,0) could be directly at the place where is it used...
#7 Updated by Jan Dolinár over 8 years ago
Upon further inspection I found I was also wrong about the ubuntu version. I must have been really tired yesterday :-/ In Natty there is 0.5.0, which differs from 0.5.2 in one signifact detail - it lacks the NOTIFY_CHECK_VERSION macro, so original code from Lionel would actually work there and my correction wouldn't. So for best compatibility across all versions I think it must be
#if !defined(flagNOGTK) #include <glib.h> #include <libnotify/notify.h> #ifdef NOTIFY_CHECK_VERSION #if NOTIFY_CHECK_VERSION(0,7,0) #define NOTIFY_VERSION_GT_0_7_0 #endif #endif #endif
This works in Natty (libnotify 0.5.0) and in Arch both with 0.5.2 and 0.7.1.
Sorry for the mistakes yesterday...
Sender Ghost: Thanks for confirmation ;)