mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 15:17:07 +02:00
Close call panel instead of hiding.
This commit is contained in:
parent
34840766b2
commit
a0eb073728
5 changed files with 13 additions and 15 deletions
Telegram
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -691,8 +691,8 @@ void Panel::showControls() {
|
|||
}
|
||||
}
|
||||
|
||||
void Panel::hideBeforeDestroy() {
|
||||
_window->hide();
|
||||
void Panel::closeBeforeDestroy() {
|
||||
_window->close();
|
||||
reinitWithCall(nullptr);
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
Loading…
Add table
Reference in a new issue