mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 22:55:11 +00:00
Close call panel instead of hiding.
This commit is contained in:
@@ -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;
|
||||
|
Submodule Telegram/lib_ui updated: f2f592be81...a1dbca8578
Reference in New Issue
Block a user