diff options
author | Sven Gothel <[email protected]> | 2019-03-27 03:51:34 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-03-27 03:51:34 +0100 |
commit | e0b4975e0a1da166f2d03d5e11c851d222b2df33 (patch) | |
tree | 7a0a48e7d197c34e344b36ffc03937d8cb0fe955 /src/newt | |
parent | ff74467e09968834541c46bd64a6625e7c902199 (diff) | |
parent | 51d301875a65f511b6a9846fc3bf661e50a48a68 (diff) |
Merge pull request #104 from gohai/bcm-fix-overscan-offset
Fix overlay/underlay position mismatch in X11UnderlayTracker (bug 1315)
Diffstat (limited to 'src/newt')
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/x11/X11UnderlayTracker.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/newt/classes/jogamp/newt/driver/x11/X11UnderlayTracker.java b/src/newt/classes/jogamp/newt/driver/x11/X11UnderlayTracker.java index f9987860d..d7e184a3c 100644 --- a/src/newt/classes/jogamp/newt/driver/x11/X11UnderlayTracker.java +++ b/src/newt/classes/jogamp/newt/driver/x11/X11UnderlayTracker.java @@ -140,6 +140,13 @@ public class X11UnderlayTracker implements WindowListener, KeyListener, MouseLis Point underlayOnScreen = new Point(); overlayWindow.getLocationOnScreen(overlayOnScreen); underlayWindow.getLocationOnScreen(underlayOnScreen); + /* + * Apply an offset when the dimensions of over- and + * underlay don't match + */ + int dx = (overlayWindow.getScreen().getWidth() - underlayWindow.getScreen().getWidth()) / 2; + int dy = (overlayWindow.getScreen().getHeight() - underlayWindow.getScreen().getHeight()) / 2; + underlayOnScreen.translate(dx, dy); if(overlayOnScreen.getX()!=underlayOnScreen.getX() || overlayOnScreen.getY()!=underlayOnScreen.getY()) { overlayWindow.setPosition(underlayOnScreen.getX(), underlayOnScreen.getY()); |