Removes frame listeners from the addCanvasToFullScreenFrame function as they were unnecessary
@@ -322,9 +322,10 @@ public class Screen {
// Create the frame.
final Frame frame = new Frame();
+ frame.add(canvas);
+ frame.setResizable(false);
frame.setUndecorated(true);
- frame.setBackground(colorPalette.getDefaultBackground());
- frame.setForeground(colorPalette.getDefaultForeground());
+ frame.setIgnoreRepaint(true);
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(final WindowEvent e) {
device.setFullScreenWindow(null);
@@ -332,72 +333,10 @@ public class Screen {
System.exit(0);
}
});
- frame.add(canvas);
- frame.setResizable(false);
- frame.setIgnoreRepaint(true);
+ frame.setBackground(colorPalette.getDefaultBackground());
+ frame.setForeground(colorPalette.getDefaultForeground());
frame.setVisible(true);
-
-
- frame.addComponentListener(new ComponentListener() {
- @Override
- public void componentResized(final ComponentEvent e) {
- draw();
- }
-
- @Override
- public void componentMoved(final ComponentEvent e) {
- draw();
- }
-
- @Override
- public void componentShown(final ComponentEvent e) {
- draw();
- }
-
- @Override
- public void componentHidden(final ComponentEvent e) {}
- });
-
- frame.addWindowFocusListener(new WindowFocusListener() {
- @Override
- public void windowGainedFocus(final WindowEvent e) {
- draw();
- }
-
- @Override
- public void windowLostFocus(final WindowEvent e) {}
- });
-
- frame.addWindowListener(new WindowListener() {
- @Override
- public void windowOpened(final WindowEvent e) {
- draw();
- }
-
- @Override
- public void windowClosing(final WindowEvent e) {}
-
- @Override
- public void windowClosed(final WindowEvent e) {}
-
- @Override
- public void windowIconified(final WindowEvent e) {}
-
- @Override
- public void windowDeiconified(final WindowEvent e) {
- draw();
- }
-
- @Override
- public void windowActivated(final WindowEvent e) {
- draw();
- }
-
- @Override
- public void windowDeactivated(final WindowEvent e) {}
- });
-
device.setFullScreenWindow(frame);
isInFullScreenExclusiveMode = true;
