OpenJDK / jdk / hs
changeset 12278:f3519c549711
6888634: test/closed/javax/swing/Popup/TaskbarPositionTest.java fails
Reviewed-by: alexp
author | rupashka |
---|---|
date | Thu, 22 Mar 2012 17:10:48 +0200 |
parents | 6b681d75ebe5 |
children | a88bb2d86435 |
files | jdk/src/share/classes/javax/swing/JPopupMenu.java |
diffstat | 1 files changed, 11 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/jdk/src/share/classes/javax/swing/JPopupMenu.java Wed Mar 21 17:12:31 2012 +0400 +++ b/jdk/src/share/classes/javax/swing/JPopupMenu.java Thu Mar 22 17:10:48 2012 +0200 @@ -359,17 +359,20 @@ int scrBottomY = scrBounds.y + scrHeight; // Ensure that popup menu fits the screen - if (popupRightX > (long)scrRightX) { + if (popupRightX > (long) scrRightX) { popupLocation.x = scrRightX - popupSize.width; - if( popupLocation.x < scrBounds.x ) { - popupLocation.x = scrBounds.x ; - } } - if (popupBottomY > (long)scrBottomY) { + + if (popupBottomY > (long) scrBottomY) { popupLocation.y = scrBottomY - popupSize.height; - if( popupLocation.y < scrBounds.y ) { - popupLocation.y = scrBounds.y; - } + } + + if (popupLocation.x < scrBounds.x) { + popupLocation.x = scrBounds.x; + } + + if (popupLocation.y < scrBounds.y) { + popupLocation.y = scrBounds.y; } return popupLocation;