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 1, 2025
1 parent 4505a2b commit c771a4b
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,14 @@ void Widget::hideAnimated(float64 duration, const anim::transition &func) {
}

void Widget::updateOpacity() {
setWindowOpacity(_a_opacity.value(_hiding ? 0. : 1.) * _manager->demoMasterOpacity());
const auto opacity = _a_opacity.value(_hiding ? 0. : 1.) * _manager->demoMasterOpacity();
if (opacity == 0. && 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();
}
setWindowOpacity(opacity);
}

void Widget::changeShift(int top) {
Expand Down

0 comments on commit c771a4b

Please sign in to comment.