2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-03 16:05:57 +00:00

Added ability to check if OS has support of notifications volume.

This commit is contained in:
23rd
2025-08-12 17:03:16 +03:00
parent ced146fc63
commit a3e8848bc8
4 changed files with 13 additions and 0 deletions

View File

@@ -233,6 +233,10 @@ bool ByDefault() {
}, HasCapability); }, HasCapability);
} }
bool VolumeSupported() {
return false;
}
void Create(Window::Notifications::System *system) { void Create(Window::Notifications::System *system) {
static const auto ServiceWatcher = CreateServiceWatcher(); static const auto ServiceWatcher = CreateServiceWatcher();

View File

@@ -205,6 +205,10 @@ bool ByDefault() {
return Supported(); return Supported();
} }
bool VolumeSupported() {
return false;
}
void Create(Window::Notifications::System *system) { void Create(Window::Notifications::System *system) {
system->setManager([=] { return std::make_unique<Manager>(system); }); system->setManager([=] { return std::make_unique<Manager>(system); });
} }

View File

@@ -20,6 +20,7 @@ void MaybeFlashBounceForCustom(Fn<void()> flashBounce);
[[nodiscard]] bool Supported(); [[nodiscard]] bool Supported();
[[nodiscard]] bool Enforced(); [[nodiscard]] bool Enforced();
[[nodiscard]] bool ByDefault(); [[nodiscard]] bool ByDefault();
[[nodiscard]] bool VolumeSupported();
void Create(Window::Notifications::System *system); void Create(Window::Notifications::System *system);
} // namespace Notifications } // namespace Notifications

View File

@@ -417,6 +417,10 @@ bool ByDefault() {
return false; return false;
} }
bool VolumeSupported() {
return true;
}
void Create(Window::Notifications::System *system) { void Create(Window::Notifications::System *system) {
system->setManager([=] { system->setManager([=] {
auto result = std::make_unique<Manager>(system); auto result = std::make_unique<Manager>(system);