diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-09-04 13:01:08 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-09-08 08:02:16 +0200 |
commit | d9d18596e2b242c43e64281e6a13396d329f686d (patch) | |
tree | 18c9458e08a429ebaf9b0723f61181cdcee16c1c /src/plugins | |
parent | e18cb8b535e742ef764353510867410316fffa6b (diff) |
Windows QPA: Enable toggling Windows transparency
Change QWindowsWindow::format() to return the QWindow's requested
format instead of storing it as do the other platforms. This will
cause the alpha (layered flag) to be adapted in
QWindowsBackingStore::flush(). Note that it does not fix
the issue; the window does not update correctly after
changing WS_EX_LAYERED.
Pick-to: 5.15
Task-number: QTBUG-60822
Change-Id: I3facd93f993b3b422b6818d55c1bce884fb57234
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 8 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.h | 3 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index a7cc36951a..5987324ac1 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1356,8 +1356,7 @@ bool QWindowsWindow::m_borderInFullScreenDefault = false; QWindowsWindow::QWindowsWindow(QWindow *aWindow, const QWindowsWindowData &data) : QWindowsBaseWindow(aWindow), m_data(data), - m_cursor(new CursorHandle), - m_format(aWindow->requestedFormat()) + m_cursor(new CursorHandle) #if QT_CONFIG(vulkan) , m_vkSurface(VK_NULL_HANDLE) #endif @@ -1431,6 +1430,11 @@ void QWindowsWindow::initialize() } } +QSurfaceFormat QWindowsWindow::format() const +{ + return window()->requestedFormat(); +} + void QWindowsWindow::fireExpose(const QRegion ®ion, bool force) { if (region.isEmpty() && !force) diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index beed3e17df..827e4cc288 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -249,7 +249,7 @@ public: using QPlatformWindow::screenForGeometry; - QSurfaceFormat format() const override { return m_format; } + QSurfaceFormat format() const override; void setGeometry(const QRect &rect) override; QRect geometry() const override { return m_data.geometry; } QRect normalGeometry() const override; @@ -402,7 +402,6 @@ private: QWindowsOleDropTarget *m_dropTarget = nullptr; unsigned m_savedStyle = 0; QRect m_savedFrameGeometry; - const QSurfaceFormat m_format; HICON m_iconSmall = nullptr; HICON m_iconBig = nullptr; void *m_surface = nullptr; |