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);