Ticket #9699: WindowGeometry.java.patch
File WindowGeometry.java.patch, 1.9 KB (added by , 10 years ago) |
---|
-
src/org/openstreetmap/josm/tools/WindowGeometry.java
322 322 323 323 Rectangle maxbounds = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); 324 324 325 deltax = size.width - maxbounds.width; 326 if (deltax > 0) { 327 size.width -= deltax; 328 } 325 if (!isBugInMaximumWindowBounds(maxbounds)) { 329 326 330 deltay = size.height - maxbounds.height;331 if (deltay> 0) {332 size.height -= deltay;333 }327 deltax = size.width - maxbounds.width; 328 if (deltax > 0) { 329 size.width -= deltax; 330 } 334 331 332 deltay = size.height - maxbounds.height; 333 if (deltay > 0) { 334 size.height -= deltay; 335 } 336 } 335 337 window.setLocation(p); 336 338 window.setSize(size); 337 339 } 338 340 339 341 /** 342 * Because of bug in getMaximumWindowBounds on dual screen Ubuntu. Function 343 * return incorrect values with minus sign or extremely large. This cause 344 * incorrect bounds and main windows is created with only few pixel with. 345 * More details in #9699. 346 * 347 * @param maxbounds 348 * result of getMaximumWindowBounds 349 * @return is bug in result of getMaximumWindowBounds 350 */ 351 private boolean isBugInMaximumWindowBounds(Rectangle maxbounds) { 352 return maxbounds.width <= 0 || maxbounds.height <= 0 || maxbounds.x > 1000 || maxbounds.y > 1000; 353 } 354 355 /** 340 356 * Computes the virtual bounds of graphics environment, as an union of all screen bounds. 341 357 * @return The virtual bounds of graphics environment, as an union of all screen bounds. 342 358 * @since 6522