summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowswindow.cpp
diff options
context:
space:
mode:
authorSergio Ahumada <sergio.ahumada@digia.com>2013-09-02 15:07:53 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-02 16:26:21 +0200
commit0a3eb0fe443f8158d81d97cde8f0c9a9632fb9f0 (patch)
tree7bbdc72a7e30e23fc66a610ff7e3cd298711e5b1 /src/plugins/platforms/windows/qwindowswindow.cpp
parentcee7380c0470dc591e2aafb3225641d4194ab05c (diff)
parent190fa97c83472863fd886e86f626ab8196ed51b3 (diff)
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp39
1 files changed, 32 insertions, 7 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index b3b07cc8dd..f3faccbc14 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -549,6 +549,18 @@ QWindowsWindow::WindowData
qDebug().nospace() << "Created desktop window " << w << result.hwnd;
return result;
}
+ if ((flags & Qt::WindowType_Mask) == Qt::ForeignWindow) {
+ result.hwnd = reinterpret_cast<HWND>(w->winId());
+ Q_ASSERT(result.hwnd);
+ const LONG_PTR style = GetWindowLongPtr(result.hwnd, GWL_STYLE);
+ const LONG_PTR exStyle = GetWindowLongPtr(result.hwnd, GWL_EXSTYLE);
+ result.geometry = frameGeometry(result.hwnd, !GetParent(result.hwnd));
+ result.frame = QWindowsGeometryHint::frame(style, exStyle);
+ result.embedded = false;
+ if (QWindowsContext::verboseWindows)
+ qDebug() << "Foreign window: " << w << result.hwnd << result.geometry << result.frame;
+ return result;
+ }
const HINSTANCE appinst = (HINSTANCE)GetModuleHandle(0);
@@ -962,7 +974,7 @@ void QWindowsWindow::destroyWindow()
}
}
#endif // !Q_OS_WINCE
- if (m_data.hwnd != GetDesktopWindow())
+ if (m_data.hwnd != GetDesktopWindow() && window()->type() != Qt::ForeignWindow)
DestroyWindow(m_data.hwnd);
context->removeWindow(m_data.hwnd);
m_data.hwnd = 0;
@@ -1483,14 +1495,27 @@ void QWindowsWindow::handleWindowStateChange(Qt::WindowState state)
handleHidden();
QWindowSystemInterface::flushWindowSystemEvents(); // Tell QQuickWindow to stop rendering now.
break;
- case Qt::WindowNoState:
+ case Qt::WindowNoState: {
// QTBUG-17548: We send expose events when receiving WM_Paint, but for
- // layered windows, we won't receive any WM_Paint.
- if (GetWindowLongPtr(m_data.hwnd, GWL_EXSTYLE) & WS_EX_LAYERED) {
- fireExpose(QRegion(0, 0, window()->width(), window()->height()));
- if (!QWindowsContext::instance()->asyncExpose())
- QWindowSystemInterface::flushWindowSystemEvents();
+ // layered windows and transient children, we won't receive any WM_Paint.
+ QWindow *w = window();
+ bool exposeEventsSent = false;
+ if (isLayered()) {
+ fireExpose(QRegion(0, 0, w->width(), w->height()));
+ exposeEventsSent = true;
}
+ foreach (QWindow *child, QGuiApplication::allWindows()) {
+ if (child != w && child->isVisible() && child->transientParent() == w) {
+ QWindowsWindow *platformWindow = QWindowsWindow::baseWindowOf(child);
+ if (platformWindow->isLayered()) {
+ platformWindow->fireExpose(QRegion(0, 0, child->width(), child->height()));
+ exposeEventsSent = true;
+ }
+ }
+ }
+ if (exposeEventsSent && !QWindowsContext::instance()->asyncExpose())
+ QWindowSystemInterface::flushWindowSystemEvents();
+ }
break;
default:
break;