mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-13 01:38:20 +00:00
[all] make cursor visible a flag and send it seperate to position
This commit is contained in:
parent
9d7f773b9c
commit
bced5f95ff
@ -710,19 +710,21 @@ static CaptureResult dxgi_capture()
|
|||||||
frameInfo.PointerPosition.Visible != this->lastPointerVisible
|
frameInfo.PointerPosition.Visible != this->lastPointerVisible
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
pointer.positionUpdate = true;
|
|
||||||
|
|
||||||
/* the pointer position is invalid if the pointer is not visible */
|
/* the pointer position is invalid if the pointer is not visible */
|
||||||
if (frameInfo.PointerPosition.Visible)
|
if (frameInfo.PointerPosition.Visible)
|
||||||
{
|
{
|
||||||
this->lastPointerX = frameInfo.PointerPosition.Position.x;
|
pointer.positionUpdate = true;
|
||||||
this->lastPointerY = frameInfo.PointerPosition.Position.y;
|
pointer.x =
|
||||||
|
this->lastPointerX =
|
||||||
|
frameInfo.PointerPosition.Position.x;
|
||||||
|
pointer.y =
|
||||||
|
this->lastPointerY =
|
||||||
|
frameInfo.PointerPosition.Position.y;
|
||||||
}
|
}
|
||||||
this->lastPointerVisible = frameInfo.PointerPosition.Visible;
|
|
||||||
|
|
||||||
pointer.x = this->lastPointerX;
|
pointer.visible =
|
||||||
pointer.y = this->lastPointerY;
|
this->lastPointerVisible =
|
||||||
pointer.visible = this->lastPointerVisible;
|
frameInfo.PointerPosition.Visible;
|
||||||
postPointer = true;
|
postPointer = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -325,11 +325,13 @@ void capturePostPointerBuffer(CapturePointer pointer)
|
|||||||
if (pointer.positionUpdate)
|
if (pointer.positionUpdate)
|
||||||
{
|
{
|
||||||
flags |= CURSOR_FLAG_POSITION;
|
flags |= CURSOR_FLAG_POSITION;
|
||||||
cursor->x = pointer.x;
|
cursor->x = pointer.x;
|
||||||
cursor->y = pointer.y;
|
cursor->y = pointer.y;
|
||||||
cursor->visible = pointer.visible;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pointer.visible)
|
||||||
|
flags |= CURSOR_FLAG_VISIBLE;
|
||||||
|
|
||||||
if (pointer.shapeUpdate)
|
if (pointer.shapeUpdate)
|
||||||
{
|
{
|
||||||
// remember which slot has the latest shape
|
// remember which slot has the latest shape
|
||||||
|
@ -300,11 +300,13 @@ static int cursorThread(void * unused)
|
|||||||
|
|
||||||
KVMFRCursor * cursor = (KVMFRCursor *)msg.mem;
|
KVMFRCursor * cursor = (KVMFRCursor *)msg.mem;
|
||||||
|
|
||||||
|
state.cursorVisible =
|
||||||
|
msg.udata & CURSOR_FLAG_VISIBLE;
|
||||||
|
|
||||||
if (msg.udata & CURSOR_FLAG_POSITION)
|
if (msg.udata & CURSOR_FLAG_POSITION)
|
||||||
{
|
{
|
||||||
state.cursor.x = cursor->x;
|
state.cursor.x = cursor->x;
|
||||||
state.cursor.y = cursor->y;
|
state.cursor.y = cursor->y;
|
||||||
state.cursorVisible = cursor->visible;
|
|
||||||
state.haveCursorPos = true;
|
state.haveCursorPos = true;
|
||||||
|
|
||||||
if (!state.haveAligned && state.haveSrcSize && state.haveCurLocal)
|
if (!state.haveAligned && state.haveSrcSize && state.haveCurLocal)
|
||||||
|
@ -37,7 +37,8 @@ FrameType;
|
|||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
CURSOR_FLAG_POSITION = 0x1,
|
CURSOR_FLAG_POSITION = 0x1,
|
||||||
CURSOR_FLAG_SHAPE = 0x2
|
CURSOR_FLAG_VISIBLE = 0x2,
|
||||||
|
CURSOR_FLAG_SHAPE = 0x4
|
||||||
};
|
};
|
||||||
typedef uint32_t KVMFRCursorFlags;
|
typedef uint32_t KVMFRCursorFlags;
|
||||||
|
|
||||||
@ -52,7 +53,6 @@ CursorType;
|
|||||||
typedef struct KVMFRCursor
|
typedef struct KVMFRCursor
|
||||||
{
|
{
|
||||||
int16_t x, y; // cursor x & y position
|
int16_t x, y; // cursor x & y position
|
||||||
bool visible; // cursor visible
|
|
||||||
CursorType type; // shape buffer data type
|
CursorType type; // shape buffer data type
|
||||||
uint32_t width; // width of the shape
|
uint32_t width; // width of the shape
|
||||||
uint32_t height; // height of the shape
|
uint32_t height; // height of the shape
|
||||||
|
Loading…
Reference in New Issue
Block a user