On 07/26/2012 03:40 PM, Peter Hutterer wrote:
From: Olivier Fourdan <ofour...@redhat.com>

WaitForDevice() can take an optional timeout parameter
but that timeout should be passed down to WaitForEventOfType()
and in turn to WaitForEvent()

Signed-off-by: Olivier Fourdan <ofour...@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutte...@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
---
  src/xserver.cpp |    4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/xserver.cpp b/src/xserver.cpp
index 6449954..bac89ea 100644
--- a/src/xserver.cpp
+++ b/src/xserver.cpp
@@ -125,7 +125,7 @@ bool xorg::testing::XServer::WaitForEvent(::Display 
*display, time_t timeout)
  bool xorg::testing::XServer::WaitForEventOfType(::Display *display, int type, 
int extension,
                                                  int evtype, time_t timeout)
  {
-    while (WaitForEvent(display)) {
+    while (WaitForEvent(display), timeout) {
          XEvent event;
          if (!XPeekEvent(display, &event))
              throw std::runtime_error("Failed to peek X event");
@@ -169,7 +169,7 @@ bool xorg::testing::XServer::WaitForDevice(::Display 
*display, const std::string
          throw std::runtime_error("Failed to query XInput extension");

      while (WaitForEventOfType(display, GenericEvent, opcode,
-                              XI_HierarchyChanged)) {
+                              XI_HierarchyChanged, timeout)) {
          XEvent event;
          if (XNextEvent(display, &event) != Success)
              throw std::runtime_error("Failed to get X event");

Ahh, nuts... Right after I released it...

Reviewed-by: Chase Douglas <chase.doug...@canonical.com>

I'll let it sit for a bit before releasing a point release in case we find any other nuggets.

Thanks!
_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to