mirror of
https://github.com/telegramdesktop/tdesktop
synced 2024-12-24 15:34:20 +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() {
|
LayerWidget::~LayerWidget() {
|
||||||
_controller->restoreFloatPlayerDelegate(floatPlayerDelegate());
|
restoreFloatPlayerDelegate();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Info
|
} // namespace Info
|
||||||
|
@ -53,6 +53,9 @@ protected:
|
|||||||
void paintEvent(QPaintEvent *e) override;
|
void paintEvent(QPaintEvent *e) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void closeHook() override;
|
||||||
|
|
||||||
|
void restoreFloatPlayerDelegate();
|
||||||
not_null<::Media::Player::FloatDelegate*> floatPlayerDelegate();
|
not_null<::Media::Player::FloatDelegate*> floatPlayerDelegate();
|
||||||
not_null<Ui::RpWidget*> floatPlayerWidget() override;
|
not_null<Ui::RpWidget*> floatPlayerWidget() override;
|
||||||
not_null<Window::Controller*> floatPlayerController() override;
|
not_null<Window::Controller*> floatPlayerController() override;
|
||||||
@ -72,6 +75,8 @@ private:
|
|||||||
bool _inResize = false;
|
bool _inResize = false;
|
||||||
bool _tillBottom = false;
|
bool _tillBottom = false;
|
||||||
|
|
||||||
|
bool _floatPlayerDelegateRestored = false;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Info
|
} // namespace Info
|
||||||
|
@ -666,7 +666,7 @@ void LayerStackWidget::showSpecialLayer(
|
|||||||
object_ptr<LayerWidget> layer,
|
object_ptr<LayerWidget> layer,
|
||||||
anim::type animated) {
|
anim::type animated) {
|
||||||
startAnimation([this, layer = std::move(layer)]() mutable {
|
startAnimation([this, layer = std::move(layer)]() mutable {
|
||||||
_specialLayer.destroyDelayed();
|
_specialLayer.destroy();
|
||||||
_specialLayer = std::move(layer);
|
_specialLayer = std::move(layer);
|
||||||
initChildLayer(_specialLayer);
|
initChildLayer(_specialLayer);
|
||||||
}, [this] {
|
}, [this] {
|
||||||
@ -699,7 +699,7 @@ void LayerStackWidget::showMainMenu(
|
|||||||
_mainMenu->setParent(this);
|
_mainMenu->setParent(this);
|
||||||
}, [this] {
|
}, [this] {
|
||||||
clearLayers();
|
clearLayers();
|
||||||
_specialLayer.destroyDelayed();
|
_specialLayer.destroy();
|
||||||
}, Action::ShowMainMenu, animated);
|
}, Action::ShowMainMenu, animated);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user