mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-20 10:13:17 +00:00
Updated Mouse Cursor Capture, to process NULL Atoms
This commit is contained in:
@@ -699,26 +699,26 @@ void* kvm_server_mainloop(void* parm)
|
|||||||
x11_exports->XNextEvent(cursordisplay, &XE);
|
x11_exports->XNextEvent(cursordisplay, &XE);
|
||||||
if (XE.type == (event_base + 1))
|
if (XE.type == (event_base + 1))
|
||||||
{
|
{
|
||||||
|
char buffer[8];
|
||||||
|
Atom cursor_atom = NULL;
|
||||||
if (sizeof(void*) == 8)
|
if (sizeof(void*) == 8)
|
||||||
{
|
{
|
||||||
// 64bit
|
// 64bit
|
||||||
if (((uint64_t*)((char*)&XE + 64))[0] == 0)
|
if (((uint64_t*)((char*)&XE + 64))[0] != 0)
|
||||||
{
|
{
|
||||||
continue; // Atom is NULL
|
cursor_atom = ((Atom*)((char*)&XE + 64))[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// 32bit
|
// 32bit
|
||||||
if (((uint32_t*)((char*)&XE + 32))[0] == 0)
|
if (((uint32_t*)((char*)&XE + 32))[0] != 0)
|
||||||
{
|
{
|
||||||
continue; // Atom is NULL
|
cursor_atom = ((Atom*)((char*)&XE + 32))[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
char buffer[8];
|
char *name = cursor_atom != NULL ? (x11_exports->XGetAtomName(cursordisplay, cursor_atom)) : NULL;
|
||||||
Atom cursor_atom = ((Atom*)((char*)&XE + (sizeof(void*) == 8 ? 64 : 32)))[0];
|
|
||||||
char *name = x11_exports->XGetAtomName(cursordisplay, cursor_atom);
|
|
||||||
int curcursor = KVM_MouseCursor_HELP;
|
int curcursor = KVM_MouseCursor_HELP;
|
||||||
|
|
||||||
if (name != NULL)
|
if (name != NULL)
|
||||||
|
|||||||
Reference in New Issue
Block a user