< prev index next >
src/java.desktop/unix/classes/sun/awt/X11/XPopupMenuPeer.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 214,242 ****
* function converted to global coordinates
* @param windowSize the desired size of menu's window
*/
protected Rectangle getWindowBounds(Point origin, Dimension windowSize) {
Rectangle globalBounds = new Rectangle(origin.x, origin.y, 0, 0);
! Dimension screenSize = graphicsConfig.getBounds().getSize();
Rectangle res;
! res = fitWindowRight(globalBounds, windowSize, screenSize);
if (res != null) {
return res;
}
! res = fitWindowLeft(globalBounds, windowSize, screenSize);
if (res != null) {
return res;
}
! res = fitWindowBelow(globalBounds, windowSize, screenSize);
if (res != null) {
return res;
}
! res = fitWindowAbove(globalBounds, windowSize, screenSize);
if (res != null) {
return res;
}
! return fitWindowToScreen(windowSize, screenSize);
}
/************************************************
*
* Overriden XMenuWindow caption-painting functions
--- 214,242 ----
* function converted to global coordinates
* @param windowSize the desired size of menu's window
*/
protected Rectangle getWindowBounds(Point origin, Dimension windowSize) {
Rectangle globalBounds = new Rectangle(origin.x, origin.y, 0, 0);
! Rectangle screenBounds = getCurrentGraphicsConfiguration().getBounds();
Rectangle res;
! res = fitWindowRight(globalBounds, windowSize, screenBounds);
if (res != null) {
return res;
}
! res = fitWindowLeft(globalBounds, windowSize, screenBounds);
if (res != null) {
return res;
}
! res = fitWindowBelow(globalBounds, windowSize, screenBounds);
if (res != null) {
return res;
}
! res = fitWindowAbove(globalBounds, windowSize, screenBounds);
if (res != null) {
return res;
}
! return fitWindowToScreen(windowSize, screenBounds);
}
/************************************************
*
* Overriden XMenuWindow caption-painting functions
< prev index next >