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

JOptionPane.showMessageDialog shows empty Windows #934

Closed
i3bot opened this issue Jan 24, 2013 · 14 comments
Closed

JOptionPane.showMessageDialog shows empty Windows #934

i3bot opened this issue Jan 24, 2013 · 14 comments
Assignees
Labels

Comments

@i3bot
Copy link

i3bot commented Jan 24, 2013

[Originally reported by i3-new-ticket]
(Some Java Applications randomly show empty Message Dialogs. Setting wmname to LG3D does not help.

In my Application i just call JOptionPane.showMessageDialog

I use:
Oracle java 1.7.0_11 OpenJDK 1.7.0_03

@i3bot
Copy link
Author

i3bot commented Jan 26, 2013

[Original comment by kha]

I can confirm this. Additionally, when resizing the window, a rectangle in the upper left corner actually gets drawn - its size is exactly the resize delta (current window size minus original window size) (see attached screenshot).

@stapelberg
Copy link
Member

I can’t reproduce this. Can you attach a minimal java program which triggers this behavior and instructions on how to run it?

@i3bot
Copy link
Author

i3bot commented Jan 27, 2013

[Original comment by nexys]

I made a simple jar that spawns 30 messageDialogs to reproduce the error. Just run it with "java -jar messageDialog.jar" and it should randomly show empty windows.

the source:

import javax.swing.JOptionPane;

public class Main {
    public static void main(String[] args) {
        for (int i = 0; i < 31; i++)
            JOptionPane.showMessageDialog(null, "A", "B",
                    JOptionPane.WARNING_MESSAGE);
    }
}

@stapelberg
Copy link
Member

Thanks, with that example I can reproduce it, too.

Unfortunately, there is no difference in the i3 logfiles for a working vs. non-working message dialog.

@i3bot
Copy link
Author

i3bot commented Jan 31, 2013

[Original comment by Klaas Boesche <klaas-dev@…>]

It seems to me that this is the same defect as #709. Back then I was under the misconception that i3 was non-reparenting, but Michael and the defect itself fixed that.
I'm not sure how to tackle this but I'll have a look at it from the Java side later.

@stapelberg
Copy link
Member

I don’t know what changed, but I can no longer reproduce this. I downgraded the i3 version to the one from two months ago, so that shouldn’t be the cause. I am using openjdk-7-jre-headless 7u3-2.1.3-1

@i3bot
Copy link
Author

i3bot commented Apr 10, 2013

[Original comment by Klaas Boesche <klaas-dev@…>]

I cannot reproduce this either with the given Example. However I can reproduce this using the Mars Mips Simulator from here: http://courses.missouristate.edu/kenvollmar/mars/download.htm / mars-mips in the AUR
In particular it happens with JFileChooser's showOpenDialog(). Repeatedly clicking the "open file" button in the UI and closing the dialog with ESC reproduces the blank window in about every third time. It may also happen that the main GUI frame is blank on start, etc..
I tried to reproduce it using the JFileChooser call but could not. Currently no time to investigate further.

@stapelberg
Copy link
Member

Replying to comment 7 by Klaas Boesche <klaas-dev@…>:

I cannot reproduce this either with the given Example. However I can reproduce this using the Mars Mips Simulator from here: http://courses.missouristate.edu/kenvollmar/mars/download.htm / mars-mips in the AUR
In particular it happens with JFileChooser's showOpenDialog(). Repeatedly clicking the "open file" button in the UI and closing the dialog with ESC reproduces the blank window in about every third time. It may also happen that the main GUI frame is blank on start, etc..
I tried to reproduce it using the JFileChooser call but could not. Currently no time to investigate further.
I can’t reproduce it with Mars4_3.jar. The open file dialog comes up just fine all the time (tried well over 10 times). Just to be sure, which i3 version are you using?

@i3bot
Copy link
Author

i3bot commented Apr 12, 2013

[Original comment by anonymous]

i3 version 4.4-119-g23078f6 (2013-01-30, branch "next")
Seems I didn't upgrade in quite a while, so I just did using the i3-git package in AUR.
i3 version 4.5.1-40-gadc16f0 (2013-04-11, branch "makepkg") (don't know why the branch is called "makepkg", the PKGBUILD uses "next", guess that's a new "feature" of pacman 4.1?)
The grey dialog is still reproducible using mars.

@i3bot
Copy link
Author

i3bot commented May 8, 2013

[Original comment by daniel@…]

Updated #709 with a possible fix (comment:12:#709)

I think this ticket is a duplicate

@stapelberg
Copy link
Member

I could reproduce the issue with messageDialogs.jar again, but it goes away when trying to use xtrace or strace. This heavily hints at a race condition of some sort.

Anyway, I also looked at xtrace output and noticed that Java tries to send i3 a _NET_REQUEST_FRAME_EXTENTS ClientMessage, which we currently don’t support. After implementing it, things seem better, at least on my machine. Maybe it’s because Java uses a different code path now, maybe it just makes the race condition less likely (or go to a different set of machines).

It seems like none of the niche window managers support this, while the major ones (e.g. GNOME’s mutter) do.

Could you please try the attached patch and let me know if that works for you or not?

@stapelberg
Copy link
Member

This ticket was fixed in commit http://c.i3wm.org/0c7a76c2:

Handle the _NET_REQUEST_FRAME_EXTENTS ClientMessage (java compat)

This ClientMessage can be used to estimate how big the window will be
before opening it. Java always sends the ClientMessage and checks the
atom that should be set by the window manager, but it seems that the
fallback code path has a race condition.

Let’s see if the situation gets better with this change. I have been
running this patch for about two weeks and have not seen any issues with
it.

fixes #934
fixes #709

@i3bot
Copy link
Author

i3bot commented Jul 3, 2014

[Original comment by anonymous]

I am on i3 4.8.1 and IntelliJ 13 is still not rendering modal windows properly, very similar to this ticket. Even worst because most of the time it is just gray panel.
CMD+Shift+Space just shows part.

thanks

@i3bot
Copy link
Author

i3bot commented Jul 6, 2014

[Original comment by TonyC]

Make a new report with detailed steps to reproduce.

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

No branches or pull requests

2 participants