2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 14:17:45 +00:00

Don't wait for input when there are fullscreen applications

This commit is contained in:
Ilya Fedin
2022-12-16 13:53:19 +04:00
committed by John Preston
parent 3991be752c
commit 13eeddf479
6 changed files with 22 additions and 1 deletions

View File

@@ -798,6 +798,10 @@ bool SkipFlashBounceForCustom() {
return false;
}
bool WaitForInputForCustom() {
return true;
}
bool Supported() {
return ServiceRegistered || Gio::Application::get_default();
}

View File

@@ -25,6 +25,10 @@ bool SkipFlashBounceForCustom() {
return false;
}
bool WaitForInputForCustom() {
return true;
}
bool Supported() {
return false;
}

View File

@@ -163,6 +163,10 @@ bool SkipFlashBounceForCustom() {
return false;
}
bool WaitForInputForCustom() {
return true;
}
bool Supported() {
return true;
}

View File

@@ -15,6 +15,7 @@ namespace Notifications {
[[nodiscard]] bool SkipAudioForCustom();
[[nodiscard]] bool SkipToastForCustom();
[[nodiscard]] bool SkipFlashBounceForCustom();
[[nodiscard]] bool WaitForInputForCustom();
[[nodiscard]] bool Supported();
[[nodiscard]] bool Enforced();

View File

@@ -369,6 +369,12 @@ bool SkipFlashBounceForCustom() {
return SkipToastForCustom();
}
bool WaitForInputForCustom() {
QuerySystemNotificationSettings();
return UserNotificationState != QUNS_BUSY;
}
bool Supported() {
#ifndef __MINGW32__
if (!Checked) {

View File

@@ -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) {