mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-05 08:55:59 +00:00
Add a checkbox to disable taskbar flash.
Also add ability to set urgent flag for the window on Linux. Fixes #223, fixes #897, fixes #906.
This commit is contained in:
@@ -757,7 +757,8 @@ void MainWindow::toggleDisplayNotifyFromTray() {
|
||||
return;
|
||||
}
|
||||
|
||||
bool soundNotifyChanged = false;
|
||||
auto soundNotifyChanged = false;
|
||||
auto flashBounceNotifyChanged = false;
|
||||
Global::SetDesktopNotify(!Global::DesktopNotify());
|
||||
if (Global::DesktopNotify()) {
|
||||
if (Global::RestoreSoundNotifyFromTray() && !Global::SoundNotify()) {
|
||||
@@ -765,6 +766,12 @@ void MainWindow::toggleDisplayNotifyFromTray() {
|
||||
Global::SetRestoreSoundNotifyFromTray(false);
|
||||
soundNotifyChanged = true;
|
||||
}
|
||||
if (Global::RestoreFlashBounceNotifyFromTray()
|
||||
&& !Global::FlashBounceNotify()) {
|
||||
Global::SetFlashBounceNotify(true);
|
||||
Global::SetRestoreFlashBounceNotifyFromTray(false);
|
||||
flashBounceNotifyChanged = true;
|
||||
}
|
||||
} else {
|
||||
if (Global::SoundNotify()) {
|
||||
Global::SetSoundNotify(false);
|
||||
@@ -773,13 +780,23 @@ void MainWindow::toggleDisplayNotifyFromTray() {
|
||||
} else {
|
||||
Global::SetRestoreSoundNotifyFromTray(false);
|
||||
}
|
||||
if (Global::FlashBounceNotify()) {
|
||||
Global::SetFlashBounceNotify(false);
|
||||
Global::SetRestoreFlashBounceNotifyFromTray(true);
|
||||
flashBounceNotifyChanged = true;
|
||||
} else {
|
||||
Global::SetRestoreFlashBounceNotifyFromTray(false);
|
||||
}
|
||||
}
|
||||
Local::writeUserSettings();
|
||||
account().session().notifications().settingsChanged().notify(
|
||||
Window::Notifications::ChangeType::DesktopEnabled);
|
||||
using Change = Window::Notifications::ChangeType;
|
||||
auto &changes = account().session().notifications().settingsChanged();
|
||||
changes.notify(Change::DesktopEnabled);
|
||||
if (soundNotifyChanged) {
|
||||
account().session().notifications().settingsChanged().notify(
|
||||
Window::Notifications::ChangeType::SoundEnabled);
|
||||
changes.notify(Change::SoundEnabled);
|
||||
}
|
||||
if (flashBounceNotifyChanged) {
|
||||
changes.notify(Change::FlashBounceEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user