You are not logged in.

#1 2015-12-18 09:05:33

JJK
Member
Registered: 2013-10-24
Posts: 56

[SOLVED] Problem with java swing applications in awesome-wm

edit:
For any future visitors who experience this problem, using java 8 solved it for me.

Hey fellow Archers,

I'm starting some java development and I ran into a problem with applications using a swing gui in awesome wm.
the applications are not rendered correctly (see screenshot).

I found that this problem is probably related to the fact that awesome wm is a non-reparenting window manager and that java/swing does not handle that well.

I start awesome using gdm. Gdm starts the xsession file which calls a script that contains the following:
export _JAVA_AWT_WM_NONREPARENTING=1
wmname LG3D
awesome

The first two lines are supposed to fix this problem, but it doesn't help. The last line obviously starts awesome wm.

Do you have any ideas how I can fix/workaround this?

JJK

screenshot:
oyFgp8Q.png

Last edited by JJK (2015-12-30 09:05:52)

Offline

#2 2015-12-22 21:48:26

shinguiringuidum
Member
Registered: 2015-12-22
Posts: 1

Re: [SOLVED] Problem with java swing applications in awesome-wm

I also got this problem with some Java Applications and none (I've tried all of them) of the solutions described in https://awesome.naquadah.org/wiki/Problems_with_Java actually solved my problem...

That's the software I'm using:

awesome v3.5.6 (For Those About To Rock)
• Build: May  5 2015 05:45:29 for x86_64 by gcc version 5.1.0 (builduser@)
• Compiled against Lua 5.3.0 (running with Lua 5.3)
• D-Bus support: ✔

java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

Spring Tool Suite 3.7.2

This is the splash screen. STS runs fine until...
UkrXMuk.png

The main window loads. It seems like everything is fine, but 1 second (I've counted it) later...
rnNxcqD.png

This happens. Notice how the main menu is grayed out. It is still functional and, when clicked, the only *clicked* menu appears. It's a shame I haven't got a screenshot for that.
dpi8ZT8.png

Also, this is a settings panel. I can click on any option but this screen won't change. All I can do is click OK or CANCEL.
3Eu8kCe.png

full album here:
http://imgur.com/a/S6jfc

So, along with the solutions described in the first link of this post, I've found and tested the following script (which did not work as well):

#!/bin/bash

# Fix X window manager name properties to work around java bugs with
# non-reparenting window managers.  This is a different solution from
# the wmname utility provided by suckless, as it is NetWM compatible,
# while wmname sets the value of _NET_SUPPORTING_WM_CHECK to root win.

IRONIC_WM_NAME="LG3D"
NET_WIN=$(xprop -root _NET_SUPPORTING_WM_CHECK | awk -F "# " '{print $2}')
_JAVA_AWT_WM_NONREPARENTING=1
export _JAVA_AWT_WM_NONREPARENTING

if [[ "$NET_WIN" == 0x* ]]; then
    # xprop cannot reliably set UTF8_STRING, so we replace as string.
    # fortunately, jdk is OK with this, but wm-spec says use UTF8_STRING.
    xprop -id "$NET_WIN" -remove _NET_WM_NAME
    xprop -id "$NET_WIN" -f _NET_WM_NAME 8s -set _NET_WM_NAME "$IRONIC_WM_NAME"
else
    # even if we're not net compatible, do java workaround
    xprop -root -remove _NET_WM_NAME
    xprop -root -f _NET_WM_NAME 8s -set _NET_WM_NAME "$IRONIC_WM_NAME"
fi

wmname "$IRONIC_WM_NAME"

STS

I've also tested the script above with Sawfish instead of LG3D but that won't work as well...

I really don't know what to do as I've search all over my brain for key words correlated to this problem but no solution showed up in my google results.

One of the things I haven't tried yet was to test Awesome 3.4, what would make me rewrite all my scripts but at least my wokspace would work. I guess Awesome 3.4, Gnome and KDE are strong work arounds to this problem, but this would really annoy me as I'm running away from this technologies...

Community, we're counting on you!

http://pastebin.com/NtA54uBA

Offline

#3 2015-12-27 07:30:38

JJK
Member
Registered: 2013-10-24
Posts: 56

Re: [SOLVED] Problem with java swing applications in awesome-wm

i'm on java 7 and also on the latest awesome version

Offline

#4 2015-12-27 17:19:28

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,511

Re: [SOLVED] Problem with java swing applications in awesome-wm

Try upgrading to java 8.
You might need a & after wmname LG3D.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#5 2015-12-30 09:02:34

JJK
Member
Registered: 2013-10-24
Posts: 56

Re: [SOLVED] Problem with java swing applications in awesome-wm

running my program with java 8 makes it behave as expected, too bad i need java 7 for my project. I will mark this thread as solved.

Offline

#6 2016-01-01 06:28:14

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,511

Re: [SOLVED] Problem with java swing applications in awesome-wm

You can use archlinux java switcher when you need to switch back and forth and still have both 7 & 8 installed (sounds like windows doesn't it?)


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

Board footer

Powered by FluxBB