diff --git a/Telegram/SourceFiles/ui/widgets/separate_panel.cpp b/Telegram/SourceFiles/ui/widgets/separate_panel.cpp index 798c825d55..69e67fdcee 100644 --- a/Telegram/SourceFiles/ui/widgets/separate_panel.cpp +++ b/Telegram/SourceFiles/ui/widgets/separate_panel.cpp @@ -129,8 +129,14 @@ void SeparatePanel::showAndActivate() { } void SeparatePanel::keyPressEvent(QKeyEvent *e) { - if (e->key() == Qt::Key_Escape && _back->toggled()) { - _synteticBackRequests.fire({}); + if (e->key() == Qt::Key_Escape) { + crl::on_main(this, [=] { + if (_back->toggled()) { + _synteticBackRequests.fire({}); + } else { + _userCloseRequests.fire({}); + } + }); } return RpWidget::keyPressEvent(e); }