def stop(self): """ Stop this recorder. """ if not self.isRunning(): return self._started.wait() xrecord.disable_context(Display.from_qt(), self._context) # immediately process the end of data event. This allows us to wait # for this thread to terminate in the next line, thus making this # method synchronous. QApplication.instance().processEvents() self.wait() self._started.clear()
def handler(signum, frame): with Display.from_name() as display: xrecord.disable_context(display, context)