8134669: Empty screen insets in Gnome 3, OEL 7 in multiscreen mode

Reviewed-by: alexsch
This commit is contained in:
Semyon Sadetsky 2016-03-24 20:28:53 +03:00
parent eac3ddb88c
commit cc7b4e06ed

View File

@ -770,17 +770,20 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
GraphicsEnvironment.getLocalGraphicsEnvironment();
if (!x11ge.runningXinerama())
{
Rectangle workArea = XToolkit.getWorkArea(root, scale);
if (workArea != null)
{
return new Insets(workArea.y,
workArea.x,
rootBounds.height - workArea.height - workArea.y,
rootBounds.width - workArea.width - workArea.x);
}
Insets screenInsets = getInsets(root, rootBounds, scale);
if (screenInsets != null) return screenInsets;
}
return getScreenInsetsManually(root, rootBounds, gc.getBounds(), scale);
Insets insets = getScreenInsetsManually(root, rootBounds,
gc.getBounds(), scale);
if ((insets.left | insets.top | insets.bottom | insets.right) == 0
&& rootBounds != null ) {
root = XlibWrapper.RootWindow(XToolkit.getDisplay(),
x11gd.getScreen());
Insets screenInsets = getInsets(root, rootBounds, scale);
if (screenInsets != null) return screenInsets;
}
return insets;
}
finally
{
@ -788,6 +791,16 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
}
}
private Insets getInsets(long root, Rectangle rootBounds, int scale) {
Rectangle workArea = XToolkit.getWorkArea(root, scale);
if (workArea == null) {
return null;
}
return new Insets(workArea.y, workArea.x,
rootBounds.height - workArea.height - workArea.y,
rootBounds.width - workArea.width - workArea.x);
}
/*
* Manual calculation of screen insets: get all the windows with
* _NET_WM_STRUT/_NET_WM_STRUT_PARTIAL hints and add these