Fix crash in scale preview reparenting.

This commit is contained in:
John Preston 2023-11-22 13:01:19 +04:00
parent 4b5e2582d9
commit db0a31b87e

View file

@ -169,12 +169,13 @@ void Preview::watchParent() {
}
void Preview::reparent() {
if (_widget.window() == &_widget) {
const auto parent = _widget.parentWidget();
if (!parent) {
// macOS just removes parenting for a _window.
_parentWatcher = nullptr;
return;
}
_widget.setParent(_widget.window());
_widget.setParent(parent->window(), _widget.windowFlags());
if (_shown) {
_widget.show();
updateGlobalPosition();