From 0c317e9a417a0b43e189d2c8968a83d99d78d1f0 Mon Sep 17 00:00:00 2001 From: hewenfei Date: Fri, 14 Apr 2023 15:33:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=8D=E8=83=BD=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E7=AA=97=E5=8F=A3=E5=B0=BA=E5=AF=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/windows/menu-main-window.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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); }