From e9ba7b7660e1391f9077b81aa73c60ea3d61bdcb Mon Sep 17 00:00:00 2001 From: Wladimir Leuschner Date: Tue, 4 Jun 2024 12:53:53 +0200 Subject: [PATCH] QWindowsWindow: Use updated windowFlags for framelessWindow query MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently the internal flags of QWindow are not up-to-date when querying them during QWindowsWindow::setFlags with QWindow::flags(). QWindow updates its flags after QWindowsWindow returns from setFlags. This patch adds a getter, to query the updated internal state of Qt::FrameLessWindowHint flag from QWindowsWindow's m_data.flags. This is needed due to QWindowsWindow is calling SetWindowPos, which immediately enters the WndProc without access to the newly set flags. Pick-to: 6.7 Change-Id: I826f29ef608d1e0a4b416e123aa4116587a035a7 Reviewed-by: Oliver Wolff Reviewed-by: Tor Arne Vestbø (cherry picked from commit 0e6907d2f0e95a8892df55e075837cc0e81e0f3f) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/platforms/windows/qwindowswindow.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index 024711e7f35..b3cddc11d87 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -347,6 +347,8 @@ public: int savedDpi() const { return m_savedDpi; } qreal dpiRelativeScale(const UINT dpi) const; + bool isFrameless() const { return m_data.flags.testFlag(Qt::FramelessWindowHint); } + private: inline void show_sys() const; inline QWindowsWindowData setWindowFlags_sys(Qt::WindowFlags wt, unsigned flags = 0) const;