summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/directfb/qdirectfbinput.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/directfb/qdirectfbinput.cpp')
-rw-r--r--src/plugins/platforms/directfb/qdirectfbinput.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/plugins/platforms/directfb/qdirectfbinput.cpp b/src/plugins/platforms/directfb/qdirectfbinput.cpp
index d05729b992..bedd3b8356 100644
--- a/src/plugins/platforms/directfb/qdirectfbinput.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbinput.cpp
@@ -50,35 +50,29 @@
#include <directfb.h>
-QDirectFbInput::QDirectFbInput(QObject *parent)
- : QObject(parent), m_shouldStop(false)
+QDirectFbInput::QDirectFbInput()
+ : m_dfbInterface(QDirectFbConvenience::dfbInterface())
+ , m_shouldStop(false)
{
- m_dfbInterface = QDirectFbConvenience::dfbInterface();
-
DFBResult ok = m_dfbInterface->CreateEventBuffer(m_dfbInterface,&m_eventBuffer);
if (ok != DFB_OK)
DirectFBError("Failed to initialise eventbuffer", ok);
m_dfbInterface->GetDisplayLayer(m_dfbInterface,DLID_PRIMARY, &m_dfbDisplayLayer);
-
}
-void QDirectFbInput::runInputEventLoop()
+void QDirectFbInput::run()
{
- while (true) {
- m_eventBuffer->WaitForEvent(m_eventBuffer);
- if (m_shouldStop) {
- m_waitStop.release();
- break;
- }
- handleEvents();
+ while (!m_shouldStop) {
+ if (m_eventBuffer->WaitForEvent(m_eventBuffer) == DFB_OK)
+ handleEvents();
}
}
void QDirectFbInput::stopInputEventLoop()
{
m_shouldStop = true;
- m_waitStop.acquire();
+ m_eventBuffer->WakeUp(m_eventBuffer);
}
void QDirectFbInput::addWindow(DFBWindowID id, QWindow *qt_window)