diff --git a/src/plugins/platforms/directfb/qdirectfbinput.cpp b/src/plugins/platforms/directfb/qdirectfbinput.cpp index bc3b6e820c..a844ef8969 100644 --- a/src/plugins/platforms/directfb/qdirectfbinput.cpp +++ b/src/plugins/platforms/directfb/qdirectfbinput.cpp @@ -50,15 +50,14 @@ #include -QDirectFbInput::QDirectFbInput() - : m_dfbInterface(QDirectFbConvenience::dfbInterface()) +QDirectFbInput::QDirectFbInput(IDirectFB *dfb, IDirectFBDisplayLayer *dfbLayer) + : m_dfbInterface(dfb) + , m_dfbDisplayLayer(dfbLayer) , m_shouldStop(false) { DFBResult ok = m_dfbInterface->CreateEventBuffer(m_dfbInterface, m_eventBuffer.outPtr()); if (ok != DFB_OK) DirectFBError("Failed to initialise eventbuffer", ok); - - m_dfbInterface->GetDisplayLayer(m_dfbInterface, DLID_PRIMARY, m_dfbDisplayLayer.outPtr()); } void QDirectFbInput::run() @@ -200,7 +199,7 @@ void QDirectFbInput::handleEnterLeaveEvents(const DFBEvent &event) inline QPoint QDirectFbInput::globalPoint(const DFBEvent &event) const { QDirectFBPointer window; - m_dfbDisplayLayer->GetWindow(m_dfbDisplayLayer.data() , event.window.window_id, window.outPtr()); + m_dfbDisplayLayer->GetWindow(m_dfbDisplayLayer, event.window.window_id, window.outPtr()); int x,y; window->GetPosition(window.data(), &x, &y); return QPoint(event.window.cx +x, event.window.cy + y); diff --git a/src/plugins/platforms/directfb/qdirectfbinput.h b/src/plugins/platforms/directfb/qdirectfbinput.h index 6d8cc25380..5641943970 100644 --- a/src/plugins/platforms/directfb/qdirectfbinput.h +++ b/src/plugins/platforms/directfb/qdirectfbinput.h @@ -55,7 +55,7 @@ class QDirectFbInput : public QThread { Q_OBJECT public: - QDirectFbInput(); + QDirectFbInput(IDirectFB *dfb, IDirectFBDisplayLayer *dfbLayer); void addWindow(IDirectFBWindow *window, QWindow *platformWindow); void removeWindow(IDirectFBWindow *window); @@ -74,7 +74,7 @@ private: IDirectFB *m_dfbInterface; - QDirectFBPointer m_dfbDisplayLayer; + IDirectFBDisplayLayer *m_dfbDisplayLayer; QDirectFBPointer m_eventBuffer; bool m_shouldStop; diff --git a/src/plugins/platforms/directfb/qdirectfbintegration.cpp b/src/plugins/platforms/directfb/qdirectfbintegration.cpp index bb729a6d19..73ea490110 100644 --- a/src/plugins/platforms/directfb/qdirectfbintegration.cpp +++ b/src/plugins/platforms/directfb/qdirectfbintegration.cpp @@ -88,7 +88,7 @@ QDirectFbIntegration::QDirectFbIntegration() m_primaryScreen.reset(new QDirectFbScreen(0)); screenAdded(m_primaryScreen.data()); - m_input.reset(new QDirectFbInput()); + m_input.reset(new QDirectFbInput(m_dfb.data(), m_primaryScreen->dfbLayer())); m_input->start(); }