mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 08:38:20 +00:00
[client] handle pointer visibility properly
This commit is contained in:
parent
2d755a45e0
commit
6f551c770c
@ -279,62 +279,46 @@ static int cursorThread(void * unused)
|
|||||||
KVMFRCursor * cursor = (KVMFRCursor *)msg.mem;
|
KVMFRCursor * cursor = (KVMFRCursor *)msg.mem;
|
||||||
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 this was only a move event
|
if (msg.udata == 1)
|
||||||
if (msg.udata == 0)
|
|
||||||
{
|
{
|
||||||
state.lgr->on_mouse_event
|
switch(cursor->type)
|
||||||
(
|
{
|
||||||
state.lgrData,
|
case CURSOR_TYPE_COLOR : cursorType = LG_CURSOR_COLOR ; break;
|
||||||
state.cursorVisible,
|
case CURSOR_TYPE_MONOCHROME : cursorType = LG_CURSOR_MONOCHROME ; break;
|
||||||
state.cursor.x,
|
case CURSOR_TYPE_MASKED_COLOR: cursorType = LG_CURSOR_MASKED_COLOR; break;
|
||||||
state.cursor.y
|
default:
|
||||||
);
|
DEBUG_ERROR("Invalid cursor type");
|
||||||
lgmpClientMessageDone(queue);
|
lgmpClientMessageDone(queue);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(cursor->type)
|
const uint8_t * data = (const uint8_t *)(cursor + 1);
|
||||||
{
|
if (!state.lgr->on_mouse_shape(
|
||||||
case CURSOR_TYPE_COLOR : cursorType = LG_CURSOR_COLOR ; break;
|
state.lgrData,
|
||||||
case CURSOR_TYPE_MONOCHROME : cursorType = LG_CURSOR_MONOCHROME ; break;
|
cursorType,
|
||||||
case CURSOR_TYPE_MASKED_COLOR: cursorType = LG_CURSOR_MASKED_COLOR; break;
|
cursor->width,
|
||||||
default:
|
cursor->height,
|
||||||
DEBUG_ERROR("Invalid cursor type");
|
cursor->pitch,
|
||||||
|
data)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
DEBUG_ERROR("Failed to update mouse shape");
|
||||||
lgmpClientMessageDone(queue);
|
lgmpClientMessageDone(queue);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint8_t * data = (const uint8_t *)(cursor + 1);
|
|
||||||
if (!state.lgr->on_mouse_shape(
|
|
||||||
state.lgrData,
|
|
||||||
cursorType,
|
|
||||||
cursor->width,
|
|
||||||
cursor->height,
|
|
||||||
cursor->pitch,
|
|
||||||
data)
|
|
||||||
)
|
|
||||||
{
|
|
||||||
DEBUG_ERROR("Failed to update mouse shape");
|
|
||||||
lgmpClientMessageDone(queue);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool showCursor = cursor->visible;
|
|
||||||
lgmpClientMessageDone(queue);
|
lgmpClientMessageDone(queue);
|
||||||
|
state.lgr->on_mouse_event
|
||||||
if (showCursor != state.cursorVisible)
|
(
|
||||||
{
|
state.lgrData,
|
||||||
state.cursorVisible = showCursor;
|
state.cursorVisible,
|
||||||
state.lgr->on_mouse_event
|
state.cursor.x,
|
||||||
(
|
state.cursor.y
|
||||||
state.lgrData,
|
);
|
||||||
state.cursorVisible,
|
|
||||||
state.cursor.x,
|
|
||||||
state.cursor.y
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lgmpClientUnsubscribe(&queue);
|
lgmpClientUnsubscribe(&queue);
|
||||||
|
Loading…
Reference in New Issue
Block a user