mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-02 21:21:50 +00:00
Fix call panel in macOS build.
This commit is contained in:
parent
771bba4e01
commit
d0afe83beb
@ -523,6 +523,14 @@ void Call::setState(State state) {
|
||||
&& _state != State::Ringing) {
|
||||
_waitingTrack.reset();
|
||||
}
|
||||
if (false
|
||||
|| _state == State::Ended
|
||||
|| _state == State::Failed
|
||||
|| _state == State::Busy) {
|
||||
// Destroy controller before destroying Call Panel,
|
||||
// so that the panel hide animation is smooth.
|
||||
destroyController();
|
||||
}
|
||||
switch (_state) {
|
||||
case State::Established:
|
||||
_startTime = getms(true);
|
||||
@ -539,7 +547,6 @@ void Call::setState(State state) {
|
||||
_delegate->callFailed(this);
|
||||
break;
|
||||
case State::Busy:
|
||||
destroyController();
|
||||
_delegate->playSound(Delegate::Sound::Busy);
|
||||
break;
|
||||
}
|
||||
|
@ -671,10 +671,13 @@ void Panel::stateChanged(State state) {
|
||||
}
|
||||
}
|
||||
|
||||
if ((state == State::Starting) || (state == State::WaitingIncoming)) {
|
||||
Platform::ReInitOnTopPanel(this);
|
||||
} else {
|
||||
Platform::DeInitOnTopPanel(this);
|
||||
if (windowHandle()) {
|
||||
// First stateChanged() is called before the first Platform::InitOnTopPanel(this).
|
||||
if ((state == State::Starting) || (state == State::WaitingIncoming)) {
|
||||
Platform::ReInitOnTopPanel(this);
|
||||
} else {
|
||||
Platform::DeInitOnTopPanel(this);
|
||||
}
|
||||
}
|
||||
if (state == State::Established) {
|
||||
if (!isActiveWindow()) {
|
||||
|
Loading…
Reference in New Issue
Block a user