summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qguiapplication.cpp2
-rw-r--r--src/gui/kernel/qplatformwindow.cpp16
2 files changed, 16 insertions, 2 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 698c26763a..ebb42ea498 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1070,6 +1070,8 @@ QGuiApplicationPrivate::~QGuiApplicationPrivate()
delete platform_integration;
platform_integration = 0;
delete m_gammaTables.load();
+
+ window_list.clear();
}
#if 0
diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp
index 01377d1aa0..88a82b12a3 100644
--- a/src/gui/kernel/qplatformwindow.cpp
+++ b/src/gui/kernel/qplatformwindow.cpp
@@ -196,7 +196,13 @@ bool QPlatformWindow::isEmbedded(const QPlatformWindow *parentWindow) const
*/
QPoint QPlatformWindow::mapToGlobal(const QPoint &pos) const
{
- return pos;
+ const QPlatformWindow *p = this;
+ QPoint result = pos;
+ while (p) {
+ result += p->geometry().topLeft();
+ p = p->parent();
+ }
+ return result;
}
/*!
@@ -208,7 +214,13 @@ QPoint QPlatformWindow::mapToGlobal(const QPoint &pos) const
*/
QPoint QPlatformWindow::mapFromGlobal(const QPoint &pos) const
{
- return pos;
+ const QPlatformWindow *p = this;
+ QPoint result = pos;
+ while (p) {
+ result -= p->geometry().topLeft();
+ p = p->parent();
+ }
+ return result;
}
/*!