mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-20 10:27:52 +00:00
7010721: Frame#setMaximizedbounds not working properly on dual screen environment
Reviewed-by: art, anthony
This commit is contained in:
parent
b5f9d4cad8
commit
f01001207c
@ -107,8 +107,16 @@ class WFramePeer extends WWindowPeer implements FramePeer {
|
||||
Rectangle currentDevBounds = currentDevGC.getBounds();
|
||||
Rectangle primaryDevBounds = primaryDevGC.getBounds();
|
||||
|
||||
b.width -= (currentDevBounds.width - primaryDevBounds.width);
|
||||
b.height -= (currentDevBounds.height - primaryDevBounds.height);
|
||||
boolean isCurrentDevLarger =
|
||||
((currentDevBounds.width - primaryDevBounds.width > 0) ||
|
||||
(currentDevBounds.height - primaryDevBounds.height > 0));
|
||||
|
||||
// the window manager doesn't seem to compensate for differences when
|
||||
// the primary monitor is larger than the monitor that display the window
|
||||
if (isCurrentDevLarger) {
|
||||
b.width -= (currentDevBounds.width - primaryDevBounds.width);
|
||||
b.height -= (currentDevBounds.height - primaryDevBounds.height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user