summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-03-19 04:36:51 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-03-19 04:36:51 (GMT)
commit86ceda033eda6bd615134f71b9850081a0c808c9 (patch)
treedd4506f056f234e04ea66e0c4a8eeae23d389cda /src/plugins
parenteaa1ba18e1db380bcacff1b7c41212a910da0550 (diff)
parentf9815142befe5fb312a6fea1dac43c33a3189145 (diff)
downloadQt-86ceda033eda6bd615134f71b9850081a0c808c9.zip
Qt-86ceda033eda6bd615134f71b9850081a0c808c9.tar.gz
Qt-86ceda033eda6bd615134f71b9850081a0c808c9.tar.bz2
Merge branch 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration into master-integration
* 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration: Changes to driver workarounds. Switch to raster also when last window is destroyed (on MeeGo). Fix accidental population of the disk cache with partial content Fix disk cache interaction for range retrieval HTTP requests. Clipboard/Windows: Fix a hang when sending to non-responsive clients.
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/graphicssystems/meego/qmeegographicssystem.cpp39
1 files changed, 38 insertions, 1 deletions
diff --git a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
index 18a0944..cb66695 100644
--- a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
+++ b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
@@ -59,6 +59,8 @@
#include "qmeegographicssystem.h"
#include "qmeegoextensions.h"
+#include <QTimer>
+
bool QMeeGoGraphicsSystem::surfaceWasCreated = false;
QHash <Qt::HANDLE, QPixmap*> QMeeGoGraphicsSystem::liveTexturePixmaps;
@@ -85,8 +87,12 @@ public:
void addWidget(QWidget *widget);
bool eventFilter(QObject *, QEvent *);
+ void handleMapNotify();
+
private slots:
void removeWidget(QObject *object);
+ void switchToRaster();
+ void switchToMeeGo();
private:
int visibleWidgets() const;
@@ -95,22 +101,46 @@ private:
QList<QWidget *> m_widgets;
};
+typedef bool(*QX11FilterFunction)(XEvent *event);
+Q_GUI_EXPORT void qt_installX11EventFilter(QX11FilterFunction func);
+
+static bool x11EventFilter(XEvent *event);
+
QMeeGoGraphicsSystemSwitchHandler::QMeeGoGraphicsSystemSwitchHandler()
{
+ qt_installX11EventFilter(x11EventFilter);
}
void QMeeGoGraphicsSystemSwitchHandler::addWidget(QWidget *widget)
{
- if (!m_widgets.contains(widget)) {
+ if (widget != qt_gl_share_widget() && !m_widgets.contains(widget)) {
widget->installEventFilter(this);
connect(widget, SIGNAL(destroyed(QObject *)), this, SLOT(removeWidget(QObject *)));
m_widgets << widget;
}
}
+void QMeeGoGraphicsSystemSwitchHandler::handleMapNotify()
+{
+ if (m_widgets.isEmpty())
+ QTimer::singleShot(0, this, SLOT(switchToMeeGo()));
+}
+
void QMeeGoGraphicsSystemSwitchHandler::removeWidget(QObject *object)
{
m_widgets.removeOne(static_cast<QWidget *>(object));
+ if (m_widgets.isEmpty())
+ QTimer::singleShot(0, this, SLOT(switchToRaster()));
+}
+
+void QMeeGoGraphicsSystemSwitchHandler::switchToRaster()
+{
+ QMeeGoGraphicsSystem::switchToRaster();
+}
+
+void QMeeGoGraphicsSystemSwitchHandler::switchToMeeGo()
+{
+ QMeeGoGraphicsSystem::switchToMeeGo();
}
int QMeeGoGraphicsSystemSwitchHandler::visibleWidgets() const
@@ -148,6 +178,13 @@ bool QMeeGoGraphicsSystemSwitchHandler::eventFilter(QObject *object, QEvent *eve
Q_GLOBAL_STATIC(QMeeGoGraphicsSystemSwitchHandler, switch_handler)
+bool x11EventFilter(XEvent *event)
+{
+ if (event->type == MapNotify)
+ switch_handler()->handleMapNotify();
+ return false;
+}
+
QWindowSurface* QMeeGoGraphicsSystem::createWindowSurface(QWidget *widget) const
{
QGLWidget *shareWidget = qt_gl_share_widget();