mirror of
https://github.com/telegramdesktop/tdesktop
synced 2024-12-23 23:14:41 +00:00
Restore player delegate non-delayed (crashfix).
This commit is contained in:
parent
2b95b96fa3
commit
e5949dbb86
@ -253,8 +253,19 @@ void LayerWidget::paintEvent(QPaintEvent *e) {
|
||||
}
|
||||
}
|
||||
|
||||
void LayerWidget::restoreFloatPlayerDelegate() {
|
||||
if (!_floatPlayerDelegateRestored) {
|
||||
_floatPlayerDelegateRestored = true;
|
||||
_controller->restoreFloatPlayerDelegate(floatPlayerDelegate());
|
||||
}
|
||||
}
|
||||
|
||||
void LayerWidget::closeHook() {
|
||||
restoreFloatPlayerDelegate();
|
||||
}
|
||||
|
||||
LayerWidget::~LayerWidget() {
|
||||
_controller->restoreFloatPlayerDelegate(floatPlayerDelegate());
|
||||
restoreFloatPlayerDelegate();
|
||||
}
|
||||
|
||||
} // namespace Info
|
||||
|
@ -53,6 +53,9 @@ protected:
|
||||
void paintEvent(QPaintEvent *e) override;
|
||||
|
||||
private:
|
||||
void closeHook() override;
|
||||
|
||||
void restoreFloatPlayerDelegate();
|
||||
not_null<::Media::Player::FloatDelegate*> floatPlayerDelegate();
|
||||
not_null<Ui::RpWidget*> floatPlayerWidget() override;
|
||||
not_null<Window::Controller*> floatPlayerController() override;
|
||||
@ -72,6 +75,8 @@ private:
|
||||
bool _inResize = false;
|
||||
bool _tillBottom = false;
|
||||
|
||||
bool _floatPlayerDelegateRestored = false;
|
||||
|
||||
};
|
||||
|
||||
} // namespace Info
|
||||
|
@ -666,7 +666,7 @@ void LayerStackWidget::showSpecialLayer(
|
||||
object_ptr<LayerWidget> layer,
|
||||
anim::type animated) {
|
||||
startAnimation([this, layer = std::move(layer)]() mutable {
|
||||
_specialLayer.destroyDelayed();
|
||||
_specialLayer.destroy();
|
||||
_specialLayer = std::move(layer);
|
||||
initChildLayer(_specialLayer);
|
||||
}, [this] {
|
||||
@ -699,7 +699,7 @@ void LayerStackWidget::showMainMenu(
|
||||
_mainMenu->setParent(this);
|
||||
}, [this] {
|
||||
clearLayers();
|
||||
_specialLayer.destroyDelayed();
|
||||
_specialLayer.destroy();
|
||||
}, Action::ShowMainMenu, animated);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user