Fix call panel in macOS build.

This commit is contained in:
John Preston 2017-05-05 14:49:23 +03:00
parent 771bba4e01
commit d0afe83beb
2 changed files with 15 additions and 5 deletions

View File

@ -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;
}

View File

@ -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()) {