From ee749827f049144298f690fb3b5d86ebfba829eb Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Fri, 20 Sep 2019 17:18:22 -0700 Subject: [PATCH] Fixed the previous Fix to work on FreeBSD --- meshcore/KVM/Linux/linux_kvm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/meshcore/KVM/Linux/linux_kvm.c b/meshcore/KVM/Linux/linux_kvm.c index 82dc1f9..f991ab2 100644 --- a/meshcore/KVM/Linux/linux_kvm.c +++ b/meshcore/KVM/Linux/linux_kvm.c @@ -700,13 +700,15 @@ void* kvm_server_mainloop(void* parm) if (XE.type == (event_base + 1)) { char buffer[8]; - Atom cursor_atom = (Atom)0; + char *name = NULL; + int curcursor = KVM_MouseCursor_HELP; + if (sizeof(void*) == 8) { // 64bit if (((uint64_t*)((char*)&XE + 64))[0] != 0) { - cursor_atom = ((Atom*)((char*)&XE + 64))[0]; + name = x11_exports->XGetAtomName(cursordisplay, ((Atom*)((char*)&XE + 64))[0]); } } else @@ -714,12 +716,10 @@ void* kvm_server_mainloop(void* parm) // 32bit if (((uint32_t*)((char*)&XE + 32))[0] != 0) { - cursor_atom = ((Atom*)((char*)&XE + 32))[0]; + name = x11_exports->XGetAtomName(cursordisplay, ((Atom*)((char*)&XE + 64))[0]); } } - char *name = cursor_atom != (Atom)0 ? (x11_exports->XGetAtomName(cursordisplay, cursor_atom)) : (Atom)0; - int curcursor = KVM_MouseCursor_HELP; if (name != NULL) {