diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-06-10 12:40:29 +0200 |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-06-10 12:40:56 +0200 |
commit | 6b0cd62e5ecad075c4528d3a09ec903ab057680e (patch) | |
tree | daa08ef647df36a774c5ce78738dffb9c2d154bf /src/widgets/kernel/qwidgetwindow_qpa.cpp | |
parent | f56a905ced02b387f6ac7f482f997629f27bcf89 (diff) |
Added frameMargins() API and support in XCB plugin.
Diffstat (limited to 'src/widgets/kernel/qwidgetwindow_qpa.cpp')
-rw-r--r-- | src/widgets/kernel/qwidgetwindow_qpa.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/widgets/kernel/qwidgetwindow_qpa.cpp b/src/widgets/kernel/qwidgetwindow_qpa.cpp index 786293a716..27f9c9e2f8 100644 --- a/src/widgets/kernel/qwidgetwindow_qpa.cpp +++ b/src/widgets/kernel/qwidgetwindow_qpa.cpp @@ -266,9 +266,20 @@ void QWidgetWindow::handleKeyEvent(QKeyEvent *event) QGuiApplication::sendSpontaneousEvent(widget, event); } +void QWidgetWindow::updateGeometry() +{ + if (m_widget->testAttribute(Qt::WA_OutsideWSRange)) + return; + + QMargins margins = frameMargins(); + + m_widget->data->crect = geometry().translated(-margins.left(), -margins.top()); + m_widget->d_func()->topData()->frameStrut.setCoords(margins.left(), margins.top(), margins.right(), margins.bottom()); +} + void QWidgetWindow::handleMoveEvent(QMoveEvent *event) { - m_widget->data->crect = geometry(); + updateGeometry(); QGuiApplication::sendSpontaneousEvent(m_widget, event); } @@ -276,7 +287,7 @@ void QWidgetWindow::handleResizeEvent(QResizeEvent *event) { QSize oldSize = m_widget->data->crect.size(); - m_widget->data->crect = geometry(); + updateGeometry(); QGuiApplication::sendSpontaneousEvent(m_widget, event); if (m_widget->d_func()->paintOnScreen()) { |