mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-01-10 23:07:04 +00:00
[client] spice: take the cursor hotspot into account
This commit is contained in:
parent
8ae39fd346
commit
5064a4ecdd
@ -869,8 +869,8 @@ static void handleMouseMoveEvent(int ex, int ey)
|
|||||||
state.warpState = WARP_STATE_ON;
|
state.warpState = WARP_STATE_ON;
|
||||||
|
|
||||||
/* convert guest to local and calculate the delta */
|
/* convert guest to local and calculate the delta */
|
||||||
const int lx = (state.cursor.x / state.scaleX) + state.dstRect.x;
|
const int lx = ((state.cursor.x + state.cursor.hx) / state.scaleX) + state.dstRect.x;
|
||||||
const int ly = (state.cursor.y / state.scaleY) + state.dstRect.y;
|
const int ly = ((state.cursor.y + state.cursor.hy) / state.scaleY) + state.dstRect.y;
|
||||||
delta.x = ex - lx;
|
delta.x = ex - lx;
|
||||||
delta.y = ey - ly;
|
delta.y = ey - ly;
|
||||||
}
|
}
|
||||||
@ -913,8 +913,8 @@ static void handleMouseMoveEvent(int ex, int ey)
|
|||||||
if (!state.grabMouse && state.warpState == WARP_STATE_ON)
|
if (!state.grabMouse && state.warpState == WARP_STATE_ON)
|
||||||
{
|
{
|
||||||
const SDL_Point newPos = {
|
const SDL_Point newPos = {
|
||||||
.x = (float)(state.cursor.x + delta.x) / state.scaleX,
|
.x = (float)(state.cursor.x + state.cursor.hx + delta.x) / state.scaleX,
|
||||||
.y = (float)(state.cursor.y + delta.y) / state.scaleY
|
.y = (float)(state.cursor.y + state.cursor.hy + delta.y) / state.scaleY
|
||||||
};
|
};
|
||||||
|
|
||||||
/* check if the movement would exit the window */
|
/* check if the movement would exit the window */
|
||||||
|
Loading…
Reference in New Issue
Block a user