diff --git a/randr/rrpointer.c b/randr/rrpointer.c index b301d050dcf3a7dfba99de5f86900f3d64c3ae7b..ba31af4f55fb8b2b67143899f064084a39760024 100644 --- a/randr/rrpointer.c +++ b/randr/rrpointer.c @@ -60,6 +60,7 @@ RRPointerToNearestCrtc(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y, RRCrtcPtr nearest = NULL; int best = 0; int best_dx = 0, best_dy = 0; + int best_crtc_width = 0, best_crtc_height = 0; for (c = 0; c < pScrPriv->numCrtcs; c++) { RRCrtcPtr crtc = pScrPriv->crtcs[c]; @@ -93,10 +94,12 @@ RRPointerToNearestCrtc(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y, best_dx = dx; best_dy = dy; best = dist; + best_crtc_width = scan_width; + best_crtc_height = scan_height; } } if (best_dx || best_dy) - (*pScreen->SetCursorPosition) (pDev, pScreen, x + best_dx, y + best_dy, + (*pScreen->SetCursorPosition) (pDev, pScreen, best_crtc_width / 2, best_crtc_height / 2, TRUE); pScrPriv->pointerCrtc = nearest; }