From 9358dd3d53ace574904434a8e432faf4b56a5d1b Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 13 Dec 2012 13:55:14 +1000 Subject: server/barriers: move selecting for barriers up in the class hierarchy Signed-off-by: Peter Hutterer --- tests/server/barriers-common.h | 14 ++++++++++++++ tests/server/barriers-notify.cpp | 12 ------------ 2 files changed, 14 insertions(+), 12 deletions(-) (limited to 'tests/server') diff --git a/tests/server/barriers-common.h b/tests/server/barriers-common.h index 1812d06..59b53d1 100644 --- a/tests/server/barriers-common.h +++ b/tests/server/barriers-common.h @@ -123,6 +123,20 @@ public: ASSERT_EQ(XIChangeHierarchy(dpy, &change, 1), Success) << "Couldn't attach device2 to the new master pointer."; } +#if HAVE_XI23 + virtual void SelectBarrierEvents(::Display *dpy, Window win) { + XIEventMask mask; + mask.deviceid = XIAllMasterDevices; + mask.mask_len = XIMaskLen(XI_LASTEVENT); + mask.mask = new unsigned char[mask.mask_len](); + XISetMask(mask.mask, XI_BarrierHit); + XISetMask(mask.mask, XI_BarrierLeave); + XISelectEvents(dpy, win, &mask, 1); + delete[] mask.mask; + XSync(dpy, False); + } +#endif + virtual void SetUpConfigAndLog() { config.AddDefaultScreenWithDriver(); config.AddInputSection("evdev", "--device1--", diff --git a/tests/server/barriers-notify.cpp b/tests/server/barriers-notify.cpp index f45f39f..714d112 100644 --- a/tests/server/barriers-notify.cpp +++ b/tests/server/barriers-notify.cpp @@ -104,18 +104,6 @@ public: SetDeviceValues(GetParam()); } - virtual void SelectBarrierEvents(::Display *dpy, Window win) { - XIEventMask mask; - mask.deviceid = XIAllMasterDevices; - mask.mask_len = XIMaskLen(XI_LASTEVENT); - mask.mask = new unsigned char[mask.mask_len](); - XISetMask(mask.mask, XI_BarrierHit); - XISetMask(mask.mask, XI_BarrierLeave); - XISelectEvents(dpy, win, &mask, 1); - delete[] mask.mask; - XSync(dpy, False); - } - virtual void SetDeviceValues(enum BarrierDeviceTestCombinations combination) { const char *source_dev; -- cgit v1.2.3