Summary
Since !8559, both GPU draw contexts present through DirectComposition, and both
fail to attach when there is no DComp device:
gdk_win32_gl_context_surface_attach():OpenGL requires Direct Compositiongdk_win32_vulkan_context_surface_attach():Vulkan requires Direct Composition
Since !9593 (914cb8dc), DComp is only created with GDK_DEBUG=dcomp. As a
result, a default GTK 4.24 setup on Windows always renders with Cairo, even when
GL itself works (gdk_display_prepare_gl() succeeds).
Impact: every frame is composited on the CPU. Our app (the Ghostty terminal)
hands GTK a new GdkMemoryTexture every frame. While it animates continuously,
the main thread keeps one CPU core at 100% in GskCairoRenderer.
Current behavior
Not using Vulkan: GdkWin32Display prefers OpenGL
Failed to realize renderer 'GskGLRenderer' for surface 'GdkWin32Toplevel': OpenGL requires Direct Composition
Not using Vulkan as fallback: Vulkan support disabled via GDK_DISABLE
Failed to realize renderer 'GskGLRenderer' for surface 'GdkWin32Toplevel': OpenGL requires Direct Composition
Using renderer 'GskCairoRenderer' for surface 'GdkWin32Toplevel'
There is no Not using GL line, so GL initialization succeeded; only the
surface attach failed. Without GSK_DEBUG, nothing is logged.
After manually enabling DComp, I tested both the Vulkan and GL renderers. The Vulkan renderer displays correctly, whereas the GL renderer shows black borders.
Expected outcome
A DComp device is created by default, as both the GL and Vulkan renderers rely on DComp.
When there is no DComp device, GSK skips them (GL is currently realized twice and fails both times), and the Cairo-only default on Windows is documented.
Version information
- GTK 4.24.1, MSYS2 CLANG64
mingw-w64-clang-x86_64-gtk44.24.1-1. - Windows: 11
- GPU: NVIDIA GeForce RTX 5080 Laptop GPU