fix: set Wayland application ID (#34879)

This commit is contained in:
trop[bot]
2022-07-12 09:37:40 +02:00
committed by GitHub
parent 688780aa85
commit 3ca5708faa
4 changed files with 24 additions and 8 deletions

View File

@@ -9,7 +9,6 @@
#include "base/files/file_enumerator.h"
#include "base/logging.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "shell/browser/notifications/notification_delegate.h"
#include "shell/browser/ui/gtk_util.h"
@@ -138,13 +137,8 @@ void LibnotifyNotification::Show(const NotificationOptions& options) {
// Send the desktop name to identify the application
// The desktop-entry is the part before the .desktop
std::string desktop_id;
if (platform_util::GetDesktopName(&desktop_id)) {
const std::string suffix{".desktop"};
if (base::EndsWith(desktop_id, suffix,
base::CompareCase::INSENSITIVE_ASCII)) {
desktop_id.resize(desktop_id.size() - suffix.size());
}
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());
}