提交 b5470301 编写于 作者: D dav

6709453: (dav)Screen flickers when a JFrame switches to fullscreen mode

Reviewed-by: art, dcherepanov
上级 d1c106be
......@@ -30,6 +30,7 @@ import java.awt.GraphicsDevice;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsEnvironment;
import java.awt.DisplayMode;
import java.awt.EventQueue;
import java.awt.Frame;
import java.awt.Rectangle;
import java.awt.Window;
......@@ -610,11 +611,18 @@ public class Win32GraphicsDevice extends GraphicsDevice implements
*
* @param w full-screen window
*/
protected void addFSWindowListener(Window w) {
protected void addFSWindowListener(final Window w) {
// Note: even though we create a listener for Window instances of
// fs windows they will not receive window events.
fsWindowListener = new Win32FSWindowAdapter(this);
w.addWindowListener(fsWindowListener);
// Fix for 6709453. Using invokeLater to avoid listening
// for the events already posted to the queue.
EventQueue.invokeLater(new Runnable() {
public void run() {
w.addWindowListener(fsWindowListener);
}
});
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册