Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IntelliJ Idea show weird blank screen #595

Closed
jarias opened this issue Apr 22, 2016 · 30 comments
Closed

IntelliJ Idea show weird blank screen #595

jarias opened this issue Apr 22, 2016 · 30 comments

Comments

@jarias
Copy link

jarias commented Apr 22, 2016

Don't know if it apply's to other java apps but I test IntelliJ in weston and it doesn't work quite well but at least it shows the window content. Also the window should the attach screenshot should be a modal floating window but it appears to be trying to render it as a normal window.

OS: Linux lucy 4.5.1-1-ARCH #1 SMP PREEMPT Thu Apr 14 19:19:32 CEST 2016 x86_64 GNU/Linux

Sway Package version 0.5-2
WLC Package version 0.0.2-1
XWayland Package version 1.18.3-1

2016-04-22-090717_swaygrab

@ids1024
Copy link

ids1024 commented Apr 25, 2016

Other java programs, like the arduino ide, seem to be fairly broken in sway, though in different ways.

@ids1024
Copy link

ids1024 commented Apr 25, 2016

export _JAVA_AWT_WM_NONREPARENTING=1 seems to fix the problem.

@stwa
Copy link

stwa commented Apr 25, 2016

This is a known problem with non-re-parenting window managers:
https://awesome.naquadah.org/wiki/Problems_with_Java#Impersonate_Another_Window_Manager

wmname LG3D works for me.

@jarias
Copy link
Author

jarias commented Apr 25, 2016

@ids1024 @stwa thanks I'll try that as soon as I get home. I'm closing the issue since it looks like is a known Java issue.

@jarias jarias closed this as completed Apr 25, 2016
@ricejamesh
Copy link

I tried both _JAVA_AWT_WM_NONREPARENTING=1 and wmname LG3D with neither one working. Are there any further suggestions for fixing this?

@mkubasz
Copy link

mkubasz commented Jul 24, 2018

I have this issue too.

@emersion
Copy link
Member

Please check if this issue is still relevant with sway 1.0, investigate it and send a patch.

@mkubasz
Copy link

mkubasz commented Jul 24, 2018

Yeap, new version fixed this issue. Now I'll be waiting for android studio emulator fix patch. Thanks.

@ricejamesh
Copy link

ricejamesh commented Jul 24, 2018

2018.2 did not fix it for me. Bummer

@emersion
Copy link
Member

waiting for […] fix patch

Investigate! Ask for help on IRC! Send a patch!

2018.2 did not fix it for me. Bummer

Now idea what "2018.2" refers to.

@ricejamesh
Copy link

I am testing against webstorm and the latest release is 2018.2, as of 22 July 2018 (2 days ago). AFAIK, there are typically two methods of fixing this blank display issue, setting export _JAVA_AWT_WM_NONREPARENTING=1 and/or wmname LG3D. But generally, it is reported that some of the java based applications have display issues in linux while using RDP (xrdp to fedora in my case).

(I'm not here for sway but rather the blank screen while using RDP to a linux box.)

I am interested in knowing if there are any further solutions that may have emerged lately. I'm not finding anything out there other than the two listed solutions, or moving away from xrdp.

Thanks!

Jim

@roaddan
Copy link

roaddan commented Sep 30, 2018

I have the same issue.

I am using Microsoft remote desktop application (ver. 10.2.1) on Mac OS X Sierra to connect to my Linux box which is a Debian 9 i686.
My Debian box (Debian 4.9.110-3+deb9u4 (2018-08-21) i686 GNU/Linux) is running Xrdp over Xvnc. Everything else seems to be working well except for arduino 1.8.1...

Any idea ?

@ddevault
Copy link
Contributor

Investigate! Ask for help on IRC! Send a patch!

@ricejamesh
Copy link

@SirCmpwn What do you mean by, "Investigate! Ask for help on IRC! Send a patch!"? Is that an auto-reply? Cheers.

@emersion
Copy link
Member

No, it's not an automated reply, it's a legitimate call for help. We don't have time to investigate all issues here, so we call for help. We try to encourage contributions. Please try to debug this, please send patches!

@fabean
Copy link

fabean commented Oct 1, 2018

The fix of _JAVA_AWT_WM_NONREPARENTING=1 in my /etc/profile worked for me with PHPStorm.

@easbarba
Copy link

easbarba commented Oct 21, 2018

@ricejamesh ask @ sway on IRC and if possible send a patch!

@fabean Thanks, that works on Eclipse`s menu! So works too:

    if [ $(tty) = "/dev/tty1" ]; then
	_JAVA_AWT_WM_NONREPARENTING=1 window manager.
	sway
	exit 0
    fi```

@cedws
Copy link
Contributor

cedws commented Nov 2, 2018

Unfortunately still experiencing this issue on master as of Sway 1.0-beta.

@mguezuraga
Copy link

_JAVA_AWT_WM_NONREPARENTING=1 idea
This works for me. Sway 1.0

@EgbertW
Copy link

EgbertW commented Sep 30, 2019

I just switched to Sway from i3 and experienced the same issue. For me, setting _JAVA_AWT_WM_NONREPARENTING=1 also fixed it. Maybe Sway should set it by default? No clue what it does - is this something that needs to be fixed in Sway or in IntelliJ?

Anyway, thanks for the fix!

@easbarba
Copy link

easbarba commented Sep 30, 2019

@EgbertW
Copy link

EgbertW commented Sep 30, 2019

@lxbarbosa thanks for the link. Looking at the issue you're referring to is that it is resolved with the addition of the flag _JAVA_AWT_WM_NONREPARENTING. This suggests on that an action is needed on the other side: setting this variable to 1. Isn't this something Sway (and other non-reparenting WM's) should do? Although a more generic variable like XDG_WM_NON_REPARENTING flag would be preferable I suppose...

@realmorrisliu
Copy link

@lxbarbosa Thank you very much for the code!!! This worked for me!

if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
  _JAVA_AWT_WM_NONREPARENTING=1 sway
fi

gihyeonsung pushed a commit to gihyeonsung/dots that referenced this issue Aug 30, 2020
ForgottenUmbrella added a commit to ForgottenUmbrella/sway that referenced this issue Dec 1, 2020
Fixes issue swaywm#595 .
From what I understand, Java expects non-reparenting WMs to set this environmental variable in order for applications like IntelliJ Idea to work, since it has no way to detect this on its own.
@tukusejssirs
Copy link

Just a note for other users from Slovakia using D-Launcher app to signing documents with qualified electronic signiture (KEP). Just if someone wants to debug this and wants to install D-Launcher, they can using the following commands:

URL="https://www.ditec.sk/$(curl -s https://www.ditec.sk/produkty/informacie_pre_pouzivatelov_aplikacii_pre_kep | grep -Po '[.]{2}/\K[^"]+DLauncher.linux.x86_64.run')"
curl -sLo /tmp/d.launcher.run "$URL"
chmod a+x /tmp/d.launcher.run
/tmp/d.launcher.run  # Follow the GUI instructions
rm -rf /tmp/d.launcher.run
_JAVA_AWT_WM_NONREPARENTING=1 ~/.ditec/dlauncher-bin/dLauncher

Indeed, using _JAVA_AWT_WM_NONREPARENTING=1 before execution of D-Launcher works, but after closing the window, there keeps showing a small floating window with white background that cannot be moved or closed. I can close it only with Ctrl+Shift+Q or find and kill the process. Below you can find the relevant part from swaymsg -t get_tree, actually output of swaymsg -t get_tree | jq .nodes[].nodes[].floating_nodes[]

{
  "id": 29,
  "name": " ",
  "rect": {
    "x": 2842,
    "y": 527,
    "width": 75,
    "height": 50
  },
  "focused": false,
  "focus": [],
  "border": "csd",
  "current_border_width": 2,
  "layout": "none",
  "orientation": "none",
  "percent": 0.0018513033175355448,
  "window_rect": {
    "x": 0,
    "y": 0,
    "width": 75,
    "height": 50
  },
  "deco_rect": {
    "x": 0,
    "y": 0,
    "width": 0,
    "height": 0
  },
  "geometry": {
    "x": 0,
    "y": 0,
    "width": 1,
    "height": 1
  },
  "window": 48234567,
  "urgent": false,
  "floating_nodes": [],
  "sticky": false,
  "type": "floating_con",
  "fullscreen_mode": 0,
  "pid": 187454,
  "app_id": null,
  "visible": true,
  "marks": [],
  "max_render_time": 0,
  "window_properties": {
    "class": "com-sun-javaws-Main",
    "instance": "sun-awt-X11-XDialogPeer",
    "title": " ",
    "transient_for": 48234560
  },
  "nodes": []
}

@ezamelczyk
Copy link

Is there any possibility of including this into sway config or something like that?

@Ryan1729
Copy link

Ryan1729 commented Jul 6, 2022

As of this writing the wiki suggests adding the following to ~/.profile.

if [ "$XDG_SESSION_DESKTOP" = "sway" ] ; then
    # https://github.com/swaywm/sway/issues/595
    export _JAVA_AWT_WM_NONREPARENTING=1
fi

On a fresh install of Ubuntu 22.04, adding it to ~/.profile and then logging out then back in didn't fix the blank screen. Additionally, _JAVA_AWT_WM_NONREPARENTING was not set when checking in a new terminal. So I guess ~/.profile isn't getting run for some reason? Or "$XDG_SESSION_DESKTOP" is not set yet?

Anyway, adding the snippet that sets _JAVA_AWT_WM_NONREPARENTING to .bashrc, as well as ~/.profile, then logging out then back in addressed the issue for me, when starting the java app from a terminal.

@bl4ckb0ne
Copy link
Contributor

The issue is closed, and this looks more of a distro issue than a sway issue. You will have more luck with posting your question at a more relevant place.

@Ryan1729
Copy link

Ryan1729 commented Jul 7, 2022 via email

@nmschulte
Copy link
Contributor

@Ryan1729 -- GDM3 does not source ~/.profile, if you're using that as your login chooser. I couldn't find an article/posting to refer you to, and possible GDM3 behaves differently depending the situation, but I've stopped using GDM3 (and continue to launch Sway from vtty) for this reason alone.

@nmschulte
Copy link
Contributor

Is there a pattern the Java applications can use to account for Sway/non-reparenting WMs?

One application I'm using that uses Swing/JFrame, seems to only suffer on windows it displays other than the initial one (and same for a splash screen in another application; possibly for the same reason/pattern). I found that adding a .pack() call semi-fixes the first application (the second is not open source), but this doesn't fully resolve other behavioral issues like re-flowing/re-sizing the window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests