Changeset 3543 in josm for trunk/src/org


Ignore:
Timestamp:
2010-09-18T22:40:19+02:00 (14 years ago)
Author:
bastiK
Message:

fixed #5470 - fullscreen moves dialogs below main window

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/FullscreenToggleAction.java

    r3537 r3543  
    88import java.awt.GraphicsDevice;
    99import java.awt.GraphicsEnvironment;
     10import java.awt.Rectangle;
    1011import java.awt.Toolkit;
     12import java.awt.Window;
    1113import java.awt.event.ActionEvent;
    1214import java.awt.event.KeyEvent;
     
    2729    private boolean selected;
    2830    private GraphicsDevice gd;
     31    private Rectangle prevBounds;
     32
    2933    public FullscreenToggleAction() {
    3034        super(
     
    7377        notifySelectedState();
    7478
    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        }
    7688       
    7789        // we cannot use hw-exclusive fullscreen mode in MS-Win, as long
     
    8395        // screen by default (it's a simulated mode, but should be ok)
    8496        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))) {
    8698            frame.dispose();
    8799            frame.setUndecorated(selected);
    88100            gd.setFullScreenWindow(selected ? frame : null);
    89             frame.setVisible(true);
     101            for (Window wind : visibleWindows) {
     102                wind.setVisible(true);
     103            }
    90104        } else {
    91105            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();
    93108                Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
    94109                frame.setBounds(0, 0, dim.width, dim.height);
     110            } else if (prevBounds != null) {
     111                frame.setBounds(prevBounds);
    95112            }
    96113            frame.setUndecorated(selected);
    97             frame.setVisible(true);
     114            for (Window wind : visibleWindows) {
     115                wind.setVisible(true);
     116            }
    98117        }
    99118    }
Note: See TracChangeset for help on using the changeset viewer.