<Swing Dev> Bug with Full screen functionality.
Paulo Levi
i30817 at gmail.com
Wed Dec 2 22:31:45 UTC 2009
I started to make a fake fullscreen when i realized that opening another
dialog on top of the normal fullscreen corrupted the painting of the
fullscreen window. I this, this, and it mostly worked, except that it didn't
minimize correctly in linux. (in linux AWTEvent evt.getOppositeWindow() ==
null was always true for some reason) when the new focused window was from
the same application. So i switched for the native fullscreen functionality
since heavyweight mixing apparently fixed the painting corruption problem.
However, my problem is that now, in windows when i open a dialog (another
window) the main maximized window is always minimized (the state got from
the frame doesn't change, however you can see the visual effect in this
test).
If this is intencional i would please ask to limit it to either the windows
from outside the application, or at least that don't have as ancestor the
maximized window and are blocking. You can see that the effect is the same
on the native windows and the java app windows by commenting/uncommenting
the code at the end of the test.
Please answer!
package util.swing.components;
import java.awt.Desktop;
import java.awt.EventQueue;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JDialog;
import javax.swing.JFrame;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author i30817
*/
public class FullScreenFrameTest {
public FullScreenFrameTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
@Test
public void test2() throws InterruptedException {
Runnable setup = new Runnable() {
@Override
public void run() {
final JFrame f = new JFrame();
final GraphicsDevice d =
GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
if (!d.isFullScreenSupported()) {
System.out.println("fullscreenbug test not supported");
return;
}
f.setVisible(false);
f.dispose();
d.setFullScreenWindow(f);
f.setVisible(true);
//this, should make the main window minimize
// try {
// Desktop.getDesktop().open(new
File(System.getProperty("user.home")));
// } catch (IOException ex) {
//
Logger.getLogger(FullScreenFrameTest.class.getName()).log(Level.SEVERE,
null, ex);
// }
//this, should NOT
JDialog dialog = new JDialog(f);
dialog.pack();
dialog.setVisible(true);
assertTrue("fullscreen window should not be iconified if the
opened window comes from the same app", f.getExtendedState() !=
JFrame.ICONIFIED);
}
};
EventQueue.invokeLater(setup);
Thread.sleep(4000);
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20091202/cf55eb5e/attachment.html>
More information about the swing-dev
mailing list