Skip to content

Commit

Permalink
Fix handling of notification disappearing under cursor
Browse files Browse the repository at this point in the history
Previously, notifications disappearing under cursor (e.g., because closed
manually or open from another device) did not notify the manager
properly, as the leaveEventHook was not triggered. This could lead to
notifications staying around when not supposed to (see #28813).

This commit fixes that by explicitly notifying manager when the
notification widget disappears under the cursor.

Fixes #28813.
  • Loading branch information
kolayne committed Jan 2, 2025
1 parent 4505a2b commit 83e0403
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Telegram/SourceFiles/window/notifications_manager_default.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,12 @@ void Widget::opacityAnimationCallback() {
updateOpacity();
update();
if (!_a_opacity.animating() && _hiding) {
if (underMouse()) {
// The notification is leaving from under the cursor, but in such case leave hook is not
// triggered automatically. But we still want the manager to start hiding notifications
// (see #28813).
manager()->startAllHiding();
}
manager()->removeWidget(this);
}
}
Expand Down

0 comments on commit 83e0403

Please sign in to comment.