1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-16 00:03:45 +00:00

Updated Mouse Cursor Capture, to process NULL Atoms

This commit is contained in:
Bryan Roe
2019-09-20 17:08:14 -07:00
parent 965b3d0783
commit 67c907b22c

View File

@@ -699,26 +699,26 @@ void* kvm_server_mainloop(void* parm)
x11_exports->XNextEvent(cursordisplay, &XE);
if (XE.type == (event_base + 1))
{
char buffer[8];
Atom cursor_atom = NULL;
if (sizeof(void*) == 8)
{
// 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
{
// 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];
Atom cursor_atom = ((Atom*)((char*)&XE + (sizeof(void*) == 8 ? 64 : 32)))[0];
char *name = x11_exports->XGetAtomName(cursordisplay, cursor_atom);
char *name = cursor_atom != NULL ? (x11_exports->XGetAtomName(cursordisplay, cursor_atom)) : NULL;
int curcursor = KVM_MouseCursor_HELP;
if (name != NULL)