# Linux Display enumeration issues

**URL:** <https://forum.juce.com/t/linux-display-enumeration-issues/42550>\
**Category:** Linux\
**Created:** [November 3, 2020, 12:00pm UTC](https://forum.juce.com/t/linux-display-enumeration-issues/42550 "2020-11-03T12:00:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![op414](https://avatars.discourse-cdn.com/v4/letter/o/76d3ee/32.png) [@op414](https://forum.juce.com/u/op414)\
**Post date:** [November 3, 2020, 12:00pm UTC](https://forum.juce.com/t/linux-display-enumeration-issues/42550/1 "2020-11-03T12:00:19Z")

</div>

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](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)`.

---

<div class="post-metadata">

**Author:** ![op414](https://avatars.discourse-cdn.com/v4/letter/o/76d3ee/32.png) [@op414](https://forum.juce.com/u/op414)\
**Post date:** [November 3, 2020, 3:16pm UTC](https://forum.juce.com/t/linux-display-enumeration-issues/42550/3 "2020-11-03T15:16:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ed95](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ed95/32/7635_2.png) [@ed95](https://forum.juce.com/u/ed95)\
**Post date:** [November 3, 2020, 3:49pm UTC](https://forum.juce.com/t/linux-display-enumeration-issues/42550/4 "2020-11-03T15:49:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![op414](https://avatars.discourse-cdn.com/v4/letter/o/76d3ee/32.png) [@op414](https://forum.juce.com/u/op414)\
**Post date:** [November 3, 2020, 4:21pm UTC](https://forum.juce.com/t/linux-display-enumeration-issues/42550/5 "2020-11-03T16:21:49Z")

</div>

Here is a fix: [https://github.com/juce-framework/JUCE/pull/797/files](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.

---

<div class="post-metadata">

**Author:** ![ed95](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ed95/32/7635_2.png) [@ed95](https://forum.juce.com/u/ed95)\
**Post date:** [November 3, 2020, 5:38pm UTC](https://forum.juce.com/t/linux-display-enumeration-issues/42550/6 "2020-11-03T17:38:20Z")

</div>

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

> <https://github.com/juce-framework/JUCE/commit/09ecc0ebefc22ac6e23e6d98d76ac483c1908076>
