JBR-5605 ignore empty client area when syncing bounds in XDecoratedPeer.

(cherry picked from commit d2301edbd0de04747817a2d382f587056d954627)
This commit is contained in:
ngubarkov
2023-05-18 22:37:59 +03:00
committed by jbrbot
parent 7cb947fe82
commit 0d82eb8024

View File

@@ -495,10 +495,11 @@ abstract class XDecoratedPeer extends XWindowPeer {
}
WindowDimensions newDimensions = new WindowDimensions(dimensions);
newDimensions.setInsets(getRealInsets());
Rectangle client = dimensions.getClientRect();
dimensions = newDimensions;
insets_corrected = true;
if (isMaximized()) {
if (isMaximized() || client.width <= 0 || client.height <= 0) {
return;
}
@@ -1439,12 +1440,16 @@ abstract class XDecoratedPeer extends XWindowPeer {
@Override
void syncBounds() {
Rectangle r = target.getBounds();
Insets ins = getRealInsets();
if (r.width <= ins.left + ins.right || r.height <= ins.top + ins.bottom) {
return;
}
if (syncSizeOnly && dimensions != null) {
dimensions.setSize(r.width, r.height);
dimensions.setInsets(getRealInsets());
dimensions.setInsets(ins);
xSetSize(r.width, r.height);
} else {
dimensions = new WindowDimensions(r, getRealInsets(), false);
dimensions = new WindowDimensions(r, ins, false);
xSetBounds(r.x, r.y, r.width, r.height);
}
reconfigureContentWindow(dimensions);