-    wxLogTrace(TRACE_EVENTS, wxT("Wake up pipe (%d, %d) created"),
-               fdRead, m_pipe[wxPipe::Write]);
+    // This is a bit ugly but we know that AddSourceForFD() used the currently
+    // active dispatcher to register this source, so use the same one for our
+    // other operations. Of course, currently the dispatcher returned by
+    // wxFDIODispatcher::Get() is always the same one anyhow so it doesn't
+    // really matter, but if we started returning different things later, it
+    // would.
+    m_dispatcher = wxFDIODispatcher::Get();