diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 7 | ||||
-rw-r--r-- | src/notifications.cpp | 8 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 69a2dfc..2305fdf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -59,6 +59,13 @@ include_directories (${CMAKE_CURRENT_BINARY_DIR}) set_source_files_properties (engine-eds.cpp PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -Wno-enum-constexpr-conversion") add_library (${SERVICE_LIB} STATIC ${SERVICE_C_SOURCES} ${SERVICE_CXX_SOURCES} ${SERVICE_GENERATED_SOURCES}) + +pkg_check_modules (LIBNOTIFY libnotify REQUIRED) + +if (LIBNOTIFY_VERSION VERSION_GREATER_EQUAL "0.8.4") + target_compile_definitions (${SERVICE_LIB} PUBLIC LIBNOTIFY_HAS_SET_APP_ICON) +endif() + include_directories (${CMAKE_SOURCE_DIR}) link_directories (${SERVICE_DEPS_LIBRARY_DIRS}) diff --git a/src/notifications.cpp b/src/notifications.cpp index 4049851..c7b20c8 100644 --- a/src/notifications.cpp +++ b/src/notifications.cpp @@ -1,6 +1,6 @@ /* * Copyright 2014 Canonical Ltd. - * Copyright 2021-2023 Robert Tari + * Copyright 2021-2025 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -251,6 +251,12 @@ public: } ); +#ifdef LIBNOTIFY_HAS_SET_APP_ICON + NotifyNotification *pNotification = nn.get (); + const char *sIcon = info.m_icon_name.c_str (); + notify_notification_set_app_icon (pNotification, sIcon); +#endif + if (info.m_duration.count() != 0) { const auto& d= info.m_duration; |