Ticket #8021: 8021.patch

File 8021.patch, 1.5 KB (added by Don-vip, 13 years ago)
  • core/src/org/openstreetmap/josm/tools/WindowGeometry.java

     
    276276        GraphicsDevice[] gs = ge.getScreenDevices();
    277277        for (int j = 0; j < gs.length; j++) {
    278278            GraphicsDevice gd = gs[j];
    279             GraphicsConfiguration[] gc = gd.getConfigurations();
    280             for (int i = 0; i < gc.length; i++) {
    281                 virtualBounds = virtualBounds.union(gc[i].getBounds());
     279            if (gd.getType() == GraphicsDevice.TYPE_RASTER_SCREEN) {
     280                virtualBounds = virtualBounds.union(gd.getDefaultConfiguration().getBounds());
    282281            }
    283282        }
    284283
     
    315314        Rectangle bounds = null;
    316315        for (int j = 0; j < gs.length; j++) {
    317316            GraphicsDevice gd = gs[j];
    318             GraphicsConfiguration[] gc = gd.getConfigurations();
    319             for (int i = 0; i < gc.length; i++) {
    320                 Rectangle b = gc[i].getBounds();
    321                 if(b.width/b.height >= 3) /* multiscreen with wrong definition */
     317            if (gd.getType() == GraphicsDevice.TYPE_RASTER_SCREEN) {
     318                Rectangle b = gd.getDefaultConfiguration().getBounds();
     319                if (b.height > 0 && b.width/b.height >= 3) /* multiscreen with wrong definition */
    322320                {
    323321                    b.width /= 2;
    324322                    Rectangle is = b.intersection(g);