Crash when closing some dialogs or pop-ups

I'm experiencing "crashes" (application actually calls exit) when closing some dialogs and combo-box menus under Linux.

It only seems to happen on plugins, so my guess is that it's something related to juce usage of separate threads for UI stuff.
Maybe a lock missing somewhere.

The error is:

X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  12 (X_ConfigureWindow)
  Serial number of failed request:  2540
  Current serial number in output stream:  2542


Has anyone noticed this too?


I got some free time and was able to find the culprit for this.
It happens when there's temporary windows (caused by some menu popup or tooltip) inside a modal window.
juce is calling XRestackWindows to organize the window stacking order, but that call is not valid for temporary windows.

Fix here:


Can we get some linux love please?

With this issue resolved and the one I reported (and fixed) before:

plugins on Linux will work better.




Sorry that we didn't reply to this one faster. Fabian is our "linux love" guy, and as far as I remember he was working on that issue (or something related). But he's away on holidays this week, and the rest of us don't really have a clue what's going on. Do you mind waiting until next week when he's back?

bump again. :)

If this won't make it into juce for some reason please let me know why and I'll try to find another way to fix the issue.

Thanks for reporting and your fix. This is now on the latest tip.

Sorry for taking so long to merge this in.

Cool, glad to see the fix is finally in.

There's 2 minor things you forgot though.

Here's the rest of the patch:

diff --git a/modules/juce_gui_basics/native/juce_linux_Windowing.cpp b/modules/juce_gui_basics/native/juce_linux_Windowing.cpp
index 4aa7b1e..7d147cb 100644
--- a/modules/juce_gui_basics/native/juce_linux_Windowing.cpp
+++ b/modules/juce_gui_basics/native/juce_linux_Windowing.cpp
@@ -2189,8 +2189,9 @@ class LinuxComponentPeer  : public ComponentPeer
         Atom netHints [2];
-        if ((styleFlags & windowIsTemporary) != 0
-             || ((styleFlags & windowHasDropShadow) == 0 && Desktop::canUseSemiTransparentWindows()))
+        if (styleFlags & windowIsTemporary)
+            netHints [0] = Atoms::getIfExists ("_NET_WM_WINDOW_TYPE_TOOLTIP");
+        else if ((styleFlags & windowHasDropShadow) == 0 && Desktop::canUseSemiTransparentWindows())
             netHints [0] = Atoms::getIfExists ("_NET_WM_WINDOW_TYPE_COMBO");
             netHints [0] = Atoms::getIfExists ("_NET_WM_WINDOW_TYPE_NORMAL");
diff --git a/modules/juce_gui_basics/widgets/juce_Slider.cpp b/modules/juce_gui_basics/widgets/juce_Slider.cpp
index 0d4f0da..fba1ef7 100644
--- a/modules/juce_gui_basics/widgets/juce_Slider.cpp
+++ b/modules/juce_gui_basics/widgets/juce_Slider.cpp
@@ -860,7 +860,7 @@ class Slider::Pimpl   : public AsyncUpdater,
                     if (parentForPopupDisplay != nullptr)
                         parentForPopupDisplay->addChildComponent (popup);
-                        popup->addToDesktop (0);
+                        popup->addToDesktop (ComponentPeer::windowIsTemporary);
                     popup->setVisible (true);


Hi falkTX,

I think you may be confusing forum threads. This forum thread is about the X11 crash. I did use your complete patch for that crash.

I did see all of the patch to which you refer above which seems to be a fix for the alwaysOnTop bug. However I did not use any of it as the fix doesn't work for me on Ubuntu 14.04 LTS and breaks numerous other Linux tests. I decided to go with a different approach (remove the "XRaiseWIndow" call).

Please let me know if I am confusing something here.

Also let me know if there are any other bugs that my fix does not address regarding linux windowing. 


Sorry, I just mentioned those changes because the other thread didn't get any attention.

The new stuff I just posted is to fix the window creation of some pop-up menus.
It's hard to see on regular desktops, but on tiling WMs it's very annoying (the popup will be in a separate window far away from where you clicked).

Do you need me to make a screenshot?

It would be useful to know which tiling window manager is causing problems, just so that I can reproduce this. I’ve tested this with Xmonad and everything seems to work there. However, I’m not really all to familiar with tiling window manages, so I might not notice incorrect behaviour.

The quickest way to see this is with a slider that has a popup for its value.
I think it also happens on sub-menus, but I'm not 100% sure.

I looked into the JuceDemo but the sliders there don't show a popup.

I'll see if I can get a screenshot of a plugin I have here...