summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/fbconvenience/qfbscreen.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>2013-02-04 17:03:38 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-12 12:25:22 +0100
commitfe6add818e2ab11fba3d9df12c29dfb29c65b2af (patch)
treeb406f88d53915a67853ddafe2b259ec9a261fedb /src/platformsupport/fbconvenience/qfbscreen.cpp
parent686dcce5fb2eef4adebfc2a247e96574ec062473 (diff)
Enablers in fbconvenience for Android port
Additions to make the convenience classes work for the Qt for Android port. Change-Id: I25ba0faf93c7e09ab04a3fa0784e04631e5ab036 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/platformsupport/fbconvenience/qfbscreen.cpp')
-rw-r--r--src/platformsupport/fbconvenience/qfbscreen.cpp51
1 files changed, 42 insertions, 9 deletions
diff --git a/src/platformsupport/fbconvenience/qfbscreen.cpp b/src/platformsupport/fbconvenience/qfbscreen.cpp
index efabf6e2a8..5200177fdd 100644
--- a/src/platformsupport/fbconvenience/qfbscreen.cpp
+++ b/src/platformsupport/fbconvenience/qfbscreen.cpp
@@ -45,6 +45,7 @@
#include "qfbbackingstore_p.h"
#include <QtGui/QPainter>
+#include <qpa/qwindowsysteminterface.h>
QT_BEGIN_NAMESPACE
@@ -72,6 +73,9 @@ void QFbScreen::addWindow(QFbWindow *window)
mWindowStack.prepend(window);
invalidateRectCache();
setDirty(window->geometry());
+ QWindow *w = topWindow();
+ QWindowSystemInterface::handleWindowActivated(w);
+ topWindowChanged(w);
}
void QFbScreen::removeWindow(QFbWindow *window)
@@ -79,6 +83,9 @@ void QFbScreen::removeWindow(QFbWindow *window)
mWindowStack.removeOne(window);
invalidateRectCache();
setDirty(window->geometry());
+ QWindow *w = topWindow();
+ QWindowSystemInterface::handleWindowActivated(w);
+ topWindowChanged(w);
}
void QFbScreen::raise(QFbWindow *window)
@@ -89,6 +96,9 @@ void QFbScreen::raise(QFbWindow *window)
mWindowStack.move(index, 0);
invalidateRectCache();
setDirty(window->geometry());
+ QWindow *w = topWindow();
+ QWindowSystemInterface::handleWindowActivated(w);
+ topWindowChanged(w);
}
void QFbScreen::lower(QFbWindow *window)
@@ -99,20 +109,25 @@ void QFbScreen::lower(QFbWindow *window)
mWindowStack.move(index, mWindowStack.size() - 1);
invalidateRectCache();
setDirty(window->geometry());
+ QWindow *w = topWindow();
+ QWindowSystemInterface::handleWindowActivated(w);
+ topWindowChanged(w);
+}
+
+QWindow *QFbScreen::topWindow()
+{
+ foreach (QFbWindow *fbw, mWindowStack)
+ if (fbw->window()->type() == Qt::Window || fbw->window()->type() == Qt::Dialog)
+ return fbw->window();
+ return 0;
}
QWindow *QFbScreen::topLevelAt(const QPoint & p) const
{
- Q_UNUSED(p);
-#if 0
- for (int i = 0; i < mWindowStack.size(); i++) {
- if (mWindowStack[i]->geometry().contains(p, false) &&
- mWindowStack[i]->visible() &&
- !mWindowStack[i]->widget()->isMinimized()) {
- return mWindowStack[i]->widget();
- }
+ foreach (QFbWindow *fbw, mWindowStack) {
+ if (fbw->geometry().contains(p, false) && fbw->window()->isVisible())
+ return fbw->window();
}
-#endif
return 0;
}
@@ -126,6 +141,24 @@ void QFbScreen::setDirty(const QRect &rect)
}
}
+void QFbScreen::setPhysicalSize(const QSize &size)
+{
+ mPhysicalSize = size;
+}
+
+void QFbScreen::setGeometry(const QRect &rect)
+{
+ delete mCompositePainter;
+ mCompositePainter = 0;
+ delete mScreenImage;
+ mGeometry = rect;
+ mScreenImage = new QImage(mGeometry.size(), mFormat);
+ invalidateRectCache();
+ QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), geometry());
+ QWindowSystemInterface::handleScreenAvailableGeometryChange(QPlatformScreen::screen(), availableGeometry());
+ resizeMaximizedWindows();
+}
+
void QFbScreen::generateRects()
{
mCachedRects.clear();