16

I recently installed Android Studio on arch linux with DWM. But the initial dialog window, which prompts for starting a new project is blank. The links in this windows work though. I can start a new project by blindly clicking where the new project button is supposed to be. There is no problem with the new project wizard, but the editor window which loads up is blank as well.

However, if I start the X server with android studio as the client, It works correctly. So it's an issue with DWM. What could be the reason?

Edit:

Intellij has the same problem with dwm.

5
  • 1
    wiki.archlinux.org/index.php/…
    – jasonwryan
    Commented Jun 14, 2017 at 18:10
  • Thanks, setting the variable works but I've run on another issue. I can't set the variable from .xinitrc. These are the last two lines of my .xinitrc: export _JAVA_AWT_WM_NONREPARENTING=1 exec $1. It works if I set the variable in shell startup file
    – saga
    Commented Jun 14, 2017 at 18:46
  • It should work in .xinitrc, but equally will work in your shell profile.
    – jasonwryan
    Commented Jun 14, 2017 at 19:06
  • yes it should, but it doesn't. That's the problem, I can't export variables from .xinitrc
    – saga
    Commented Jun 14, 2017 at 19:34
  • That is a separate issue. Just put it in your shell profile.
    – jasonwryan
    Commented Jun 14, 2017 at 19:42

3 Answers 3

22

You'll need to set the _JAVA_AWT_WM_NONREPARENTING variable to 1 through some way to Android Studio.

If you're starting dwm via startx, add this to your .xinitrc:

export _JAVA_AWT_WM_NONREPARENTING=1

If you're launching Android Studio from a shell, add the same line to your shell's rc file.

If you're launching Android Studio from a shortcut, and you're not using startx, then you'll have to add the variable to the WM after the process started.

2
  • Report from the future: the solution works also in ratpoison.
    – peterh
    Commented Aug 27, 2020 at 9:52
  • My session starts dwm from gdm3, which calls ~/.Xsession so there is where the export have to be in this case. Previously using startx and yes, ~/.xinitrc is the way. Or ~/.xsessionrc (Debian and derivatives specific) Commented Jan 8, 2022 at 7:31
3
echo export _JAVA_AWT_WM_NONREPARENTING=1 >> ~/.profile
0

I just got it working with _JAVA_AWT_WM_NONREPARENTING=1 and starting android-studio from command line.

android-studio also needs sudo to install components if your android-sdk install is in default from AUR (/opt/android-sdk) and if thats the case just start android-studio with:

sudo _JAVA_AWT_WM_NONREPARENTING=1 android-studio

Just added that as an alias in rofi and good to go :)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .