summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/directfb/qdirectfb_egl.cpp4
-rw-r--r--src/plugins/platforms/directfb/qdirectfbintegration.cpp4
-rw-r--r--src/plugins/platforms/directfb/qdirectfbwindow.cpp28
-rw-r--r--src/plugins/platforms/directfb/qdirectfbwindow.h1
4 files changed, 21 insertions, 16 deletions
diff --git a/src/plugins/platforms/directfb/qdirectfb_egl.cpp b/src/plugins/platforms/directfb/qdirectfb_egl.cpp
index f595cc4286..65112a4ccd 100644
--- a/src/plugins/platforms/directfb/qdirectfb_egl.cpp
+++ b/src/plugins/platforms/directfb/qdirectfb_egl.cpp
@@ -203,7 +203,9 @@ EGLSurface QDirectFbEGLContext::eglSurfaceForPlatformSurface(QPlatformSurface *s
QPlatformWindow *QDirectFbIntegrationEGL::createPlatformWindow(QWindow *window) const
{
- return new QDirectFbWindowEGL(window, m_input.data());
+ QDirectFbWindow *dfbWindow = new QDirectFbWindowEGL(window, m_input.data());
+ dfbWindow->createDirectFBWindow();
+ return dfbWindow;
}
QPlatformOpenGLContext *QDirectFbIntegrationEGL::createPlatformOpenGLContext(QOpenGLContext *context) const
diff --git a/src/plugins/platforms/directfb/qdirectfbintegration.cpp b/src/plugins/platforms/directfb/qdirectfbintegration.cpp
index 834e7dace7..167fc7acfa 100644
--- a/src/plugins/platforms/directfb/qdirectfbintegration.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbintegration.cpp
@@ -124,7 +124,9 @@ QPlatformPixmap *QDirectFbIntegration::createPlatformPixmap(QPlatformPixmap::Pix
QPlatformWindow *QDirectFbIntegration::createPlatformWindow(QWindow *window) const
{
- return new QDirectFbWindow(window,m_input.data());
+ QDirectFbWindow *dfbWindow = new QDirectFbWindow(window, m_input.data());
+ dfbWindow->createDirectFBWindow();
+ return dfbWindow;
}
QAbstractEventDispatcher *QDirectFbIntegration::guiThreadEventDispatcher() const
diff --git a/src/plugins/platforms/directfb/qdirectfbwindow.cpp b/src/plugins/platforms/directfb/qdirectfbwindow.cpp
index e853b81f6f..4283cb9167 100644
--- a/src/plugins/platforms/directfb/qdirectfbwindow.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbwindow.cpp
@@ -53,41 +53,41 @@ QT_BEGIN_NAMESPACE
QDirectFbWindow::QDirectFbWindow(QWindow *tlw, QDirectFbInput *inputhandler)
: QPlatformWindow(tlw), m_inputHandler(inputhandler)
{
+}
+
+void QDirectFbWindow::createDirectFBWindow()
+{
+ Q_ASSERT(!m_dfbWindow.data());
+
DFBDisplayLayerConfig layerConfig;
IDirectFBDisplayLayer *layer;
- layer = toDfbScreen(tlw)->dfbLayer();
- toDfbScreen(tlw)->dfbLayer()->GetConfiguration(layer, &layerConfig);
+ layer = toDfbScreen(window())->dfbLayer();
+ layer->GetConfiguration(layer, &layerConfig);
DFBWindowDescription description;
memset(&description,0,sizeof(DFBWindowDescription));
description.flags = DFBWindowDescriptionFlags(DWDESC_WIDTH|DWDESC_HEIGHT|DWDESC_POSX|DWDESC_POSY|DWDESC_SURFACE_CAPS
-#if DIRECTFB_MINOR_VERSION >= 1
|DWDESC_OPTIONS
-#endif
|DWDESC_CAPS);
- description.width = qMax(1, tlw->width());
- description.height = qMax(1, tlw->height());
- description.posx = tlw->x();
- description.posy = tlw->y();
+ description.width = qMax(1, window()->width());
+ description.height = qMax(1, window()->height());
+ description.posx = window()->x();
+ description.posy = window()->y();
if (layerConfig.surface_caps & DSCAPS_PREMULTIPLIED)
description.surface_caps = DSCAPS_PREMULTIPLIED;
description.pixelformat = layerConfig.pixelformat;
-#if DIRECTFB_MINOR_VERSION >= 1
description.options = DFBWindowOptions(DWOP_ALPHACHANNEL);
-#endif
description.caps = DFBWindowCapabilities(DWCAPS_DOUBLEBUFFER|DWCAPS_ALPHACHANNEL);
DFBResult result = layer->CreateWindow(layer, &description, m_dfbWindow.outPtr());
- if (result != DFB_OK) {
+ if (result != DFB_OK)
DirectFBError("QDirectFbWindow: failed to create window", result);
- }
m_dfbWindow->SetOpacity(m_dfbWindow.data(), 0xff);
-
- m_inputHandler->addWindow(m_dfbWindow.data(), tlw);
+ m_inputHandler->addWindow(m_dfbWindow.data(), window());
}
QDirectFbWindow::~QDirectFbWindow()
diff --git a/src/plugins/platforms/directfb/qdirectfbwindow.h b/src/plugins/platforms/directfb/qdirectfbwindow.h
index bc9e4d9c4e..f02f937462 100644
--- a/src/plugins/platforms/directfb/qdirectfbwindow.h
+++ b/src/plugins/platforms/directfb/qdirectfbwindow.h
@@ -67,6 +67,7 @@ public:
void lower();
WId winId() const;
+ virtual void createDirectFBWindow();
IDirectFBWindow *dfbWindow() const;
// helper to get access to DirectFB types