From c0b75607e00e7db92c58bd9139134ac5edf74e81 Mon Sep 17 00:00:00 2001 From: "jinhyung.jo" Date: Thu, 26 Sep 2013 12:08:44 +0900 Subject: [PATCH] Don't handle DRI2 events on emulator XESetWireToEvent/XESetEventToWire can only set one event handler for a particular event. When libdri2 is used together with OpenGL on emulator all DRI2 events will go either to libdri2 or OpenGL whatever connects to DRI2 protocol last. OpenGL needs to handle all DRI2 events and libdri2 just skips them, so it's reasonable to not handle DRI2 events in libdri2 at all on emulator Change-Id: I854a42625465a7c649955673342931087623a799 Signed-off-by: Stanislav Vorobiov Signed-off-by: Jinhyung Jo --- packaging/libdri2.spec | 4 ++++ src/dri2.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/packaging/libdri2.spec b/packaging/libdri2.spec index e38f38d..a69b456 100644 --- a/packaging/libdri2.spec +++ b/packaging/libdri2.spec @@ -34,7 +34,11 @@ cp %{SOURCE1001} . %build +%ifarch %{ix86} +CFLAGS="$CFLAGS -D_EMUL_" %reconfigure --disable-static +%else %reconfigure --disable-static +%endif make %{?jobs:-j%jobs} %install diff --git a/src/dri2.c b/src/dri2.c index dfb091f..1701ad3 100755 --- a/src/dri2.c +++ b/src/dri2.c @@ -265,10 +265,12 @@ DRI2QueryVersion(Display * dpy, int *major, int *minor) break; } +#ifndef _EMUL_ for (i = 0; i < nevents; i++) { XESetWireToEvent (dpy, info->codes->first_event + i, DRI2WireToEvent); XESetEventToWire (dpy, info->codes->first_event + i, DRI2EventToWire); } +#endif return True; } -- 2.7.4