When the window is already mapped, we will use the same code and when it isn’t, we will call XChangeProperty. If KDE4 only promotes windows on top of its stack, the KDE team will have to fix it.
I have tried to use the same bug fix than in NEWT but in AWT and unfortunately, it does not work. I will have to investigate a bit deeper to fix this bug.
There are some problems of bad use of XSync and the window handles might be obtained by the wrong way. NEWT uses the screen identifier and only a very little bit XQueryTree whereas AWT uses only XQueryTree in a loop to get the root window. Best regards.