diff options
author | Anders Bakken <anders.bakken@nokia.com> | 2009-12-18 18:06:48 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2009-12-23 13:28:06 (GMT) |
commit | d27006b2a853924a11aa2bc45590c2c5c5fcfafa (patch) | |
tree | dd07328c4f1270ecb1ffddc6a4e73e6293a66118 | |
parent | 0e03f6bbfd003d354c603a1a89b961e5f0d3769c (diff) | |
download | Qt-d27006b2a853924a11aa2bc45590c2c5c5fcfafa.zip Qt-d27006b2a853924a11aa2bc45590c2c5c5fcfafa.tar.gz Qt-d27006b2a853924a11aa2bc45590c2c5c5fcfafa.tar.bz2 |
Read QWS_SIZE from layer rather than screen
When running the X11 emulator of DirectFB IDirectFBScreen->GetSize
returns the size of the entire X11 Display, not the actual DirectFB
window.
We can read this from the primary layer instead and this value is
correct both on devices and on the desktop.
Reviewed-by: Donald Carr <donald.carr@nokia.com>
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp index 8126fca..bb26d29 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp @@ -1278,7 +1278,14 @@ bool QDirectFBScreen::connect(const QString &displaySpec) #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" |