Linux Display enumeration issues

Hi,

I’m developing an embedded product on Linux which includes a Juce GUI application. It’s running on a Debian Buster system with the openbox window manager. I’m using JUCE 6.0.4. (5.4.7 behaves the same).

The GUI renders fine, but the mouse clicks are not registered in the correct locations. This issues seems to be JUCE related as xterm is not affected. Popup menus also don’t popup in the right place.

Here is a video showing the issue on the JUCE app : https://www.youtube.com/watch?v=h1o8AWhb19s

And finally a less important but even weirder issue. All fonts are rendered in bold on the machine I’m using, but when I boot the exact same OS on a different machine (slightly older CPU, but both are intel chips with integrated graphics), fonts render correctly. So I suspect that font rendering can be affected depending on which kernel modules are loaded…

EDIT:

A previous version of this post incorrectly said that the issue was only happening when connected over VNC without a physical display plugged in. I can now confirm that the issue happens regardless.

The issue seems to be caused by malfunctioning displays detection code. The Display::totalArea.y value is completely out of reasonable bounds, and changes on every app launch. I have values like 1969287184, -1271865328, etc… But Display::topLeftPhysical is correctly (0, 0).

1 Like

I’ve pinpointed the issue to a use-after-free bug in the getWorkAreaPropertyData() lambda.
The issue only affect users that do not have xrandr or xinerama installed, which I suppose is quite rare with modern distributions.

I will submit a pull request soon.

Yep, that code looks pretty suspect - good catch! We’ll push a fix shortly.

Here is a fix: https://github.com/juce-framework/JUCE/pull/797/files

I have checked the other use of the GetXProperty class and this seem to be the only place where this happens.

Thanks, we’ve pushed a fix to develop here: