mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-04-27 00:56:27 +00:00
[client] spice: fix mouse exiting when the window is letterboxed/padded
This commit is contained in:
parent
1a8dfe1cc0
commit
80d911f040
@ -899,15 +899,9 @@ static void handleMouseMoveEvent(int ex, int ey)
|
|||||||
.y = (float)(state.cursor.y + delta.y) / state.scaleY
|
.y = (float)(state.cursor.y + delta.y) / state.scaleY
|
||||||
};
|
};
|
||||||
|
|
||||||
const SDL_Point pos = {
|
|
||||||
.x = state.windowPos.x + state.border.x + newPos.x,
|
|
||||||
.y = state.windowPos.y + state.border.y + newPos.y
|
|
||||||
};
|
|
||||||
|
|
||||||
/* check if the movement would exit the window */
|
/* check if the movement would exit the window */
|
||||||
if ((newPos.x < 0 || newPos.x >= state.dstRect.w ||
|
if (newPos.x < 0 || newPos.x >= state.dstRect.w ||
|
||||||
newPos.y < 0 || newPos.y >= state.dstRect.h) &&
|
newPos.y < 0 || newPos.y >= state.dstRect.h)
|
||||||
isValidCursorLocation(pos.x, pos.y))
|
|
||||||
{
|
{
|
||||||
/* determine where to move the cursor to taking into account any borders
|
/* determine where to move the cursor to taking into account any borders
|
||||||
* if the aspect ratio is not being forced */
|
* if the aspect ratio is not being forced */
|
||||||
@ -934,10 +928,15 @@ static void handleMouseMoveEvent(int ex, int ey)
|
|||||||
ny = newPos.y + state.dstRect.y * 2;
|
ny = newPos.y + state.dstRect.y * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* put the mouse where it should be and disable warp */
|
if (isValidCursorLocation(
|
||||||
state.warpState = WARP_STATE_WIN_EXIT;
|
state.windowPos.x + state.border.x + nx,
|
||||||
warpMouse(nx, ny);
|
state.windowPos.y + state.border.y + ny))
|
||||||
return;
|
{
|
||||||
|
/* put the mouse where it should be and disable warp */
|
||||||
|
state.warpState = WARP_STATE_WIN_EXIT;
|
||||||
|
warpMouse(nx, ny);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user