summaryrefslogtreecommitdiffstats
path: root/src/plugins/gfxdrivers
diff options
context:
space:
mode:
authorAnders Bakken <anders.bakken@nokia.com>2009-09-02 20:53:59 (GMT)
committerAnders Bakken <anders.bakken@nokia.com>2009-09-02 21:49:51 (GMT)
commit3b47ace59075c11705069f1e5b1b346a0341457a (patch)
treec2d81c798bef7c79a0a17c80808067dd093c3305 /src/plugins/gfxdrivers
parent9c244f6cf29dba9e6b3283cbd5dec2174a20907c (diff)
downloadQt-3b47ace59075c11705069f1e5b1b346a0341457a.zip
Qt-3b47ace59075c11705069f1e5b1b346a0341457a.tar.gz
Qt-3b47ace59075c11705069f1e5b1b346a0341457a.tar.bz2
Support Windowed mode for DFB < 1.0
DirectFB doesn't let you query the size of the Display in versions prior to 1.0. In this version require people to specify the size using QWS_SIZE, QWS_DISPLAY or print a warning and exit. Reviewed-by: Donald Carr <donald.carr@nokia.com>
Diffstat (limited to 'src/plugins/gfxdrivers')
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
index 15d982d..e9278ec 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
@@ -1192,18 +1192,6 @@ bool QDirectFBScreen::connect(const QString &displaySpec)
lstep = 0;
size = 0;
-#ifndef QT_NO_DIRECTFB_LAYER
- result = d_ptr->dfb->GetDisplayLayer(d_ptr->dfb, DLID_PRIMARY,
- &d_ptr->dfbLayer);
- if (result != DFB_OK) {
- DirectFBError("QDirectFBScreen::connect: "
- "Unable to get primary display layer!", result);
- return false;
- }
- result = d_ptr->dfbLayer->GetScreen(d_ptr->dfbLayer, &d_ptr->dfbScreen);
-#else
- result = d_ptr->dfb->GetScreen(d_ptr->dfb, 0, &d_ptr->dfbScreen);
-#endif
if (result != DFB_OK) {
DirectFBError("QDirectFBScreen::connect: "
"Unable to get screen!", result);
@@ -1231,11 +1219,30 @@ bool QDirectFBScreen::connect(const QString &displaySpec)
setIntOption(displayArgs, QLatin1String("width"), &w);
setIntOption(displayArgs, QLatin1String("height"), &h);
+#ifndef QT_NO_DIRECTFB_LAYER
+ result = d_ptr->dfb->GetDisplayLayer(d_ptr->dfb, DLID_PRIMARY,
+ &d_ptr->dfbLayer);
+ if (result != DFB_OK) {
+ DirectFBError("QDirectFBScreen::connect: "
+ "Unable to get primary display layer!", result);
+ return false;
+ }
+ result = d_ptr->dfbLayer->GetScreen(d_ptr->dfbLayer, &d_ptr->dfbScreen);
+#else
+ result = d_ptr->dfb->GetScreen(d_ptr->dfb, 0, &d_ptr->dfbScreen);
+#endif
+
if (w <= 0 || h <= 0) {
#ifdef QT_NO_DIRECTFB_WM
result = d_ptr->primarySurface->GetSize(d_ptr->primarySurface, &w, &h);
-#else
+#elif (Q_DIRECTFB_VERSION >= 0x010000)
result = d_ptr->dfbScreen->GetSize(d_ptr->dfbScreen, &w, &h);
+#else
+ qWarning("QDirectFBScreen::connect: DirectFB versions prior to 1.0 do not offer a way\n"
+ "query the size of the primary surface in windowed mode. You have to specify\n"
+ "the size of the display using QWS_SIZE=[0-9]x[0-9] or\n"
+ "QWS_DISPLAY=directfb:width=[0-9]:height=[0-9]");
+ return false;
#endif
if (result != DFB_OK) {
DirectFBError("QDirectFBScreen::connect: "