mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-12 16:09:15 +00:00
8134669: Empty screen insets in Gnome 3, OEL 7 in multiscreen mode
Reviewed-by: alexsch
This commit is contained in:
parent
eac3ddb88c
commit
cc7b4e06ed
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user