aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2019-03-27 03:51:34 +0100
committerGitHub <[email protected]>2019-03-27 03:51:34 +0100
commite0b4975e0a1da166f2d03d5e11c851d222b2df33 (patch)
tree7a0a48e7d197c34e344b36ffc03937d8cb0fe955 /src/newt
parentff74467e09968834541c46bd64a6625e7c902199 (diff)
parent51d301875a65f511b6a9846fc3bf661e50a48a68 (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.java7
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());