Fix crash on right click in ConfirmBox with link.

This commit is contained in:
John Preston 2021-04-13 19:02:17 +04:00
parent be74a391ba
commit 3e5e0cb9df
1 changed files with 4 additions and 6 deletions

View File

@ -304,12 +304,10 @@ void ConfirmBox::mouseReleaseEvent(QMouseEvent *e) {
_lastMousePos = e->globalPos(); _lastMousePos = e->globalPos();
updateHover(); updateHover();
if (const auto activated = ClickHandler::unpressed()) { if (const auto activated = ClickHandler::unpressed()) {
const auto guard = window(); ActivateClickHandler(window(), activated, e->button());
Ui::hideLayer(); crl::on_main(this, [=] {
ActivateClickHandler(guard, activated, e->button()); closeBox();
});
// Keep the link alive, otherwise it is not activated.
crl::on_main([activated] {});
return; return;
} }
BoxContent::mouseReleaseEvent(e); BoxContent::mouseReleaseEvent(e);