diff --git a/src/windows/menu-main-window.cpp b/src/windows/menu-main-window.cpp index 28a4a5d..abf5102 100644 --- a/src/windows/menu-main-window.cpp +++ b/src/windows/menu-main-window.cpp @@ -83,6 +83,8 @@ void WindowHelper::setWindowGeometry(QWindow *window, const QRect &rect) return; } + // 窗口系统不存在跟屏幕一样大的普通窗口? + window->setWindowState(Qt::WindowNoState); if (QX11Info::isPlatformX11()) { window->setGeometry(rect); @@ -428,6 +430,8 @@ void MenuWindow::updateGeometry() } WindowHelper::setWindowGeometry(this, rect); + setMinimumSize(geometry().size()); + setMaximumSize(geometry().size()); } bool MenuWindow::isFullScreen() const @@ -484,13 +488,13 @@ void MenuWindow::exposeEvent(QExposeEvent *event) if (isExposed()) { requestActivate(); } - QQuickWindow::exposeEvent(event); + QQuickView::exposeEvent(event); } void MenuWindow::focusOutEvent(QFocusEvent *event) { // void QQuickWindow::focusOutEvent(QFocusEvent *ev) { Q_D(QQuickWindow); if (d->contentItem) d->contentItem->setFocus(false, ev->reason()); } - QQuickWindow::focusOutEvent(event); + QQuickView::focusOutEvent(event); // setVisible(false); }