From: Toni Wilen Date: Wed, 14 Dec 2022 18:37:38 +0000 (+0200) Subject: FIx magicmouse without virtual mouse driver. X-Git-Tag: 41000~6 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=4f710d5ceba9a93dbc8505fcf612f32d195385dd;p=francis%2Fwinuae.git FIx magicmouse without virtual mouse driver. --- diff --git a/inputdevice.cpp b/inputdevice.cpp index e4cdb4d2..1b64b601 100644 --- a/inputdevice.cpp +++ b/inputdevice.cpp @@ -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; } diff --git a/od-win32/win32.cpp b/od-win32/win32.cpp index 1f964760..83710288 100644 --- a/od-win32/win32.cpp +++ b/od-win32/win32.cpp @@ -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; }