swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.63k stars 1.11k forks source link

IntelliJ Idea show weird blank screen #595

Closed jarias closed 8 years ago

jarias commented 8 years ago

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 commented 8 years ago

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

ids1024 commented 8 years ago

export _JAVA_AWT_WM_NONREPARENTING=1 seems to fix the problem.

stwa commented 8 years ago

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 commented 8 years ago

@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.

ricejamesh commented 6 years ago

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

mkubasz commented 6 years ago

I have this issue too.

emersion commented 6 years ago

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

mkubasz commented 6 years ago

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

ricejamesh commented 6 years ago

2018.2 did not fix it for me. Bummer

emersion commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

ricejamesh commented 6 years ago

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

emersion commented 6 years ago

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 commented 6 years ago

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

easbarba commented 6 years ago

@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 commented 6 years ago

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

mguezuraga commented 5 years ago

_JAVA_AWT_WM_NONREPARENTING=1 idea This works for me. Sway 1.0

EgbertW commented 5 years ago

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 commented 5 years ago

@EgbertW

Its Java's issue: https://bugs.openjdk.java.net/browse/JDK-8058197

EgbertW commented 5 years ago

@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 commented 4 years ago

@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
tukusejssirs commented 3 years ago

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 commented 2 years ago

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

Ryan1729 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

My intention was mainly to put a fix that worked for me in the place that I looked for a fix beforehand, since I’m guessing others would look at this issue too.

Any explanation about why adding it in .bashrc is needed in Ubuntu specifically, or suggestions of something better to do instead of that, would just be gravy.

On Jul 7, 2022, at 8:09 AM, Simon Zeni @.***> wrote:

 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.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

nmschulte commented 1 year ago

@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 commented 1 year ago

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.