diff options
author | Gustavo Pichorim Boiko <boiko@mandriva.com> | 2009-10-27 17:16:11 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-10-27 17:16:11 (GMT) |
commit | 0313ccbfaff690c5a8fc18a3a2c7d976a4a55aaf (patch) | |
tree | 0a009f54f916b8185d4f52a0d9bc0364915a46b1 /src | |
parent | 6c8c1c5322a26d789165783d7df3e29c672690cb (diff) | |
download | Qt-0313ccbfaff690c5a8fc18a3a2c7d976a4a55aaf.zip Qt-0313ccbfaff690c5a8fc18a3a2c7d976a4a55aaf.tar.gz Qt-0313ccbfaff690c5a8fc18a3a2c7d976a4a55aaf.tar.bz2 |
Emit workAreaResized() in X11 when it changes
Emit the QDesktopWidget::workAreaResized() signal when the _NET_WORKAREA
property of the root window changes.
Merge-request: 1111
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qapplication_x11.cpp | 6 | ||||
-rw-r--r-- | src/gui/kernel/qdesktopwidget_x11.cpp | 9 |
2 files changed, 6 insertions, 9 deletions
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index bf95684..c6d188b 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -3750,6 +3750,12 @@ int QApplication::x11ProcessEvent(XEvent* event) qt_get_net_virtual_roots(); } else if (event->xproperty.atom == ATOM(_NET_WORKAREA)) { qt_desktopwidget_update_workarea(); + + // emit the workAreaResized() signal + QDesktopWidget *desktop = QApplication::desktop(); + int numScreens = desktop->numScreens(); + for (int i = 0; i < numScreens; ++i) + emit desktop->workAreaResized(i); } } else if (widget) { widget->translatePropertyEvent(event); diff --git a/src/gui/kernel/qdesktopwidget_x11.cpp b/src/gui/kernel/qdesktopwidget_x11.cpp index 02a2c82..14eb976 100644 --- a/src/gui/kernel/qdesktopwidget_x11.cpp +++ b/src/gui/kernel/qdesktopwidget_x11.cpp @@ -384,10 +384,8 @@ 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(); @@ -397,13 +395,6 @@ void QDesktopWidget::resizeEvent(QResizeEvent *event) 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); } |