Skip to content

Commit

Permalink
fix: resident floating message cannot be closed
Browse files Browse the repository at this point in the history
windowHandle() is not created by default,
use close() instead.

Bug: PMS-297669
  • Loading branch information
rb-union authored and deepin-bot[bot] committed Jan 2, 2025
1 parent 367371a commit fb8711b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/widgets/dfloatingmessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@ void DFloatingMessagePrivate::init()
hBoxLayout->addWidget(closeButton);

q->connect(closeButton, &DIconButton::clicked, q, [q]() {
if (q->windowHandle()) {
q->windowHandle()->close();
}
q->close();

if(ENABLE_ANIMATIONS && ENABLE_ANIMATION_MESSAGE) {
Q_EMIT q->messageClosed();
}
Expand Down

0 comments on commit fb8711b

Please sign in to comment.