From 1a9346f62ca5c6af81bb32aadefd3c97125ae1da Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Tue, 25 Oct 2011 23:48:16 -0700 Subject: [PATCH] XQuartz: applewm: Correct byte swapping in event notifications Signed-off-by: Jeremy Huddleston (cherry picked from commit d5fee2b638fabeb8bec31a24e57d5c2a232d0893) --- hw/xquartz/applewm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c index ec20534e0..e52094b7e 100644 --- a/hw/xquartz/applewm.c +++ b/hw/xquartz/applewm.c @@ -727,10 +727,12 @@ AppleWMExtensionInit( NULL, StandardMinorOpcode))) { + size_t i; WMReqCode = (unsigned char)extEntry->base; WMErrorBase = extEntry->errorBase; WMEventBase = extEntry->eventBase; - EventSwapVector[WMEventBase] = (EventSwapPtr) SNotifyEvent; + for (i=0; i < AppleWMNumberEvents; i++) + EventSwapVector[WMEventBase + i] = (EventSwapPtr) SNotifyEvent; appleWMProcs = procsPtr; } }