summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qdesktopwidget_x11.cpp
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-07-31 11:52:57 +1000
committerWarwick Allison <warwick.allison@nokia.com>2009-07-31 11:52:57 +1000
commitaa9cf406d62004519ad54596e1c391f9a6439210 (patch)
treedd562b9c296981f2761b76623911be8496c7af84 /src/gui/kernel/qdesktopwidget_x11.cpp
parent987aec28b950e1c9817a20a9dd71afc071cd93ea (diff)
parent56b6a5924008ab5cdbae36e9662eddba923acd5e (diff)
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/gui/kernel/qdesktopwidget_x11.cpp')
-rw-r--r--src/gui/kernel/qdesktopwidget_x11.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/gui/kernel/qdesktopwidget_x11.cpp b/src/gui/kernel/qdesktopwidget_x11.cpp
index 59d3239f1..1555fc034 100644
--- a/src/gui/kernel/qdesktopwidget_x11.cpp
+++ b/src/gui/kernel/qdesktopwidget_x11.cpp
@@ -372,7 +372,32 @@ int QDesktopWidget::screenNumber(const QPoint &point) const
void QDesktopWidget::resizeEvent(QResizeEvent *event)
{
Q_D(QDesktopWidget);
+ int oldScreenCount = d->screenCount;
+ QVector<QRect> oldRects(oldScreenCount);
+ QVector<QRect> oldWorks(oldScreenCount);
+ for (int i = 0; i < oldScreenCount; ++i) {
+ oldRects[i] = d->rects[i];
+ oldWorks[i] = d->workareas[i];
+ }
+
d->init();
+
+ for (int i = 0; i < qMin(oldScreenCount, d->screenCount); ++i) {
+ if (oldRects.at(i) != d->rects[i])
+ emit resized(i);
+ }
+
+ // ### workareas are just reset by init, not filled with new values
+ // ### so this will not work correctly
+ for (int j = 0; j < qMin(oldScreenCount, d->screenCount); ++j) {
+ if (oldWorks.at(j) != d->workareas[j])
+ emit workAreaResized(j);
+ }
+
+ if (oldScreenCount != d->screenCount) {
+ emit screenCountChanged(d->screenCount);
+ }
+
qt_desktopwidget_workarea_dirty = true;
QWidget::resizeEvent(event);
}