From 6e84a8f0d93f178611a40917fec92648e956fe38 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Thu, 1 Oct 2009 19:55:57 -0700 Subject: Store DirectFB winID as a dynamic property Since QWS uses the winids for its own purposes I have to store this as a dynamic property. _q_DirectFBWindowID The _q_ is documented to be reserved so this won't break anyone's applications. Reviewed-by: Donald Carr --- src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp index 27ec668..3fbefc3 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp @@ -168,6 +168,16 @@ void QDirectFBWindowSurface::createWindow(const QRect &rect) if (result != DFB_OK) DirectFBErrorFatal("QDirectFBWindowSurface::createWindow", result); + if (window()) { + DFBWindowID winid; + result = dfbWindow->GetID(dfbWindow, &winid); + if (result != DFB_OK) { + DirectFBError("QDirectFBWindowSurface::createWindow. Can't get ID", result); + } else { + window()->setProperty("_q_DirectFBWindowID", winid); + } + } + Q_ASSERT(!dfbSurface); dfbWindow->GetSurface(dfbWindow, &dfbSurface); updateFormat(); @@ -220,6 +230,9 @@ void QDirectFBWindowSurface::setGeometry(const QRect &rect) if (rect.isNull()) { #ifndef QT_NO_DIRECTFB_WM if (dfbWindow) { + if (window()) + window()->setProperty("_q_DirectFBWindowID", QVariant()); + dfbWindow->Release(dfbWindow); dfbWindow = 0; } -- cgit v0.12