src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
branchRCL_3
changeset 4 3b1da2848fc7
parent 3 41300fa6a67c
child 7 3f74d0d4af4c
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp	Tue Feb 02 00:43:10 2010 +0200
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp	Fri Feb 19 23:40:16 2010 +0200
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 ** All rights reserved.
 ** Contact: Nokia Corporation (qt-info@nokia.com)
 **
@@ -1063,7 +1063,7 @@
 
 static inline QColor colorFromName(const QString &name)
 {
-    QRegExp rx("#([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])");
+    QRegExp rx(QLatin1String("#([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])"));
     rx.setCaseSensitivity(Qt::CaseInsensitive);
     if (rx.exactMatch(name)) {
         Q_ASSERT(rx.captureCount() == 4);
@@ -1278,7 +1278,14 @@
 #ifdef QT_NO_DIRECTFB_WM
         result = d_ptr->primarySurface->GetSize(d_ptr->primarySurface, &w, &h);
 #elif (Q_DIRECTFB_VERSION >= 0x010000)
-        result = d_ptr->dfbScreen->GetSize(d_ptr->dfbScreen, &w, &h);
+        IDirectFBSurface *layerSurface;
+        if (d_ptr->dfbLayer->GetSurface(d_ptr->dfbLayer, &layerSurface) != DFB_OK) {
+            result = layerSurface->GetSize(layerSurface, &w, &h);
+            layerSurface->Release(layerSurface);
+        }
+        if (w <= 0 || h <= 0) {
+            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"