mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 08:38:20 +00:00
[client] spice: be more aggressive with window warp for high DPI mice
This commit is contained in:
parent
183d06f90c
commit
2bc767430c
@ -837,9 +837,9 @@ static void handleMouseMoveEvent(int ex, int ey)
|
|||||||
{
|
{
|
||||||
g_cursor.inView = true;
|
g_cursor.inView = true;
|
||||||
spice_mouse_motion(delta.x, delta.y);
|
spice_mouse_motion(delta.x, delta.y);
|
||||||
if (ex < 50 || ex > g_state.windowW - 50 ||
|
if (ex < g_state.windowCX - 25 || ex > g_state.windowCX + 25 ||
|
||||||
ey < 50 || ey > g_state.windowH - 50)
|
ey < g_state.windowCY - 25 || ey > g_state.windowCY + 25)
|
||||||
warpMouse(g_state.windowW / 2, g_state.windowH / 2);
|
warpMouse(g_state.windowCX, g_state.windowCY);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -887,9 +887,9 @@ static void handleMouseMoveEvent(int ex, int ey)
|
|||||||
}
|
}
|
||||||
else if (inView)
|
else if (inView)
|
||||||
{
|
{
|
||||||
if (ex < g_state.dstRect.x + 50 || ex > g_state.dstRect.w - 50 ||
|
if (ex < g_state.windowCX - 25 || ex > g_state.windowCX + 25 ||
|
||||||
ey < g_state.dstRect.y + 50 || ey > g_state.dstRect.h - 50)
|
ey < g_state.windowCY - 25 || ey > g_state.windowCY + 25)
|
||||||
warpMouse(g_state.windowW / 2, g_state.windowH / 2);
|
warpMouse(g_state.windowCX, g_state.windowCY);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!inView)
|
if (!inView)
|
||||||
@ -972,6 +972,8 @@ static void handleResizeEvent(unsigned int w, unsigned int h)
|
|||||||
|
|
||||||
g_state.windowW = w;
|
g_state.windowW = w;
|
||||||
g_state.windowH = h;
|
g_state.windowH = h;
|
||||||
|
g_state.windowCX = w / 2;
|
||||||
|
g_state.windowCY = h / 2;
|
||||||
updatePositionInfo();
|
updatePositionInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,6 +49,7 @@ struct AppState
|
|||||||
bool haveSrcSize;
|
bool haveSrcSize;
|
||||||
SDL_Point windowPos;
|
SDL_Point windowPos;
|
||||||
int windowW, windowH;
|
int windowW, windowH;
|
||||||
|
int windowCX, windowCY;
|
||||||
SDL_Rect border;
|
SDL_Rect border;
|
||||||
SDL_Point srcSize;
|
SDL_Point srcSize;
|
||||||
LG_RendererRect dstRect;
|
LG_RendererRect dstRect;
|
||||||
|
Loading…
Reference in New Issue
Block a user