-
Notifications
You must be signed in to change notification settings - Fork 56
FabFilter VST windows don't resize correctly on initial open on non-100% DPI #107
Comments
I cannot reproduce this in "any audio plugin". I spent a lot of time recently familiarising myself with how Qt and VSTs resize
Your log explicitly mentions VST plugins "FabFilter Pro-C 2" and "FabFilter Pro-Q 3" - I've updated the ticket description & title to match. I have downloaded both and I will test this later. |
Additionally, what DPI is your monitor set to? |
Yeah. That seems to be where the problem is at. |
I feared that would be the case. 26 is around the time we properly started reporting to the operating system that OBS handles DPI correctly, but it seems VSTs don't and the window size calculation doesn't take that into consideration. I believe we handle this somewhere else too.. maybe in the browser code? I will have to do some digging. |
Right, so firstly I can confirm OBS + High DPI + VSTs don't work well together. Secondly, I'm having trouble fixing this. This documentation provides an example that should work perfectly with our code, however it results in Qt not correctly repositioning the resulting window (that is - it doesn't sit within the container, just gets locked at 0,0). The code change I made: diff --git a/win/EditorWidget-win.cpp b/win/EditorWidget-win.cpp
index e3f05e3..3bb09d6 100644
--- a/win/EditorWidget-win.cpp
+++ b/win/EditorWidget-win.cpp
@@ -28,8 +28,10 @@ void EditorWidget::buildEffectContainer(AEffect *effect)
RegisterClassExW(&wcex);
const auto style = WS_CAPTION | WS_THICKFRAME | WS_OVERLAPPEDWINDOW;
+ DPI_AWARENESS_CONTEXT previousDpi = SetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_UNAWARE);
windowHandle =
CreateWindowW(wcex.lpszClassName, TEXT(""), style, 0, 0, 0, 0, nullptr, nullptr, nullptr, nullptr);
+ SetThreadDpiAwarenessContext(previousDpi);
// set pointer to vst effect for window long
LONG_PTR wndPtr = (LONG_PTR)effect; If I move the I have a feeling both of these are Qt bugs, but I'm not 100% sure. Additionally, with these changes there are certain VSTs that continue to behave incorrectly. If we get the above code working, I would be OK with providing a toggle in the VST properties allowing the user to disable VST DPI code if necessary. |
Operating System Info
Windows 10
Other OS
No response
OBS Studio Version
Other
OBS Studio Version (Other)
OBS 26 and above, including 27.2.0-rc1
OBS Studio Log URL
https://obsproject.com/logs/pmNFddnzLY3h8Jia
OBS Studio Crash Log URL
No response
Expected Behavior
Current Behavior
Steps to Reproduce
Anything else we should know?
No response
The text was updated successfully, but these errors were encountered: