Fix handling of notification disappearing under cursor

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.
This commit is contained in:
Nikolai Nechaev 2025-01-01 13:21:34 +03:00 committed by John Preston
parent 12f8686326
commit 7fcd84d08e

View file

@ -500,7 +500,13 @@ void Widget::opacityAnimationCallback() {
updateOpacity();
update();
if (!_a_opacity.animating() && _hiding) {
manager()->removeWidget(this);
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); // Deletes `this`
}
}