From d9d18596e2b242c43e64281e6a13396d329f686d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 4 Sep 2020 13:01:08 +0200 Subject: 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 --- src/plugins/platforms/windows/qwindowswindow.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp') 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) -- cgit v1.2.3