From b355c27af6e030ad336710b9579978c190e2b1cc Mon Sep 17 00:00:00 2001 From: hewenfei Date: Thu, 16 May 2024 15:09:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=80=82=E9=85=8DWindowProxy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/windows/menu-main-window.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/windows/menu-main-window.cpp b/src/windows/menu-main-window.cpp index f2a648c..3f2fdcb 100644 --- a/src/windows/menu-main-window.cpp +++ b/src/windows/menu-main-window.cpp @@ -239,8 +239,8 @@ void MenuWindow::init() //setWindowState(Qt::WindowMaximized); setFlags(flags() | Qt::Window | Qt::FramelessWindowHint); - m_windowProxy = new UkuiQuick::WindowProxy(this, UkuiQuick::WindowProxy::SkipSwitcher | UkuiQuick::WindowProxy::SkipTaskBar); - KWindowSystem::setType(winId(), NET::SystemWindow); + m_windowProxy = new UkuiQuick::WindowProxy(this); + m_windowProxy->setWindowType(UkuiQuick::WindowType::SystemWindow); // 访问窗口api rootContext()->setContextProperty("mainWindow", this); @@ -295,9 +295,9 @@ void MenuWindow::initPanelSetting() void MenuWindow::updateGeometry() { updateCurrentScreenGeometry(); + setMinimumSize(m_fullScreenGeometry.size()); + setMaximumSize(m_fullScreenGeometry.size()); m_windowProxy->setGeometry(m_fullScreenGeometry); - setMinimumSize(geometry().size()); - setMaximumSize(geometry().size()); updateGeometryOfMask(); WindowHelper::setRegion(this, m_maskGeometry.x(), m_maskGeometry.y(), m_maskGeometry.width(), m_maskGeometry.height(), 16); @@ -354,8 +354,6 @@ void MenuWindow::focusOutEvent(QFocusEvent *event) bool MenuWindow::event(QEvent *event) { if (event->type() == QEvent::Show) { - KWindowSystem::setType(winId(), NET::SystemWindow); - updateGeometry(); if (QX11Info::isPlatformX11()) { requestActivate(); } @@ -485,6 +483,7 @@ void MenuWindow::activeMenuWindow(bool active) } } this->setScreen(currrentScreen ? currrentScreen : QGuiApplication::primaryScreen()); + updateGeometry(); } setVisible(active);