summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/bearer/generic/qgenericengine.cpp3
-rw-r--r--src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp2
-rw-r--r--src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.cpp2
-rw-r--r--src/plugins/platforms/wayland/qwaylanddisplay.cpp27
-rw-r--r--src/plugins/platforms/wayland/qwaylanddisplay.h11
-rw-r--r--src/plugins/platforms/wayland/qwaylandshmsurface.cpp7
-rw-r--r--src/plugins/platforms/wayland/qwaylandwindow.cpp25
-rw-r--r--src/plugins/platforms/wayland/qwaylandwindow.h2
-rw-r--r--src/plugins/platforms/wayland/wayland.pro5
-rw-r--r--src/plugins/platforms/wayland/wayland_sha1.txt2
-rw-r--r--src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp21
-rw-r--r--src/plugins/s60/feedback/feedback.pro18
-rw-r--r--src/plugins/s60/feedback/qtactileFeedback.h54
-rw-r--r--src/plugins/s60/feedback/qtactileFeedback_s60.cpp83
14 files changed, 230 insertions, 32 deletions
diff --git a/src/plugins/bearer/generic/qgenericengine.cpp b/src/plugins/bearer/generic/qgenericengine.cpp
index 7e97ffe..13f2b4c 100644
--- a/src/plugins/bearer/generic/qgenericengine.cpp
+++ b/src/plugins/bearer/generic/qgenericengine.cpp
@@ -147,6 +147,9 @@ static QNetworkConfiguration::BearerType qGetInterfaceType(const QString &interf
QGenericEngine::QGenericEngine(QObject *parent)
: QBearerEngineImpl(parent)
{
+ //workaround for deadlock in __cxa_guard_acquire with webkit on macos x
+ //initialise the Q_GLOBAL_STATIC in same thread as the AtomicallyInitializedStatic
+ (void)QNetworkInterface::interfaceFromIndex(0);
}
QGenericEngine::~QGenericEngine()
diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp
index 72de02a..999a411 100644
--- a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp
+++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp
@@ -91,7 +91,7 @@ void QWaylandXCompositeEGLContext::swapBuffers()
QSize size = mWindow->geometry().size();
eglSwapBuffers(mEglIntegration->eglDisplay(),mEglWindowSurface);
- mWindow->damage(QRegion(QRect(QPoint(0,0),size)));
+ mWindow->damage(QRect(QPoint(0,0),size));
mWindow->waitForFrameSync();
}
diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.cpp b/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.cpp
index dff6ffa..3d49790 100644
--- a/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.cpp
+++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.cpp
@@ -81,7 +81,7 @@ void QWaylandXCompositeGLXContext::swapBuffers()
QSize size = mWindow->geometry().size();
glXSwapBuffers(mGlxIntegration->xDisplay(),mXWindow);
- mWindow->damage(QRegion(QRect(QPoint(0,0),size)));
+ mWindow->damage(QRect(QPoint(0,0),size));
mWindow->waitForFrameSync();
}
diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.cpp b/src/plugins/platforms/wayland/qwaylanddisplay.cpp
index 83516e9..c8dc2f9 100644
--- a/src/plugins/platforms/wayland/qwaylanddisplay.cpp
+++ b/src/plugins/platforms/wayland/qwaylanddisplay.cpp
@@ -232,17 +232,36 @@ int QWaylandDisplay::sourceUpdate(uint32_t mask, void *data)
}
void QWaylandDisplay::outputHandleGeometry(void *data,
- struct wl_output *output,
+ wl_output *output,
int32_t x, int32_t y,
- int32_t width, int32_t height)
+ int32_t physicalWidth,
+ int32_t physicalHeight,
+ int subpixel,
+ const char *make, const char *model)
{
QWaylandDisplay *waylandDisplay = static_cast<QWaylandDisplay *>(data);
- QRect outputRect = QRect(x, y, width, height);
+ QRect outputRect = QRect(x, y, physicalWidth, physicalHeight);
waylandDisplay->createNewScreen(output,outputRect);
}
+void QWaylandDisplay::mode(void *data,
+ struct wl_output *wl_output,
+ uint32_t flags,
+ int width,
+ int height,
+ int refresh)
+{
+ Q_UNUSED(data);
+ Q_UNUSED(wl_output);
+ Q_UNUSED(flags);
+ Q_UNUSED(width);
+ Q_UNUSED(height);
+ Q_UNUSED(refresh);
+}
+
const struct wl_output_listener QWaylandDisplay::outputListener = {
- QWaylandDisplay::outputHandleGeometry
+ QWaylandDisplay::outputHandleGeometry,
+ QWaylandDisplay::mode
};
const struct wl_compositor_listener QWaylandDisplay::compositorListener = {
diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.h b/src/plugins/platforms/wayland/qwaylanddisplay.h
index 765be62..4dff24d 100644
--- a/src/plugins/platforms/wayland/qwaylanddisplay.h
+++ b/src/plugins/platforms/wayland/qwaylanddisplay.h
@@ -128,7 +128,16 @@ private:
static void outputHandleGeometry(void *data,
struct wl_output *output,
int32_t x, int32_t y,
- int32_t width, int32_t height);
+ int32_t width, int32_t height,
+ int subpixel,
+ const char *make,
+ const char *model);
+ static void mode(void *data,
+ struct wl_output *wl_output,
+ uint32_t flags,
+ int width,
+ int height,
+ int refresh);
static void handleVisual(void *data,
struct wl_compositor *compositor,
diff --git a/src/plugins/platforms/wayland/qwaylandshmsurface.cpp b/src/plugins/platforms/wayland/qwaylandshmsurface.cpp
index efc56bb..b24c419 100644
--- a/src/plugins/platforms/wayland/qwaylandshmsurface.cpp
+++ b/src/plugins/platforms/wayland/qwaylandshmsurface.cpp
@@ -120,7 +120,12 @@ void QWaylandShmWindowSurface::flush(QWidget *widget, const QRegion &region, con
Q_UNUSED(offset);
QWaylandShmWindow *waylandWindow = static_cast<QWaylandShmWindow *>(window()->platformWindow());
Q_ASSERT(waylandWindow->windowType() == QWaylandWindow::Shm);
- waylandWindow->damage(region);
+ QVector<QRect> rects = region.rects();
+ for (int i = 0; i < rects.size(); i++) {
+ const QRect rect = rects.at(i);
+ wl_buffer_damage(mBuffer->buffer(),rect.x(),rect.y(),rect.width(),rect.height());
+ waylandWindow->damage(rect);
+ }
}
void QWaylandShmWindowSurface::resize(const QSize &size)
diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp
index 333a953..e79a712 100644
--- a/src/plugins/platforms/wayland/qwaylandwindow.cpp
+++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp
@@ -58,6 +58,7 @@
QWaylandWindow::QWaylandWindow(QWidget *window)
: QPlatformWindow(window)
+ , mSurface(0)
, mDisplay(QWaylandScreen::waylandScreenFromWidget(window)->display())
, mBuffer(0)
, mWaitingForFrameSync(false)
@@ -69,8 +70,6 @@ QWaylandWindow::QWaylandWindow(QWidget *window)
mDisplay->windowManagerIntegration()->mapClientToProcess(qApp->applicationPid());
mDisplay->windowManagerIntegration()->authenticateWithToken();
#endif
-
- mSurface = mDisplay->createSurface(this);
}
QWaylandWindow::~QWaylandWindow()
@@ -101,9 +100,7 @@ void QWaylandWindow::setVisible(bool visible)
newSurfaceCreated();
}
- if (visible) {
- wl_surface_map_toplevel(mSurface);
- } else {
+ if (!visible) {
wl_surface_destroy(mSurface);
mSurface = NULL;
}
@@ -130,25 +127,25 @@ void QWaylandWindow::attach(QWaylandBuffer *buffer)
}
}
-void QWaylandWindow::damage(const QRegion &region)
+void QWaylandWindow::damage(const QRect &rect)
{
//We have to do sync stuff before calling damage, or we might
//get a frame callback before we get the timestamp
- mDisplay->frameCallback(QWaylandWindow::frameCallback, mSurface, this);
- mWaitingForFrameSync = true;
-
- QVector<QRect> rects = region.rects();
- for (int i = 0; i < rects.size(); i++) {
- const QRect rect = rects.at(i);
- wl_surface_damage(mSurface,
- rect.x(), rect.y(), rect.width(), rect.height());
+ if (!mWaitingForFrameSync) {
+ mDisplay->frameCallback(QWaylandWindow::frameCallback, mSurface, this);
+ mWaitingForFrameSync = true;
}
+
+ wl_surface_damage(mSurface,
+ rect.x(), rect.y(), rect.width(), rect.height());
}
void QWaylandWindow::newSurfaceCreated()
{
if (mBuffer) {
wl_surface_attach(mSurface,mBuffer->buffer(),0,0);
+ wl_surface_damage(mSurface,
+ 0,0,mBuffer->size().width(),mBuffer->size().height());
}
}
diff --git a/src/plugins/platforms/wayland/qwaylandwindow.h b/src/plugins/platforms/wayland/qwaylandwindow.h
index b8eae96..b91f6b6 100644
--- a/src/plugins/platforms/wayland/qwaylandwindow.h
+++ b/src/plugins/platforms/wayland/qwaylandwindow.h
@@ -71,7 +71,7 @@ public:
int32_t x, int32_t y, int32_t width, int32_t height);
void attach(QWaylandBuffer *buffer);
- void damage(const QRegion &region);
+ void damage(const QRect &rect);
void waitForFrameSync();
diff --git a/src/plugins/platforms/wayland/wayland.pro b/src/plugins/platforms/wayland/wayland.pro
index dca72fd..5b20a87 100644
--- a/src/plugins/platforms/wayland/wayland.pro
+++ b/src/plugins/platforms/wayland/wayland.pro
@@ -34,7 +34,10 @@ LIBS += $$QMAKE_LIBS_WAYLAND
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_WAYLAND
!isEmpty(QMAKE_LFLAGS_RPATH) {
- !isEmpty(QMAKE_LIBDIR_WAYLAND):QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${QMAKE_LIBDIR_WAYLAND}
+ WAYLAND_NEEDS_RPATH = $$system(pkg-config --libs-only-L wayland-client)
+ !isEmpty(WAYLAND_NEEDS_RPATH) {
+ !isEmpty(QMAKE_LIBDIR_WAYLAND):QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${QMAKE_LIBDIR_WAYLAND}
+ }
}
INCLUDEPATH += $$PWD
diff --git a/src/plugins/platforms/wayland/wayland_sha1.txt b/src/plugins/platforms/wayland/wayland_sha1.txt
index d262437..a696e76 100644
--- a/src/plugins/platforms/wayland/wayland_sha1.txt
+++ b/src/plugins/platforms/wayland/wayland_sha1.txt
@@ -1,3 +1,3 @@
This version of the Qt Wayland plugin is checked against the following sha1
from the Wayland repository:
-eff7fc0d99be2e51eaa351785030c8d374ac71de
+bfea3d6befdb688d5354e6f15a9400ea637febf9
diff --git a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp
index abc60e1..283f7d4 100644
--- a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp
+++ b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp
@@ -125,7 +125,13 @@ void QTcpServerConnection::disconnect()
bool QTcpServerConnection::waitForMessage()
{
Q_D(QTcpServerConnection);
- return d->protocol->waitForReadyRead(-1);
+ if (d->protocol->packetsAvailable() > 0) {
+ QPacket packet = d->protocol->read();
+ d->debugServer->receiveMessage(packet.data());
+ return true;
+ } else {
+ return d->protocol->waitForReadyRead(-1);
+ }
}
void QTcpServerConnection::setPort(int port, bool block)
@@ -145,10 +151,11 @@ void QTcpServerConnection::listen()
d->tcpServer = new QTcpServer(this);
QObject::connect(d->tcpServer, SIGNAL(newConnection()), this, SLOT(newConnection()));
- if (d->tcpServer->listen(QHostAddress::Any, d->port))
+ if (d->tcpServer->listen(QHostAddress::Any, d->port)) {
qWarning("QDeclarativeDebugServer: Waiting for connection on port %d...", d->port);
- else
+ } else {
qWarning("QDeclarativeDebugServer: Unable to listen on port %d", d->port);
+ }
}
@@ -158,10 +165,10 @@ void QTcpServerConnection::readyRead()
if (!d->protocol)
return;
- QPacket packet = d->protocol->read();
-
- QByteArray content = packet.data();
- d->debugServer->receiveMessage(content);
+ while (d->protocol->packetsAvailable() > 0) {
+ QPacket packet = d->protocol->read();
+ d->debugServer->receiveMessage(packet.data());
+ }
}
void QTcpServerConnection::newConnection()
diff --git a/src/plugins/s60/feedback/feedback.pro b/src/plugins/s60/feedback/feedback.pro
new file mode 100644
index 0000000..1069220
--- /dev/null
+++ b/src/plugins/s60/feedback/feedback.pro
@@ -0,0 +1,18 @@
+include(../../qpluginbase.pri)
+
+TARGET = qtactilefeedback$${QT_LIBINFIX}
+
+QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/s60/feedback
+
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+contains(S60_VERSION, 5.0)|contains(S60_VERSION, symbian3) {
+ HEADERS += qtactileFeedback.h
+ SOURCES += qtactileFeedback_s60.cpp
+
+ LIBS += -ltouchfeedback
+}
+
+load(data_caging_paths)
+
+TARGET.UID3=0x200315B4
diff --git a/src/plugins/s60/feedback/qtactileFeedback.h b/src/plugins/s60/feedback/qtactileFeedback.h
new file mode 100644
index 0000000..7c4cc29
--- /dev/null
+++ b/src/plugins/s60/feedback/qtactileFeedback.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QEvent>
+#include <QWidget>
+
+#include "private/qs60style_feedbackinterface_p.h"
+
+class QTactileFeedback : public TactileFeedbackInterface
+{
+ Q_OBJECT
+ Q_INTERFACES(TactileFeedbackInterface)
+
+ public:
+ void touchFeedback(QEvent *event, const QWidget *widget);
+ };
diff --git a/src/plugins/s60/feedback/qtactileFeedback_s60.cpp b/src/plugins/s60/feedback/qtactileFeedback_s60.cpp
new file mode 100644
index 0000000..c2f1d34
--- /dev/null
+++ b/src/plugins/s60/feedback/qtactileFeedback_s60.cpp
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+#include <QObject>
+#include <QSlider>
+#include <QScrollBar>
+
+#include <QtCore/qplugin.h>
+#include "qtactileFeedback.h"
+
+#include <touchfeedback.h>
+
+void QTactileFeedback::touchFeedback(QEvent *event, const QWidget *widget)
+{
+ //Lets share the global instance for touch feedback (you are NOT allowed to try and delete it!).
+ MTouchFeedback* feedback = MTouchFeedback::Instance();
+
+ //If the widget itself is not handling focus, try to use focusProxy widget.
+ const QWidget *w = ((widget->focusPolicy() == Qt::NoFocus) && (widget->focusProxy())) ? widget->focusProxy() : widget;
+
+ //Only give tactile feedback for enabled widgets that take focus.
+ if (feedback && w && w->isEnabled() && w->isWidgetType() && w->isVisible()) {
+ //Scrollbars are 'special' that they don't take focus (nor they have focusProxy), yet we'd like to have tactile feedback for them
+ if (w->focusPolicy() == Qt::NoFocus)
+ if (!qobject_cast<const QScrollBar *>(w))
+ return;
+
+ //Don't give tactile feedback for widgets that are outside topmost dialog.
+ QWidget *dialog = QApplication::activeModalWidget();
+ if (dialog) {
+ QList<const QWidget *> allChildren = dialog->findChildren<const QWidget *>();
+ if (!allChildren.contains(w))
+ return;
+ }
+
+ //Widget specific tactile feedback.
+ if (qobject_cast<const QSlider *>(w) || qobject_cast<const QScrollBar *>(w))
+ feedback->InstantFeedback(ETouchFeedbackSensitive);
+ else
+ feedback->InstantFeedback(ETouchFeedbackBasic);
+ }
+}
+
+Q_EXPORT_PLUGIN2("feedback", QTactileFeedback);