Skip to content

Commit

Permalink
Manager::startAllHiding: don't treat fading in notifications specially
Browse files Browse the repository at this point in the history
Previously, `Window::Notifications::Default::Manager` would not start
hiding notifications that are fading in when other notifications should
hide. This would lead to some notifications never hiding, e.g., when the
cursor passes through the notification too quickly and there was not
enough time for the notification to fade in completely.

Also renamed `Widget::isShowing` -> `Widget::isFadingIn` for clarity.

Fixes telegramdesktop#28811.
  • Loading branch information
kolayne committed Jan 20, 2025
1 parent 603aa5d commit 5d2d8a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions Telegram/SourceFiles/window/notifications_manager_default.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,10 @@ void Manager::checkLastInput() {

void Manager::startAllHiding() {
if (!hasReplyingNotification()) {
int notHidingCount = 0;
for (const auto &notification : _notifications) {
if (notification->isShowing()) {
++notHidingCount;
} else {
notification->startHiding();
}
notification->startHiding();
}
notHidingCount += _queuedNotifications.size();
if (_hideAll && notHidingCount < 2) {
if (_hideAll && _queuedNotifications.size() < 2) {
_hideAll->startHiding();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class Widget : public Ui::RpWidget {
int shift,
Direction shiftDirection);

bool isShowing() const {
bool isFadingIn() const {
return _a_opacity.animating() && !_hiding;
}

Expand Down

0 comments on commit 5d2d8a6

Please sign in to comment.