Changeset 3543 in josm for trunk/src/org
- Timestamp:
- 2010-09-18T22:40:19+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/FullscreenToggleAction.java
r3537 r3543 8 8 import java.awt.GraphicsDevice; 9 9 import java.awt.GraphicsEnvironment; 10 import java.awt.Rectangle; 10 11 import java.awt.Toolkit; 12 import java.awt.Window; 11 13 import java.awt.event.ActionEvent; 12 14 import java.awt.event.KeyEvent; … … 27 29 private boolean selected; 28 30 private GraphicsDevice gd; 31 private Rectangle prevBounds; 32 29 33 public FullscreenToggleAction() { 30 34 super( … … 73 77 notifySelectedState(); 74 78 75 Frame frame = (Frame)Main.parent; 79 Frame frame = (Frame) Main.parent; 80 81 List<Window> visibleWindows = new ArrayList<Window>(); 82 visibleWindows.add(frame); 83 for (Window w : Frame.getWindows()) { 84 if (w.isVisible() && w != frame) { 85 visibleWindows.add(w); 86 } 87 } 76 88 77 89 // we cannot use hw-exclusive fullscreen mode in MS-Win, as long … … 83 95 // screen by default (it's a simulated mode, but should be ok) 84 96 String exclusive = Main.pref.get("draw.fullscreen.exclusive-mode", "auto"); 85 if (" yes".equals(exclusive) || ("auto".equals(exclusive) && !(Main.platform instanceof PlatformHookWindows))) {97 if ("true".equals(exclusive) || ("auto".equals(exclusive) && !(Main.platform instanceof PlatformHookWindows))) { 86 98 frame.dispose(); 87 99 frame.setUndecorated(selected); 88 100 gd.setFullScreenWindow(selected ? frame : null); 89 frame.setVisible(true); 101 for (Window wind : visibleWindows) { 102 wind.setVisible(true); 103 } 90 104 } else { 91 105 frame.dispose(); 92 if (Main.pref.getBoolean("draw.fullscreen.set-screen-bounds", true)) { 106 if (Main.pref.getBoolean("draw.fullscreen.set-screen-bounds", true) && selected) { 107 prevBounds = frame.getBounds(); 93 108 Dimension dim = Toolkit.getDefaultToolkit().getScreenSize(); 94 109 frame.setBounds(0, 0, dim.width, dim.height); 110 } else if (prevBounds != null) { 111 frame.setBounds(prevBounds); 95 112 } 96 113 frame.setUndecorated(selected); 97 frame.setVisible(true); 114 for (Window wind : visibleWindows) { 115 wind.setVisible(true); 116 } 98 117 } 99 118 }
Note:
See TracChangeset
for help on using the changeset viewer.