Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
None
-
6.7.1
-
Visual Studio 2022. Windows 10 (x64) 22H2.
Description
I'm experiencing flickering problems when adding semi-transparent "foreign" native Win32 windows to a Qt application using QWindow::fromWinId and QWidget::createWindowContainer.
The problem seem to be caused by Qt being unable to set the WS_EX_COMPOSITED window style required to enable double-buffering when drawing. I've been unable to achieve this through Qt. Still, I've been able to work around the problem by manually setting SetWindowLongW(wnd, GWL_EXSTYLE, GetWindowLongW(wnd, GWL_EXSTYLE) | WS_EX_COMPOSITED) on the parent Qt window, but this feels like a hack that leads to other drawing artifacts.
Steps to reproduce:
- Clone https://github.com/forderud/QtNativeWindow
- Open solution with Visual Studio.
- Stop defining AVOID_FLICKERING_WITH_COMPOSITED_WINDOW to deactivate the work-around.
- Build solution and start QtNativeWindow.
- Observe that the green and blue circles flicker when the main window is resized.
See Screen Recording 2024-08-14 160433.mp4 for a video with composition disabled.