mirror of https://github.com/procxx/kepka.git
Fix crash in closing export panel.
This commit is contained in:
parent
e5cfa3fdc9
commit
9c85d58235
|
@ -306,7 +306,9 @@ void MainWindow::ensureLayerCreated() {
|
||||||
bodyWidget());
|
bodyWidget());
|
||||||
|
|
||||||
_layer->hideFinishEvents(
|
_layer->hideFinishEvents(
|
||||||
) | rpl::start_with_next([=] {
|
) | rpl::filter([=] {
|
||||||
|
return _layer != nullptr; // Last hide finish is sent from destructor.
|
||||||
|
}) | rpl::start_with_next([=] {
|
||||||
destroyLayer();
|
destroyLayer();
|
||||||
}, _layer->lifetime());
|
}, _layer->lifetime());
|
||||||
|
|
||||||
|
@ -319,12 +321,14 @@ void MainWindow::destroyLayer() {
|
||||||
if (!_layer) {
|
if (!_layer) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto layer = base::take(_layer);
|
auto layer = base::take(_layer);
|
||||||
const auto resetFocus = Ui::InFocusChain(layer);
|
const auto resetFocus = Ui::InFocusChain(layer);
|
||||||
if (resetFocus) {
|
if (resetFocus) {
|
||||||
setFocus();
|
setFocus();
|
||||||
}
|
}
|
||||||
layer = nullptr;
|
layer = nullptr;
|
||||||
|
|
||||||
if (const auto controller = sessionController()) {
|
if (const auto controller = sessionController()) {
|
||||||
controller->disableGifPauseReason(Window::GifPauseReason::Layer);
|
controller->disableGifPauseReason(Window::GifPauseReason::Layer);
|
||||||
}
|
}
|
||||||
|
@ -337,11 +341,10 @@ void MainWindow::destroyLayer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::ui_hideSettingsAndLayer(anim::type animated) {
|
void MainWindow::ui_hideSettingsAndLayer(anim::type animated) {
|
||||||
if (_layer) {
|
if (animated == anim::type::instant) {
|
||||||
|
destroyLayer();
|
||||||
|
} else if (_layer) {
|
||||||
_layer->hideAll(animated);
|
_layer->hideAll(animated);
|
||||||
if (animated == anim::type::instant) {
|
|
||||||
destroyLayer();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -285,7 +285,9 @@ void SeparatePanel::ensureLayerCreated() {
|
||||||
_layer->resize(size);
|
_layer->resize(size);
|
||||||
}, _layer->lifetime());
|
}, _layer->lifetime());
|
||||||
_layer->hideFinishEvents(
|
_layer->hideFinishEvents(
|
||||||
) | rpl::start_with_next([=]{
|
) | rpl::filter([=] {
|
||||||
|
return _layer != nullptr; // Last hide finish is sent from destructor.
|
||||||
|
}) | rpl::start_with_next([=] {
|
||||||
if (Ui::InFocusChain(_layer)) {
|
if (Ui::InFocusChain(_layer)) {
|
||||||
setFocus();
|
setFocus();
|
||||||
}
|
}
|
||||||
|
|
|
@ -397,7 +397,7 @@ void LayerStackWidget::hideCurrent(anim::type animated) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void LayerStackWidget::hideLayers(anim::type animated) {
|
void LayerStackWidget::hideLayers(anim::type animated) {
|
||||||
startAnimation([] {}, [this] {
|
startAnimation([] {}, [&] {
|
||||||
clearLayers();
|
clearLayers();
|
||||||
}, Action::HideLayer, animated);
|
}, Action::HideLayer, animated);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue