mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-01 03:50:43 +00:00
Don't wait for input when there are fullscreen applications
This commit is contained in:
parent
3991be752c
commit
13eeddf479
@ -798,6 +798,10 @@ bool SkipFlashBounceForCustom() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool WaitForInputForCustom() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Supported() {
|
||||
return ServiceRegistered || Gio::Application::get_default();
|
||||
}
|
||||
|
@ -25,6 +25,10 @@ bool SkipFlashBounceForCustom() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool WaitForInputForCustom() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Supported() {
|
||||
return false;
|
||||
}
|
||||
|
@ -163,6 +163,10 @@ bool SkipFlashBounceForCustom() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool WaitForInputForCustom() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Supported() {
|
||||
return true;
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ namespace Notifications {
|
||||
[[nodiscard]] bool SkipAudioForCustom();
|
||||
[[nodiscard]] bool SkipToastForCustom();
|
||||
[[nodiscard]] bool SkipFlashBounceForCustom();
|
||||
[[nodiscard]] bool WaitForInputForCustom();
|
||||
|
||||
[[nodiscard]] bool Supported();
|
||||
[[nodiscard]] bool Enforced();
|
||||
|
@ -369,6 +369,12 @@ bool SkipFlashBounceForCustom() {
|
||||
return SkipToastForCustom();
|
||||
}
|
||||
|
||||
bool WaitForInputForCustom() {
|
||||
QuerySystemNotificationSettings();
|
||||
|
||||
return UserNotificationState != QUNS_BUSY;
|
||||
}
|
||||
|
||||
bool Supported() {
|
||||
#ifndef __MINGW32__
|
||||
if (!Checked) {
|
||||
|
@ -729,7 +729,9 @@ bool Notification::checkLastInput(
|
||||
std::optional<crl::time> lastInputTime) {
|
||||
if (!_waitingForInput) return true;
|
||||
|
||||
const auto waitForUserInput = lastInputTime.has_value()
|
||||
using namespace Platform::Notifications;
|
||||
const auto waitForUserInput = WaitForInputForCustom()
|
||||
&& lastInputTime.has_value()
|
||||
&& (*lastInputTime <= _started);
|
||||
|
||||
if (!waitForUserInput) {
|
||||
|
Loading…
Reference in New Issue
Block a user