r/linuxaudio • u/fvcktankies • 7d ago
If your JUCE plugins open all dialogs and menus on a different screen on Plasma, I have a solution for you
The thing is, the JUCE framework is quite particular about determining what's an usable screen space. Or maybe that's a kwin / wayland problem. Anyway, if you happen to use fractional scaling on your monitors, your scaled numbers won't end up even, and in such case Plasma rounds the difference by offsetting the resolution to the next full pixel. That offset causes JUCE to ignore your second display, because the screen edges technically are not touching. At least that's what I think is happening.
To fix this, you first need to determine if this is really the root cause. If you type:
xrandr --listmonitors
you'll see your monitors and their resolutions. If you notice that the second monitor's horizontal resolution has an additional pixel (for example, "2561" instead of "2560"), we have a culprit. Take note of the connector name (for example, HDMI-1 or DP-2).
Next:
- right click on your desktop and open the display settings
- click on your second monitor icon AND HOLD to see the screen positioning. It shows in the top left corner as "n, 0" - take note of that number.
Now that you have the number, all you need to do is subtract 1 from it and run the following command:
kscreen-doctor output.*[your connector].position.[n -1]*,0 - of course, without brackets.
That's it. Now your JUCE plugin's dialogs and dropdowns won't be appearing on the other screen.
You can also add that command to your DAW desktop file, so kscreen-doctor runs each time you launch it, in case Plasma resets the screen settings. The easiest way to do that is to usekmenuedit:
- paste
kscreen-doctorin the "Program" field - paste
output.[your connector].position.[n -1],0 '&&' [your DAW command] %Fto "command-line arguments" field.
Hope someone finds this helpful. It's one of these little things that get really infuriating over time.