From 9b66b76bac3b22dddf93b15daa427419b3d2eb03 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Sat, 19 Nov 2022 03:01:51 +0400 Subject: [PATCH] Use GNotification only in flatpak by default The UX is not the best without sound, so there's no advantage in using GNotification on GNOME. Remove mention about being native to GNOME as it's not true anymore. --- .../linux/notifications_manager_linux.cpp | 4 ++-- .../platform/linux/specific_linux.cpp | 18 ------------------ .../SourceFiles/platform/platform_specific.cpp | 3 +-- 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp index 6099291522..c76378a0c5 100644 --- a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp @@ -1198,7 +1198,7 @@ void Manager::doClearFromSession(not_null session) { } bool Manager::doSkipAudio() const { - return _private->inhibited() || Gio::Application::get_default(); + return _private->inhibited(); } bool Manager::doSkipToast() const { @@ -1206,7 +1206,7 @@ bool Manager::doSkipToast() const { } bool Manager::doSkipFlashBounce() const { - return _private->inhibited() || Gio::Application::get_default(); + return _private->inhibited(); } } // namespace Notifications diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 0d03fe4ae5..68b3fb03d3 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -268,25 +268,7 @@ void LaunchGApplication() { return false; }; - const auto gtkNotifications = [&] { - try { - if (connection && NameHasOwner( - connection, - "org.gtk.Notifications")) { - return true; - } - } catch (...) { - } - - if (ranges::contains(activatableNames, "org.gtk.Notifications")) { - return true; - } - - return false; - }; - if (OptionGApplication.value() - || (!KSandbox::isSnap() && gtkNotifications()) || (KSandbox::isFlatpak() && !freedesktopNotifications())) { Glib::signal_idle().connect_once([] { const auto appId = QGuiApplication::desktopFileName() diff --git a/Telegram/SourceFiles/platform/platform_specific.cpp b/Telegram/SourceFiles/platform/platform_specific.cpp index 15dc33bf17..b0387f82aa 100644 --- a/Telegram/SourceFiles/platform/platform_specific.cpp +++ b/Telegram/SourceFiles/platform/platform_specific.cpp @@ -16,8 +16,7 @@ const char kOptionGApplication[] = "gapplication"; base::options::toggle OptionGApplication({ .id = kOptionGApplication, .name = "GApplication", - .description = "Force enable GNOME's GApplication and GNotification." - " This changes notification behavior to be native to GNOME." + .description = "Force enable GLib's GApplication and GNotification." " When disabled, autodetect is used.", .scope = base::options::linux, .restartRequired = true,