]> git.mdlowis.com Git - projs/tide.git/commitdiff
fixed bug in centering logic.
authorMichael D. Lowis <mike.lowis@gentex.com>
Tue, 11 Dec 2018 15:26:53 +0000 (10:26 -0500)
committerMichael D. Lowis <mike.lowis@gentex.com>
Tue, 11 Dec 2018 15:26:53 +0000 (10:26 -0500)
inc/x11.h

index bb4cb650181fcaf26382d94db77ca6603b1a434c..80793bc19ff081e4674ed0f579c3afb703ecdc8e 100644 (file)
--- a/inc/x11.h
+++ b/inc/x11.h
@@ -84,8 +84,8 @@ static void x11_centerwin(XConf* x) {
             maxy = p_screens[i].y_org + p_screens[i].height;
         if (minx <= ptrx && ptrx <= maxx && miny <= ptry && ptry <= maxy) {
             XMoveWindow(x->display, x->self,
-                p_screens[i].width/2 - x->width/2,
-                p_screens[i].height/2 - x->height/2);
+                minx + p_screens[i].width/2 - x->width/2,
+                miny + p_screens[i].height/2 - x->height/2);
             break;
         }
     }