From e5bdd36e27cd3a31afb74d7cf938a5b1d65b00df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=AD=90=E6=A5=9A=5Czhuzi?= Date: Tue, 28 Mar 2023 12:37:03 +0800 Subject: [PATCH] update --- src/FramelessView_win.cpp | 16 ++++++++++++---- src/controls/FluAppBar.qml | 2 -- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/FramelessView_win.cpp b/src/FramelessView_win.cpp index d1484cff..4fce8d9f 100644 --- a/src/FramelessView_win.cpp +++ b/src/FramelessView_win.cpp @@ -72,7 +72,7 @@ public: FramelessView::FramelessView(QWindow *parent) : Super(parent), d(new FramelessViewPrivate) { - setFlags( Qt::Window | Qt::FramelessWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint); + setFlag(Qt::FramelessWindowHint,true); setResizeMode(SizeRootObjectToView); setIsMax(windowState() == Qt::WindowMaximized); setIsFull(windowState() == Qt::WindowFullScreen); @@ -93,9 +93,6 @@ void FramelessView::showEvent(QShowEvent *e) static const MARGINS shadow_state[2] { { 0, 0, 0, 0 }, { 1, 1, 1, 1 } }; ::DwmExtendFrameIntoClientArea((HWND)(winId()), &shadow_state[true]); Super::showEvent(e); - if(d->m_isFirst){ - QTimer::singleShot(150,this,[=](){ setFlag(Qt::FramelessWindowHint,false); }); - } setFlag(Qt::FramelessWindowHint,false); } @@ -163,6 +160,8 @@ void FramelessView::setIsFull(bool isFull) emit isFullChanged(d->m_isFull); } +int count = 1; + void FramelessView::setTitleItem(QQuickItem *item) { d->m_titleItem = item; @@ -216,6 +215,15 @@ bool FramelessView::nativeEvent(const QByteArray &eventType, void *message, long } return true; } + }else if (msg->message == WM_WINDOWPOSCHANGING) + { + WINDOWPOS* wp = reinterpret_cast(msg->lParam); + if (wp != nullptr && (wp->flags & SWP_NOSIZE) == 0) + { + wp->flags |= SWP_NOCOPYBITS; + *result = 0; + return true; + } } return Super::nativeEvent(eventType, message, result); } diff --git a/src/controls/FluAppBar.qml b/src/controls/FluAppBar.qml index 843b1388..defb2b9d 100644 --- a/src/controls/FluAppBar.qml +++ b/src/controls/FluAppBar.qml @@ -29,8 +29,6 @@ Rectangle{ return parent.width } z: 65535 - clip: true - TapHandler { onTapped: if (tapCount === 2) toggleMaximized()