mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 05:27:20 +00:00
[client] don't draw the cursor if it leaves the frame
This commit is contained in:
parent
05dc713dac
commit
13f55011c0
@ -277,7 +277,7 @@ static int cursorThread(void * unused)
|
|||||||
state.lgr->on_mouse_event
|
state.lgr->on_mouse_event
|
||||||
(
|
(
|
||||||
state.lgrData,
|
state.lgrData,
|
||||||
state.cursorVisible && state.drawCursor,
|
state.cursorVisible && state.drawCursor && state.cursorInView,
|
||||||
state.cursor.x,
|
state.cursor.x,
|
||||||
state.cursor.y
|
state.cursor.y
|
||||||
);
|
);
|
||||||
@ -686,7 +686,17 @@ static void handleMouseMoveEvent(int ex, int ey)
|
|||||||
ex > state.dstRect.x + state.dstRect.w ||
|
ex > state.dstRect.x + state.dstRect.w ||
|
||||||
ey < state.dstRect.y ||
|
ey < state.dstRect.y ||
|
||||||
ey > state.dstRect.y + state.dstRect.h)
|
ey > state.dstRect.y + state.dstRect.h)
|
||||||
|
{
|
||||||
|
state.cursorInView = false;
|
||||||
|
state.updateCursor = true;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!state.cursorInView)
|
||||||
|
{
|
||||||
|
state.cursorInView = true;
|
||||||
|
state.updateCursor = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int rx = ex - state.curLastX;
|
int rx = ex - state.curLastX;
|
||||||
@ -760,6 +770,7 @@ static void handleWindowLeave()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
state.drawCursor = false;
|
state.drawCursor = false;
|
||||||
|
state.cursorInView = false;
|
||||||
state.updateCursor = true;
|
state.updateCursor = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@ struct AppState
|
|||||||
bool serverMode;
|
bool serverMode;
|
||||||
bool haveCursorPos;
|
bool haveCursorPos;
|
||||||
bool drawCursor;
|
bool drawCursor;
|
||||||
|
bool cursorInView;
|
||||||
bool updateCursor;
|
bool updateCursor;
|
||||||
float scaleX, scaleY;
|
float scaleX, scaleY;
|
||||||
float accX, accY;
|
float accX, accY;
|
||||||
|
Loading…
Reference in New Issue
Block a user