X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c61797b6d6498a131348a2d2c54b0fb44bb8eb6d..87b621a5b737c09cef079bb4a9ef53be132d2ce0:/src/gtk/notifmsg.cpp diff --git a/src/gtk/notifmsg.cpp b/src/gtk/notifmsg.cpp index d3b6285925..10d0d7a678 100644 --- a/src/gtk/notifmsg.cpp +++ b/src/gtk/notifmsg.cpp @@ -25,11 +25,12 @@ #if wxUSE_NOTIFICATION_MESSAGE && wxUSE_LIBNOTIFY +#include "wx/notifmsg.h" + #ifndef WX_PRECOMP + #include "wx/app.h" #endif // WX_PRECOMP -#include "wx/notifmsg.h" - #include <libnotify/notify.h> #include "wx/module.h" @@ -82,6 +83,13 @@ wxIMPLEMENT_DYNAMIC_CLASS(wxLibnotifyModule, wxModule); // wxNotificationMessage implementation // ============================================================================ +bool wxNotificationMessage::GTKSetIconName(const wxString& name) +{ + m_iconName = name; + + return true; +} + bool wxNotificationMessage::Show(int timeout) { if ( !wxLibnotifyModule::Initialize() ) @@ -113,6 +121,15 @@ bool wxNotificationMessage::Show(int timeout) return false; } + // Explicitly specified icon name overrides the implicit one determined by + // the flags. + wxScopedCharBuffer buf; + if ( !m_iconName.empty() ) + { + buf = m_iconName.utf8_str(); + icon = buf; + } + // Create the notification or update an existing one if we had already been // shown before. if ( !m_notification ) @@ -122,6 +139,13 @@ bool wxNotificationMessage::Show(int timeout) GetTitle().utf8_str(), GetMessage().utf8_str(), icon +#if !wxUSE_LIBNOTIFY_0_7 + // There used to be an "associated window" + // parameter in this function but it has + // disappeared by 0.7, so use it for previous + // versions only. + , 0 +#endif // libnotify < 0.7 ); if ( !m_notification ) {