I’ve been implementing my synth instrument SynthMatrix plugin with JUCE8. I develop under linux and GitHub-Actions do the windows builds for me.
I have a problem that the plugin does not draw anything, either as standalone or VST3. I run my FL Studio using Bottles which works fine, and all my bought plugins including FL Studio are Windows binaries. So I need to get the rendering working to be able to distribut windows binaries for Linux users like me.
I don’t need Windows WINE for anything other than FL STudio and for few games I play.
The UI Window opens up but is blank or white. The controls however seem to be working, like the keyboard playing sounds with the mouse or opening dialogs from the UI, like “Rename Patch”. Dialogs pop up fine but the main UI stays blanck.
If this is a duplicate thread please direct me to a correct spot. I don’t want to spam duplicates, seriously.
I’ll post later what I have been trying to resolve this problem.
But we have been trying to force GDI-rendering bypassing everything Direct2D and OpenGL dependent.
My reasoning for Windows-binaries is that my FL Studio is available only for Windows and so are all my plugins I’ve bought so far. My de facto DAW is FL Studio. The windows binaries work on native Windows OS but I need to provide other Linux users a way to use the plugin as well for them and for myself.
Any success or ideas making JUCE8 plugins work under Wine/Linux?
Thank you very much!
A demo
version (standalone binary) is available on my Google Drive, linux and windows standalone. I’ve not been able to check the Linux release on other Linux systems so I have no idea if your system might be missing any dependencies.
Also all feedback is welcome.
Here’s a brief list what we have been trying. It might be slightly incomplete but you see the workarounds we have been testing.
Here is a summary of what we investigated, diagnosed, and tested regarding the JUCE 8 rendering issue under Wine (Wine-Proton / Bottles):
1. The Symptoms
- Standalone: Window opens and remains completely blank / white. Mouse interactions work invisibly (e.g. clicking keys on the virtual keyboard plays notes, and modal popups like
AlertWindow (“Rename Patch”) render perfectly with dark theme).
- VST3 (FL Studio under Wine): Host loads the plugin, audio processing works, controls respond, but plugin editor either fails to open (“Something went wrong loading the plugin SynthMatrix”) or opens as a blank/unpainted window.
2. Direct2D 1.3 / DXGI / DXVK Incompatibility
- Finding: JUCE 8 defaults to Direct2D with hardware acceleration on Windows, utilizing Direct2D feature level 1.3 (
ID2D1DeviceContext2, ID2D1Factory3, DXGI swapchains, and VBlankDispatcher).
- Wine’s built-in Direct2D implementation currently supports up to Direct2D 1.2.
- In JUCE’s
VBlankDispatcher_windows.cpp, querying DXGI outputs and monitors triggered unhandled access violations (0xc0000005 in dxgi.dll), crashing hosts or aborting window creation.
- Workaround tested:
- Forcing
GDIRenderContext by overriding Component::createNewPeer to engine 0.
- Disabling
VBlankDispatcher display reconfigurations (reconfigureDisplays(), updateDisplay()).
- Replacing Direct2D descriptor in
contextDescriptorList with GDIRenderContext.
3. JUCE 8 Software Renderer (GDIRenderContext) on Wine
Even when forcing the software GDI renderer, two critical issues were uncovered:
-
Repaints tied strictly to VBlank:
- In JUCE 8,
repaint() calls no longer call InvalidateRect() directly. Instead, they queue into deferredRepaints, which are only flushed in onVBlank().
- Without DXGI VBlank callbacks firing under Wine,
deferredRepaints never flushed to the Win32 message queue.
- Workaround tested: Implemented a 60 Hz fallback timer in
HWNDComponentPeer calling onVBlank (timestamp) to regularly flush deferredRepaints.
-
StretchDIBits vs BitBlt in Wine’s X11 GDI driver:
- JUCE 8.0.15 uses
WindowsBitmapImage::blitToDC (HDC dc, int x, int y) which calls StretchDIBits with a 32-bit BITMAPV4HEADER (top-down DIB).
- In Wine’s X11 driver, this specific
StretchDIBits configuration frequently fails silently, preventing the offscreen memory bitmap from blitting to the window DC. (By contrast, layered windows like AlertWindow used UpdateLayeredWindow with the memory DC, which is why they rendered fine).
- Workaround tested: Patched
blitToDC to call Win32 BitBlt directly from the WindowsBitmapImage DIBSection memory HDC (BitBlt (dc, x, y, width, height, hdc, 0, 0, SRCCOPY)), falling back to StretchDIBits.
4. DirectWrite Font Fallback Crash in Wine’s dwrite.dll
-
Tracing with WINEDEBUG=+dwrite,+seh pinpointed the root cause of the white window / host crash:
text
056c:trace:dwrite:dwritefont3_HasCharacter 00007E3A9754D8E0, 0x43. (‘C’)
056c:trace:dwrite:dwritefont3_HasCharacter 00007E3A9754D8E0, 0x50. (‘P’)
056c:trace:dwrite:dwritefont3_HasCharacter 00007E3A9754D8E0, 0x55. (‘U’)
056c:trace:dwrite:dwritefont3_HasCharacter 00007E3A9754D8E0, 0x20. (’ ')
056c:trace:dwrite:dwritefont3_HasCharacter 00007E3A9754D8E0, 0x30. (‘0’)
056c:trace:dwrite:dwritefont3_HasCharacter 00007E3A9754D8E0, 0x2e. (‘.’)
056c:trace:dwrite:dwritefont3_HasCharacter 00007E3A9754D8E0, 0x30. (‘0’)
056c:trace:seh:dispatch_exception code=c0000005 (EXCEPTION_ACCESS_VIOLATION) addr=00006FFFF7A2B0F7
056c:err:seh:user_callback_handler ignoring exception c0000005
-
Mechanism:
- During UI initialization (e.g. measuring a label containing
"CPU 0.0%"), JUCE calls Font::findMinimumFontWithFallback().
- On Windows,
juce_DirectWriteTypeface_windows.cpp implements Typeface::createSystemFallback() via IDWriteFactory2::GetSystemFontFallback and IDWriteFontFallback::MapCharacters.
- In Wine’s implementation of
dwrite.dll, fallback_font_get_supported_length contains a bug that dereferences a null pointer (movzwl (%rcx), %eax where rcx = NULL), immediately throwing an Access Violation (0xc0000005).
- Effect:
- In standalone mode, Wine’s window callback handler catches the exception via SEH and aborts the paint handler, leaving the window entirely white.
- In DAWs (like FL Studio), the host catches this unhandled exception during plugin editor creation and aborts loading the plugin.
- Workaround tested: Patched
createSystemFallback() in juce_DirectWriteTypeface_windows.cpp to immediately return {} under Wine (preventing any call into MapCharacters), allowing standard font rendering to proceed safely.
The entire JUCE / Wine topic has been discussed over here in depth already Juce8 Direct2D WINE/yabridge.
I didn’t go through all the details of your second post, but are you berfore or behind this JUCE8 commit? Restore Wine functionality · juce-framework/JUCE@5179690 · GitHub
We managed to solve the problem. Previously the plugin window rendered empty but controls worked even hidden. I’ll post details about the workaround later.
But now my plugin is working under Bottless in FL Studio as Windows-binary. Standalone works as well.
Here are the steps and workarounds we used to get the GDI-drawing working. Now the full UI is visible in the plugin.
Solving Blank / White Screen Issues with GDI Software Rendering in JUCE 8 (Wine, VMs & Headless Windows)
Context & Problem
With JUCE 8, the default Windows rendering engine transitioned to Direct2D (D2DRenderContext). While Direct2D works great on standard modern Windows desktop installations, it frequently fails in Wine/Proton, virtual machines, remote desktops, and older GPU environments, resulting in either crashes or the infamous blank white/black window (“white screen”).
However, simply trying to fall back to the GDI engine (HWNDComponentPeer engine 0 / GDIRenderContext) in JUCE 8 does not work out of the box. There are several subtle architectural blockers in JUCE 8’s Windows windowing code that prevent GDI from rendering properly.
Below are the 5 critical steps that completely resolved this and made GDI software rendering 100% stable:
1. Completely Decouple Direct2D and DXGI Context Descriptors
-
File: juce_gui_basics/native/juce_Windowing_windows.cpp
-
Issue: Even if juce_isRunningInWine() selects renderer 0, JUCE still declares:
contextDescriptorList<GDIRenderContext, D2DRenderContext>
This causes JUCE to initialize Direct3D/DXGI adapters and interfaces in the background, which can crash or fail before GDI even gets a chance to run.
-
Fix:
-
Enforce const auto renderer = 0; (GDI).
-
Map both context descriptor slots to GDI:
contextDescriptorList<GDIRenderContext, GDIRenderContext>
This completely prevents any background DXGI/D2D initialization.
2. Bypass VBlankDispatcher with a 60 Hz Fallback Timer (The Most Critical Fix!)
-
Files: juce_gui_basics/native/juce_Windowing_windows.cpp and juce_VBlank_windows.cpp
-
Issue: In JUCE 8, component repainting and onVBlank() notifications are tightly coupled to DXGI’s IDXGIOutput via VBlankDispatcher. In environments where DXGI is disabled or non-functional:
VBlankDispatcher queries fail or hang.
onVBlank() is never invoked!
- Because
onVBlank() never fires, dirty regions flagged by repaint() are never flushed or presented to the window DC. The window stays permanently blank.
-
Fix:
-
Disable DXGI queries in juce_VBlank_windows.cpp by making updateDisplay() and reconfigureDisplays() early-return.
-
In HWNDComponentPeer, add an explicit 60 Hz message timer to pump onVBlank():
std::optional<TimedCallback> vblankFallbackTimer;
// When setting the rendering engine:
vblankFallbackTimer.emplace ([this] {
onVBlank (Time::getMillisecondCounterHiRes() * 0.001);
});
vblankFallbackTimer->startTimerHz (60);
This guarantees that UI repaints tick at a steady 60 FPS via the message queue regardless of GPU/DXGI availability.
3. Robust GDI Blitting: BitBlt vs StretchDIBits and GdiFlush
- File:
juce_gui_basics/native/juce_Windowing_windows.cpp (blitToDC)
- Issue: JUCE’s default GDI presentation relies on
StretchDIBits straight from raw bitmap memory. In Wine and virtual display drivers, this can encounter DC mapping discrepancies or race conditions where memory sections aren’t synchronized.
- Fix:
-
Explicitly set the mapping mode to MM_TEXT.
-
Call GdiFlush() prior to presentation to ensure pending GDI drawing commands are committed.
-
Prefer hardware/driver-accelerated DC-to-DC BitBlt from the offscreen memory DC (hdc), falling back to StretchDIBits only if BitBlt fails:
void blitToDC (HDC dc, int x, int y) const noexcept
{
SetMapMode (dc, MM_TEXT);
GdiFlush();
if (! BitBlt (dc, x, y, width, height, hdc, 0, 0, SRCCOPY))
{
StretchDIBits (dc, x, y, width, height, 0, 0, width, height,
bitmapData, (const BITMAPINFO*) &bitmapInfo,
DIB_RGB_COLORS, SRCCOPY);
}
}
4. Force First Paint on Show (handleShowWindow)
-
File: juce_gui_basics/native/juce_Windowing_windows.cpp
-
Issue: When a window receives WM_SHOWWINDOW, JUCE’s default implementation has an empty body:
void handleShowWindow() override {}
In software/GDI mode, the window background is painted, but component contents often fail to invalidate and paint until the user moves the mouse over the window or triggers a resize.
-
Fix:
5. Guard DirectWrite Font Fallback
- File:
juce_graphics/native/juce_DirectWriteTypeface_windows.cpp
- Issue: Under Wine, when rendering text, JUCE queries
IDWriteFactory2 for system font fallback substitution. On some Wine builds, this query returns an error or crashes if the DirectWrite implementation lacks IDWriteFactory2.
- Fix:
- Safely bypass the
IDWriteFactory2 fallback query, allowing JUCE to use standard GDI/FreeType font rendering.
Summary (TL;DR)
If your JUCE 8 plugin or standalone app shows a white or blank screen when falling back to GDI (especially in Wine, Bottles, or virtualized environments):
- The biggest culprit is
VBlankDispatcher: Without DXGI, onVBlank() never ticks. Add a 60 Hz fallback timer to drive onVBlank().
- Prevent D2D descriptor initialization: Replace
D2DRenderContext in the descriptor list with GDIRenderContext.
- Use
BitBlt and GdiFlush in blitToDC.
- Call
peer.getComponent().repaint() in handleShowWindow().
How about joining the conversation e.g. by commenting if your findings apply to a JUCE 8 version before or after the mentioned commit, what exact commit you are on or if your findings differ from the ones already discussed in the linked thread instead of just copy&pasting what looks like straight AI output here?
4 Likes
There’s no “looks like” here, you’re being too kind. Straight up clanker output, forum rules be damned.
1 Like