summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2013-07-09 09:17:37 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-13 09:13:37 (GMT)
commitad4c35da48286ecf78ebc4eac539a7c70e2a15a1 (patch)
treead476bd4c54e4e27002193e8aa4328e66bc42c12
parent4afde6f85050cc3e9267947999dc55918b1bd36c (diff)
downloadQt-ad4c35da48286ecf78ebc4eac539a7c70e2a15a1.zip
Qt-ad4c35da48286ecf78ebc4eac539a7c70e2a15a1.tar.gz
Qt-ad4c35da48286ecf78ebc4eac539a7c70e2a15a1.tar.bz2
Consider virtual screen when determining dock widget visibility.
Task-number: QTBUG-32260 Change-Id: I8b28e3869a6e3b1ed12a311dfa0100979098fc4b Reviewed-by: Andy Shaw <andy.shaw@digia.com> (cherry picked from qtbase/6c37fb70d695df001999c78a27ca50d6d2ac6517)
-rw-r--r--src/gui/widgets/qdockwidget.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/widgets/qdockwidget.cpp b/src/gui/widgets/qdockwidget.cpp
index bb585b1..281988c 100644
--- a/src/gui/widgets/qdockwidget.cpp
+++ b/src/gui/widgets/qdockwidget.cpp
@@ -1409,9 +1409,12 @@ bool QDockWidget::event(QEvent *event)
d->toggleViewAction->setChecked(false);
emit visibilityChanged(false);
break;
- case QEvent::Show:
+ case QEvent::Show: {
d->toggleViewAction->setChecked(true);
- emit visibilityChanged(geometry().right() >= 0 && geometry().bottom() >= 0);
+ const QPoint parentTopLeft = isWindow() ?
+ QApplication::desktop()->availableGeometry(this).topLeft() : QPoint(0, 0);
+ emit visibilityChanged(geometry().right() >= parentTopLeft.x() && geometry().bottom() >= parentTopLeft.y());
+}
break;
#endif
case QEvent::ApplicationLayoutDirectionChange: