mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Fix crash in scale preview reparenting.
This commit is contained in:
parent
4b5e2582d9
commit
db0a31b87e
1 changed files with 3 additions and 2 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue