summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget_x11.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-03-01 07:57:03 (GMT)
committerLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-03-01 07:57:03 (GMT)
commite538957c77f71b1cc38a3c43c9f3157f65a3ff11 (patch)
tree3d013b12ba28668d127fe5532de5fc588fe63cb0 /src/gui/kernel/qwidget_x11.cpp
parent67d5513b5aca096dfc33952cf81219087b0e41b0 (diff)
parent2653c4fcf42ec93db16a299c29c9fe0f98680c75 (diff)
downloadQt-e538957c77f71b1cc38a3c43c9f3157f65a3ff11.zip
Qt-e538957c77f71b1cc38a3c43c9f3157f65a3ff11.tar.gz
Qt-e538957c77f71b1cc38a3c43c9f3157f65a3ff11.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt into 4.7
Conflicts: src/s60installs/bwins/QtGuiu.def src/s60installs/eabi/QtGuiu.def
Diffstat (limited to 'src/gui/kernel/qwidget_x11.cpp')
-rw-r--r--src/gui/kernel/qwidget_x11.cpp32
1 files changed, 3 insertions, 29 deletions
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index 9893478..b0375ef 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -444,6 +444,7 @@ static QVector<Atom> getNetWmState(QWidget *w)
&& actualType == XA_ATOM && actualFormat == 32) {
returnValue.resize(bytesLeft / 4);
XFree((char*) propertyData);
+ propertyData = 0;
// fetch all data
if (XGetWindowProperty(X11->display, w->internalWinId(), ATOM(_NET_WM_STATE), 0,
@@ -458,7 +459,8 @@ static QVector<Atom> getNetWmState(QWidget *w)
if (!returnValue.isEmpty()) {
memcpy(returnValue.data(), propertyData, returnValue.size() * sizeof(Atom));
}
- XFree((char*) propertyData);
+ if (propertyData)
+ XFree((char*) propertyData);
}
return returnValue;
@@ -1316,40 +1318,12 @@ QPoint QWidgetPrivate::mapFromGlobal(const QPoint &pos) const
QPoint QWidget::mapToGlobal(const QPoint &pos) const
{
Q_D(const QWidget);
- QPoint offset = data->crect.topLeft();
- const QWidget *w = this;
- const QWidget *p = w->parentWidget();
- while (!w->isWindow() && p) {
- w = p;
- p = p->parentWidget();
- offset += w->data->crect.topLeft();
- }
-
- const QWidgetPrivate *wd = w->d_func();
- QTLWExtra *tlw = wd->topData();
- if (!tlw->embedded)
- return pos + offset;
-
return d->mapToGlobal(pos);
}
QPoint QWidget::mapFromGlobal(const QPoint &pos) const
{
Q_D(const QWidget);
- QPoint offset = data->crect.topLeft();
- const QWidget *w = this;
- const QWidget *p = w->parentWidget();
- while (!w->isWindow() && p) {
- w = p;
- p = p->parentWidget();
- offset += w->data->crect.topLeft();
- }
-
- const QWidgetPrivate *wd = w->d_func();
- QTLWExtra *tlw = wd->topData();
- if (!tlw->embedded)
- return pos - offset;
-
return d->mapFromGlobal(pos);
}