]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
FIx magicmouse without virtual mouse driver.
authorToni Wilen <twilen@winuae.net>
Wed, 14 Dec 2022 18:37:38 +0000 (20:37 +0200)
committerToni Wilen <twilen@winuae.net>
Wed, 14 Dec 2022 18:37:38 +0000 (20:37 +0200)
inputdevice.cpp
od-win32/win32.cpp

index e4cdb4d2d15ff1f4153aab777ec76faca058dc50..1b64b6013e70df16cb508a0fe122387818f7dfb6 100644 (file)
@@ -2936,14 +2936,36 @@ end:
        if (dir) {
                if (!ad->picasso_on) {
                        int aw = 0, ah = 0, dx, dy;
-                       get_custom_mouse_limits (&aw, &ah, &dx, &dy, dimensioninfo_dbl);
+                       get_custom_mouse_limits(&aw, &ah, &dx, &dy, dimensioninfo_dbl);
                        x += dx;
                        y += dy;
+                       float dx2, dy2, mx2, my2;
+                       getgfxoffset(monid, &dx2, &dy2, &mx2, &my2);
+                       if (mx2) {
+                               x = (int)(x / mx2);
+                       }
+                       if (my2) {
+                               y = (int)(y / my2);
+                       }
+                       x += (int)dx2;
+                       y += (int)dy2;
+               } else {
+                       float dx, dy, mx, my;
+                       getgfxoffset(monid, &dx, &dy, &mx, &my);
+                       if (mx) {
+                               x = (int)(x / mx);
+                       }
+                       if (my) {
+                               y = (int)(y / my);
+                       }
+                       x -= (int)dx;
+                       y -= (int)dy;
                }
-               if (!dmaen (DMA_SPRITE))
+               if (!dmaen(DMA_SPRITE) && !ad->picasso_on) {
                        setmouseactivexy(0, x, y, 0);
-               else
+               } else {
                        setmouseactivexy(0, x, y, dir);
+               }
        }
        return 1;
 }
index 1f964760222e78efdd5ca0a61f0e9ad47c7f0318..837102888c2ce1d7a1e64546fb4e2c9100fb4a82 100644 (file)
@@ -1387,7 +1387,7 @@ void setmouseactivexy(int monid, int x, int y, int dir)
        struct AmigaMonitor *mon = &AMonitors[monid];
        int diff = 8;
 
-       if (isfullscreen () > 0)
+       if (isfullscreen() > 0)
                return;
        x += mon->amigawin_rect.left;
        y += mon->amigawin_rect.top;
@@ -1403,16 +1403,16 @@ void setmouseactivexy(int monid, int x, int y, int dir)
                x += (mon->amigawin_rect.right - mon->amigawin_rect.left) / 2;
                y += (mon->amigawin_rect.bottom - mon->amigawin_rect.top) / 2;
        }
-       if (isfullscreen () < 0) {
+       if (isfullscreen() < 0) {
                POINT pt;
                pt.x = x;
                pt.y = y;
-               if (MonitorFromPoint (pt, MONITOR_DEFAULTTONULL) == NULL)
+               if (MonitorFromPoint(pt, MONITOR_DEFAULTTONULL) == NULL)
                        return;
        }
        if (mouseactive) {
-               disablecapture ();
-               SetCursorPos (x, y);
+               disablecapture();
+               SetCursorPos(x, y);
                if (dir) {
                        recapture = 1;
                }