From 9ef7ec02e59ad9835542cb3f44c0dba8c90d2d82 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 13:59:21 -0400 Subject: [PATCH] fix: replace deprecated libnotify API calls (#43983) notify_notification_set_hint_string() is deprecated, so let's use notify_notification_set_hint() instead. Xref: https://github.com/GNOME/libnotify/commit/2fe1748295c97cd8251e1711e0f54c4d65633d48 Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr --- BUILD.gn | 1 - .../notifications/linux/libnotify_notification.cc | 13 +++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 1dff8dcd55b6..d7ea81ac5aa3 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -74,7 +74,6 @@ if (is_linux) { "notify_notification_set_image_from_pixbuf", "notify_notification_set_timeout", "notify_notification_set_urgency", - "notify_notification_set_hint_string", "notify_notification_set_hint", "notify_notification_show", "notify_notification_close", diff --git a/shell/browser/notifications/linux/libnotify_notification.cc b/shell/browser/notifications/linux/libnotify_notification.cc index 4b6c6cf89776..c931328924ef 100644 --- a/shell/browser/notifications/linux/libnotify_notification.cc +++ b/shell/browser/notifications/linux/libnotify_notification.cc @@ -131,19 +131,20 @@ void LibnotifyNotification::Show(const NotificationOptions& options) { // Always try to append notifications. // Unique tags can be used to prevent this. if (HasCapability("append")) { - libnotify_loader_.notify_notification_set_hint_string(notification_, - "append", "true"); + libnotify_loader_.notify_notification_set_hint( + notification_, "append", g_variant_new_string("true")); } else if (HasCapability("x-canonical-append")) { - libnotify_loader_.notify_notification_set_hint_string( - notification_, "x-canonical-append", "true"); + libnotify_loader_.notify_notification_set_hint( + notification_, "x-canonical-append", g_variant_new_string("true")); } // Send the desktop name to identify the application // The desktop-entry is the part before the .desktop std::string desktop_id = platform_util::GetXdgAppId(); if (!desktop_id.empty()) { - libnotify_loader_.notify_notification_set_hint_string( - notification_, "desktop-entry", desktop_id.c_str()); + libnotify_loader_.notify_notification_set_hint( + notification_, "desktop-entry", + g_variant_new_string(desktop_id.c_str())); } libnotify_loader_.notify_notification_set_hint(