mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-23 05:53:40 +00:00
[client] spice: fix mouse warp on window focus
This commit is contained in:
parent
3b580af194
commit
5323d9833a
@ -816,8 +816,8 @@ static void handleMouseMoveEvent(int ex, int ey)
|
|||||||
if (delta.x == 0 && delta.y == 0)
|
if (delta.x == 0 && delta.y == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
state.curLastX = state.curLocalX = ex;
|
state.curLastX = ex;
|
||||||
state.curLastY = state.curLocalY = ey;
|
state.curLastY = ey;
|
||||||
state.haveCurLocal = true;
|
state.haveCurLocal = true;
|
||||||
|
|
||||||
if (state.warpState == WARP_STATE_ACTIVE &&
|
if (state.warpState == WARP_STATE_ACTIVE &&
|
||||||
@ -992,7 +992,6 @@ static void handleWindowLeave()
|
|||||||
static void handleWindowEnter()
|
static void handleWindowEnter()
|
||||||
{
|
{
|
||||||
state.cursorInWindow = true;
|
state.cursorInWindow = true;
|
||||||
return;
|
|
||||||
|
|
||||||
if (state.warpState == WARP_STATE_OFF)
|
if (state.warpState == WARP_STATE_OFF)
|
||||||
state.warpState = WARP_STATE_ON;
|
state.warpState = WARP_STATE_ON;
|
||||||
@ -1103,15 +1102,21 @@ int eventFilter(void * userdata, SDL_Event * event)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case EnterNotify:
|
case EnterNotify:
|
||||||
state.curLocalX = xe.xcrossing.x;
|
if (xe.xcrossing.detail != NotifyNonlinear)
|
||||||
state.curLocalY = xe.xcrossing.y;
|
break;
|
||||||
|
|
||||||
|
state.curLastX = xe.xcrossing.x;
|
||||||
|
state.curLastY = xe.xcrossing.y;
|
||||||
state.haveCurLocal = true;
|
state.haveCurLocal = true;
|
||||||
handleWindowEnter();
|
handleWindowEnter();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LeaveNotify:
|
case LeaveNotify:
|
||||||
state.curLocalX = xe.xcrossing.x;
|
if (xe.xcrossing.detail != NotifyNonlinear)
|
||||||
state.curLocalY = xe.xcrossing.y;
|
break;
|
||||||
|
|
||||||
|
state.curLastX = xe.xcrossing.x;
|
||||||
|
state.curLastY = xe.xcrossing.y;
|
||||||
state.haveCurLocal = true;
|
state.haveCurLocal = true;
|
||||||
handleWindowLeave();
|
handleWindowLeave();
|
||||||
break;
|
break;
|
||||||
|
@ -82,8 +82,6 @@ struct AppState
|
|||||||
int curLastX;
|
int curLastX;
|
||||||
int curLastY;
|
int curLastY;
|
||||||
bool haveCurLocal;
|
bool haveCurLocal;
|
||||||
int curLocalX;
|
|
||||||
int curLocalY;
|
|
||||||
bool haveAligned;
|
bool haveAligned;
|
||||||
|
|
||||||
enum WarpState warpState;
|
enum WarpState warpState;
|
||||||
|
Loading…
Reference in New Issue
Block a user