From b62f2f3a50b8df41480bcda0852e78a5709bbe51 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Thu, 1 Feb 2024 22:33:45 -0800 Subject: [PATCH] fix: setting visible above geom in ProxyFloatingWindow Used to shrink window to the given size. --- src/cpp/proxywindow.cpp | 11 ++++++++--- src/cpp/proxywindow.hpp | 4 +++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/cpp/proxywindow.cpp b/src/cpp/proxywindow.cpp index a7bf939b..f9dc1920 100644 --- a/src/cpp/proxywindow.cpp +++ b/src/cpp/proxywindow.cpp @@ -98,9 +98,14 @@ void ProxyWindowBase::dataRemoveLast(QQmlListProperty* prop) { backer.removeLast(&backer); } -void ProxyFloatingWindow::setVisible(bool value) { - this->geometryLocked |= value; - ProxyWindowBase::setVisible(value); +void ProxyFloatingWindow::earlyInit(QObject* old) { + ProxyWindowBase::earlyInit(old); + this->geometryLocked = this->window->isVisible(); +} + +void ProxyFloatingWindow::componentComplete() { + ProxyWindowBase::componentComplete(); + this->geometryLocked = true; } void ProxyFloatingWindow::setWidth(qint32 value) { diff --git a/src/cpp/proxywindow.hpp b/src/cpp/proxywindow.hpp index 35240f59..2526f6cd 100644 --- a/src/cpp/proxywindow.hpp +++ b/src/cpp/proxywindow.hpp @@ -77,7 +77,9 @@ class ProxyFloatingWindow: public ProxyWindowBase { QML_ELEMENT; public: - void setVisible(bool value) override; + void earlyInit(QObject* old) override; + void componentComplete() override; + void setWidth(qint32 value) override; void setHeight(qint32 value) override;