summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorAnders Bakken <anders.bakken@nokia.com>2009-09-02 20:16:57 (GMT)
committerAnders Bakken <anders.bakken@nokia.com>2009-09-02 21:49:51 (GMT)
commitb7b8a6c4665cf39334635e7b44a538572dc53a34 (patch)
tree744e8dbcd5838981d2d0e5ab95319dc2f59e9c9d /src/plugins
parent3b47ace59075c11705069f1e5b1b346a0341457a (diff)
downloadQt-b7b8a6c4665cf39334635e7b44a538572dc53a34.zip
Qt-b7b8a6c4665cf39334635e7b44a538572dc53a34.tar.gz
Qt-b7b8a6c4665cf39334635e7b44a538572dc53a34.tar.bz2
Create windows with the appropriate geometry
Since DirectFB allows for providing position and size on creation of windows we might as well use these fields rather than first create the surface and then resize it. Reviewed-by: Donald Carr <donald.carr@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp16
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h2
2 files changed, 12 insertions, 6 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
index 7abba81..9e0691d 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
@@ -119,7 +119,7 @@ void QDirectFBWindowSurface::raise()
}
}
-void QDirectFBWindowSurface::createWindow()
+void QDirectFBWindowSurface::createWindow(const QRect &rect)
{
IDirectFBDisplayLayer *layer = screen->dfbDisplayLayer();
if (!layer)
@@ -127,8 +127,12 @@ void QDirectFBWindowSurface::createWindow()
DFBWindowDescription description;
description.caps = DWCAPS_NODECORATION|DWCAPS_DOUBLEBUFFER;
- description.flags = DWDESC_CAPS|DWDESC_SURFACE_CAPS|DWDESC_PIXELFORMAT;
+ description.flags = DWDESC_CAPS|DWDESC_SURFACE_CAPS|DWDESC_PIXELFORMAT|DWDESC_HEIGHT|DWDESC_WIDTH|DWDESC_POSX|DWDESC_POSY;
+ description.posx = rect.x();
+ description.posy = rect.y();
+ description.width = rect.width();
+ description.height = rect.height();
description.surface_caps = DSCAPS_NONE;
if (screen->directFBFlags() & QDirectFBScreen::VideoOnly)
description.surface_caps |= DSCAPS_VIDEOONLY;
@@ -204,9 +208,11 @@ void QDirectFBWindowSurface::setGeometry(const QRect &rect)
DFBResult result = DFB_OK;
// If we're in a resize, the surface shouldn't be locked
#ifdef QT_DIRECTFB_WM
- if (!dfbWindow)
- createWindow();
- setWindowGeometry(dfbWindow, oldRect, rect);
+ if (!dfbWindow) {
+ createWindow(rect);
+ } else {
+ setWindowGeometry(dfbWindow, oldRect, rect);
+ }
#else
if (mode == Primary) {
if (dfbSurface && dfbSurface != primarySurface)
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h
index edecb14..7ae9bfe 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h
@@ -99,7 +99,7 @@ private:
QDirectFBWindowSurface *sibling;
#ifdef QT_DIRECTFB_WM
- void createWindow();
+ void createWindow(const QRect &rect);
IDirectFBWindow *dfbWindow;
#else
enum Mode {