Close call panel instead of hiding.

This commit is contained in:
John Preston 2020-08-14 19:59:24 +04:00
parent 34840766b2
commit a0eb073728
5 changed files with 13 additions and 15 deletions

View File

@ -55,11 +55,15 @@ void Instance::startOutgoingCall(not_null<UserData*> user, bool video) {
}
void Instance::callFinished(not_null<Call*> call) {
destroyCall(call);
crl::on_main(call, [=] {
destroyCall(call);
});
}
void Instance::callFailed(not_null<Call*> call) {
destroyCall(call);
crl::on_main(call, [=] {
destroyCall(call);
});
}
void Instance::callRedial(not_null<Call*> call) {
@ -101,7 +105,9 @@ void Instance::playSound(Sound sound) {
void Instance::destroyCall(not_null<Call*> call) {
if (_currentCall.get() == call) {
destroyCurrentPanel();
_currentCallPanel->closeBeforeDestroy();
_currentCallPanel = nullptr;
auto taken = base::take(_currentCall);
_currentCallChanges.fire(nullptr);
taken.reset();
@ -113,13 +119,6 @@ void Instance::destroyCall(not_null<Call*> call) {
}
}
void Instance::destroyCurrentPanel() {
_currentCallPanel->hideBeforeDestroy();
// Always queue the destruction.
crl::on_main([panel = std::move(_currentCallPanel)]{});
}
void Instance::createCall(not_null<UserData*> user, Call::Type type, bool video) {
auto call = std::make_unique<Call>(getCallDelegate(), user, type, video);
const auto raw = call.get();

View File

@ -60,7 +60,6 @@ private:
void playSound(Sound sound) override;
void createCall(not_null<UserData*> user, Call::Type type, bool video);
void destroyCall(not_null<Call*> call);
void destroyCurrentPanel();
void requestPermissionsOrFail(Fn<void()> onSuccess) override;
void requestPermissionOrFail(Platform::PermissionType type, Fn<void()> onSuccess);

View File

@ -691,8 +691,8 @@ void Panel::showControls() {
}
}
void Panel::hideBeforeDestroy() {
_window->hide();
void Panel::closeBeforeDestroy() {
_window->close();
reinitWithCall(nullptr);
}

View File

@ -52,7 +52,7 @@ public:
void showAndActivate();
void replaceCall(not_null<Call*> call);
void hideBeforeDestroy();
void closeBeforeDestroy();
private:
class Content;

@ -1 +1 @@
Subproject commit f2f592be817edc289eaff0248f3e41c945b736bd
Subproject commit a1dbca85783289d737ce0368f5ec3659b5745458