diff --git a/src/plugins/platforms/directfb/qdirectfbconvenience.cpp b/src/plugins/platforms/directfb/qdirectfbconvenience.cpp index 912e742dda..5f580b0473 100644 --- a/src/plugins/platforms/directfb/qdirectfbconvenience.cpp +++ b/src/plugins/platforms/directfb/qdirectfbconvenience.cpp @@ -386,3 +386,8 @@ QDirectFbScreen *toDfbScreen(QWindow *window) { return static_cast(window->screen()->handle()); } + +IDirectFBDisplayLayer *toDfbLayer(QPlatformScreen *screen) +{ + return static_cast(screen)->dfbLayer(); +} diff --git a/src/plugins/platforms/directfb/qdirectfbconvenience.h b/src/plugins/platforms/directfb/qdirectfbconvenience.h index 39409ac6bd..db73b0c247 100644 --- a/src/plugins/platforms/directfb/qdirectfbconvenience.h +++ b/src/plugins/platforms/directfb/qdirectfbconvenience.h @@ -51,6 +51,7 @@ class QDirectFbScreen; +class QPlatformScreen; class QDirectFbKeyMap: public QHash { @@ -111,5 +112,6 @@ public: // Helper conversions from internal to DFB types QDirectFbScreen *toDfbScreen(QWindow *window); +IDirectFBDisplayLayer *toDfbLayer(QPlatformScreen *screen); #endif // QDIRECTFBCONVENIENCE_H diff --git a/src/plugins/platforms/directfb/qdirectfbcursor.cpp b/src/plugins/platforms/directfb/qdirectfbcursor.cpp index 123d69c58e..8698f9ccf9 100644 --- a/src/plugins/platforms/directfb/qdirectfbcursor.cpp +++ b/src/plugins/platforms/directfb/qdirectfbcursor.cpp @@ -46,7 +46,6 @@ QDirectFBCursor::QDirectFBCursor(QPlatformScreen *screen) : QPlatformCursor(screen) { - QDirectFbConvenience::dfbInterface()->GetDisplayLayer(QDirectFbConvenience::dfbInterface(),DLID_PRIMARY, m_layer.outPtr()); m_image.reset(new QPlatformCursorImage(0, 0, 0, 0, 0, 0)); } @@ -69,11 +68,16 @@ void QDirectFBCursor::changeCursor(QCursor *cursor, QWindow *) map = cursor->pixmap(); } + DFBResult res; + IDirectFBDisplayLayer *layer = toDfbLayer(screen); IDirectFBSurface* surface(QDirectFbConvenience::dfbSurfaceForPlatformPixmap(map.handle())); - if (m_layer->SetCooperativeLevel(m_layer.data(), DLSCL_ADMINISTRATIVE) != DFB_OK) { + res = layer->SetCooperativeLevel(layer, DLSCL_ADMINISTRATIVE); + if (res != DFB_OK) { + DirectFBError("Failed to set DLSCL_ADMINISTRATIVE", res); return; } - m_layer->SetCursorShape(m_layer.data(), surface, xSpot, ySpot); - m_layer->SetCooperativeLevel(m_layer.data(), DLSCL_SHARED); + + layer->SetCursorShape(layer, surface, xSpot, ySpot); + layer->SetCooperativeLevel(layer, DLSCL_SHARED); } diff --git a/src/plugins/platforms/directfb/qdirectfbcursor.h b/src/plugins/platforms/directfb/qdirectfbcursor.h index b2c8f10b53..1a038cf456 100644 --- a/src/plugins/platforms/directfb/qdirectfbcursor.h +++ b/src/plugins/platforms/directfb/qdirectfbcursor.h @@ -57,7 +57,6 @@ public: void changeCursor(QCursor *cursor, QWindow *window); private: - QDirectFBPointer m_layer; QScopedPointer m_image; };