fix bad import, AGAIN.
[nikiroo-utils.git] / ui / UIUtils.java
index 39d73c59c3c87244fb50c2af97961c775a752e67..892c6cbb02ee3268853d9895c38d94fc045684f3 100644 (file)
@@ -10,7 +10,9 @@ import java.awt.GraphicsConfiguration;
 import java.awt.GraphicsDevice;
 import java.awt.GraphicsEnvironment;
 import java.awt.Paint;
+import java.awt.Point;
 import java.awt.RadialGradientPaint;
+import java.awt.Rectangle;
 import java.awt.RenderingHints;
 import java.awt.Window;
 import java.io.IOException;
@@ -27,8 +29,6 @@ import javax.swing.UnsupportedLookAndFeelException;
 import javax.swing.event.HyperlinkEvent;
 import javax.swing.event.HyperlinkListener;
 
-import com.sun.java.swing.plaf.windows.resources.windows;
-
 import be.nikiroo.utils.Version;
 import be.nikiroo.utils.VersionCheck;
 
@@ -374,7 +374,7 @@ public class UIUtils {
        }
 
        /**
-        * Set the given {@link windows} to full screen mode, on the desktop it
+        * Set the given {@link Window} to full screen mode, on the desktop it
         * currently resides on.
         * <p>
         * Can be cancelled by calling again with a NULL value.
@@ -396,12 +396,15 @@ public class UIUtils {
 
                        return;
                }
+               
+               Rectangle r = win.getBounds();
+               Point center = new Point(r.x + r.width / 2, r.y + r.height / 2);
 
                GraphicsDevice current = null;
                for (GraphicsDevice screen : screens) {
                        GraphicsConfiguration[] confs = screen.getConfigurations();
                        for (GraphicsConfiguration conf : confs) {
-                               if (conf.getBounds().contains(win.getBounds())) {
+                               if (conf.getBounds().contains(center)) {
                                        current = screen;
                                        break;
                                }