align zoomed cursor to hotspot

BUG: 330679
FIXED-IN: 4.11.7
REVIEW: 115453
This commit is contained in:
Thomas Lübking 2014-02-03 21:02:10 +01:00
parent 170c5a50bd
commit acaf4807ab
2 changed files with 3 additions and 1 deletions

View file

@ -182,6 +182,7 @@ void ZoomEffect::recreateTexture()
// turn the XcursorImage into a QImage that will be used to create the GLTexture/XRenderPicture.
imageWidth = ximg->width;
imageHeight = ximg->height;
cursorHotSpot = QPoint(ximg->xhot, ximg->yhot);
QImage img((uchar*)ximg->pixels, imageWidth, imageHeight, QImage::Format_ARGB32_Premultiplied);
if (effects->isOpenGLCompositing())
texture.reset(new GLTexture(img));
@ -331,7 +332,7 @@ void ZoomEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data)
w *= zoom;
h *= zoom;
}
const QPoint p = effects->cursorPos();
const QPoint p = effects->cursorPos() - cursorHotSpot;
QRect rect(p.x() * zoom + data.xTranslation(), p.y() * zoom + data.yTranslation(), w, h);
if (texture) {

View file

@ -112,6 +112,7 @@ private:
MousePointerType mousePointer;
int focusDelay;
QPoint cursorPoint;
QPoint cursorHotSpot;
QPoint focusPoint;
QPoint prevPoint;
QTime lastMouseEvent;