[-]
[+]
|
Changed |
qtwayland.tar.bz2/.git/HEAD
|
@@ -1 +1 @@
-a882135beb0728218bb9c2c0582e050df2cfbcba
+05a1141bc2c4f581b6544874537c5fa0cf973f02
|
|
Changed |
qtwayland.tar.bz2/.git/index
^
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/.git/logs/HEAD
^
|
@@ -1,2 +1,3 @@
0000000000000000000000000000000000000000 d4627731182d1ea20bb20570d46ebc1881ded490 Martin Brook <martin.brook100@googlemail.com> 1424628164 +0000 clone: from https://github.com/mer-qt/qtwayland.git
d4627731182d1ea20bb20570d46ebc1881ded490 a882135beb0728218bb9c2c0582e050df2cfbcba Martin Brook <martin.brook100@googlemail.com> 1424628185 +0000 checkout: moving from mer-stable to mer/5.4.0+git7
+a882135beb0728218bb9c2c0582e050df2cfbcba 05a1141bc2c4f581b6544874537c5fa0cf973f02 Martin Brook <martin.brook100@googlemail.com> 1424630595 +0000 checkout: moving from a882135beb0728218bb9c2c0582e050df2cfbcba to mer/5.2.0+git6
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/.gitignore
^
|
@@ -14,7 +14,6 @@
config.tests/xcomposite/xcomposite
config.tests/xkbcommon/xkbcommon
config.tests/wayland/wayland
-config.tests/drm_egl_server/drm_egl_server
config.tests/wayland_scanner/wayland_scanner
config.tests/wayland_scanner/*-client-protocol.h
config.tests/wayland_scanner/*-protocol.c
@@ -30,18 +29,6 @@
examples/qml-compositor/qml-compositor
examples/qwidget-compositor/qwidget-compositor
examples/qwindow-compositor/qwindow-compositor
-examples/server-buffer/client/client
-examples/server-buffer/client/qwayland-*.cpp
-examples/server-buffer/client/qwayland-*.h
-examples/server-buffer/client/*-client-protocol.h
-examples/server-buffer/client/*-protocol.c
-examples/server-buffer/compositor/compositor
-examples/server-buffer/compositor/qwayland-server-*.cpp
-examples/server-buffer/compositor/qwayland-server-*.h
-examples/server-buffer/compositor/*-server-protocol.h
-examples/server-buffer/compositor/*-protocol.c
-src/client/qwayland*.cpp
-src/client/*-protocol.c
src/compositor/*-server-protocol.h
src/compositor/*-protocol.c
src/compositor/qwayland-server-*.cpp
@@ -56,11 +43,5 @@
src/plugins/waylandcompositors/*/qwayland-server-*.h
src/plugins/platforms/wayland_common/libwayland_common.a
src/plugins/platforms/wayland_common/libwayland_common.prl
-src/plugins/hardwareintegration/*/*/qwayland*.cpp
-src/plugins/hardwareintegration/*/*/qwayland*.h
-src/plugins/hardwareintegration/*/*/*-server-protocol.h
-src/plugins/hardwareintegration/*/*/*-client-protocol.h
-src/plugins/hardwareintegration/*/*/*-protocol.c
tests/auto/client/tst_client
tests/auto/compositor/tst_compositor
-*~
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/.qmake.conf
^
|
@@ -1,3 +1,3 @@
load(qt_build_config)
-MODULE_VERSION = 5.4.0
+MODULE_VERSION = 5.3.0
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/examples/qml-compositor/WindowContainer.qml
^
|
@@ -40,7 +40,6 @@
import QtQuick 2.0
import QtQuick.Window 2.0
-import QtCompositor 1.0
Item {
id: container
@@ -53,7 +52,8 @@
visible: isFullscreen || !root.hasFullscreenWindow
onVisibleChanged: {
- child.surface.clientRenderingEnabled = visible
+ child.clientRenderingEnabled = visible
+ console.log("visibility changed: " + visible);
}
opacity: 0
@@ -105,7 +105,7 @@
ContrastEffect {
id: effect
source: child
- anchors.fill: parent
+ anchors.fill: child
blend: { if (child && chrome && (chrome.selected || child.focus)) 0.0; else 0.6 }
opacity: 1.0
z: 1
@@ -168,23 +168,11 @@
NumberAnimation { target: scaleTransform; property: "yScale"; easing.type: Easing.Linear; to: 0.01; duration: 200; }
NumberAnimation { target: scaleTransform; property: "xScale"; easing.type: Easing.Linear; to: 0.01; duration: 150; }
NumberAnimation { target: container; property: "opacity"; easing.type: Easing.Linear; to: 0.0; duration: 150; }
- ScriptAction { script: container.parent.removeWindow(container) }
- }
- SequentialAnimation {
- id: unmapAnimation
- NumberAnimation { target: container; property: "opacity"; easing.type: Easing.Linear; to: 0.0; duration: 150; }
- ScriptAction { script: container.parent.removeWindow(container) }
+ ScriptAction { script: container.parent.removeWindow(child); }
}
- Connections {
- target: container.child ? container.child.surface : null
- onUnmapped: unmapAnimation.start()
- }
- Connections {
- target: container.child ? container.child : null
- onSurfaceDestroyed: {
- destroyAnimation.start();
- }
+ function runDestroyAnimation() {
+ destroyAnimation.start();
}
Image {
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/examples/qml-compositor/main.cpp
^
|
@@ -38,10 +38,9 @@
**
****************************************************************************/
-#include "qwaylandquickcompositor.h"
-#include "qwaylandquicksurface.h"
-
-#include <QtCompositor/qwaylandsurfaceitem.h>
+#include "qwaylandcompositor.h"
+#include "qwaylandsurface.h"
+#include "qwaylandsurfaceitem.h"
#include <QGuiApplication>
#include <QTimer>
@@ -53,35 +52,30 @@
#include <QQuickItem>
#include <QQuickView>
-class QmlCompositor : public QQuickView, public QWaylandQuickCompositor
+class QmlCompositor : public QQuickView, public QWaylandCompositor
{
Q_OBJECT
- Q_PROPERTY(QWaylandQuickSurface* fullscreenSurface READ fullscreenSurface WRITE setFullscreenSurface NOTIFY fullscreenSurfaceChanged)
+ Q_PROPERTY(QWaylandSurface* fullscreenSurface READ fullscreenSurface WRITE setFullscreenSurface NOTIFY fullscreenSurfaceChanged)
public:
QmlCompositor()
- : QWaylandQuickCompositor(this, 0, DefaultExtensions | SubSurfaceExtension)
+ : QWaylandCompositor(this, 0, DefaultExtensions | SubSurfaceExtension)
, m_fullscreenSurface(0)
{
setSource(QUrl("main.qml"));
setResizeMode(QQuickView::SizeRootObjectToView);
setColor(Qt::black);
winId();
- addDefaultShell();
+ connect(this, SIGNAL(beforeSynchronizing()), this, SLOT(startFrame()), Qt::DirectConnection);
connect(this, SIGNAL(afterRendering()), this, SLOT(sendCallbacks()));
}
- QWaylandQuickSurface *fullscreenSurface() const
+ QWaylandSurface *fullscreenSurface() const
{
return m_fullscreenSurface;
}
- Q_INVOKABLE QWaylandSurfaceItem *item(QWaylandSurface *surf)
- {
- return static_cast<QWaylandSurfaceItem *>(surf->views().first());
- }
-
signals:
void windowAdded(QVariant window);
void windowDestroyed(QVariant window);
@@ -93,7 +87,12 @@
qvariant_cast<QObject *>(window)->deleteLater();
}
- void setFullscreenSurface(QWaylandQuickSurface *surface) {
+ void destroyClientForWindow(QVariant window) {
+ QWaylandSurface *surface = qobject_cast<QWaylandSurfaceItem *>(qvariant_cast<QObject *>(window))->surface();
+ destroyClientForSurface(surface);
+ }
+
+ void setFullscreenSurface(QWaylandSurface *surface) {
if (surface == m_fullscreenSurface)
return;
m_fullscreenSurface = surface;
@@ -102,21 +101,34 @@
private slots:
void surfaceMapped() {
- QWaylandQuickSurface *surface = qobject_cast<QWaylandQuickSurface *>(sender());
- emit windowAdded(QVariant::fromValue(surface));
+ QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(sender());
+ //Ignore surface if it's not a window surface
+ if (!surface->hasShellSurface())
+ return;
+
+ QWaylandSurfaceItem *item = surface->surfaceItem();
+ //Create a WaylandSurfaceItem if we have not yet
+ if (!item)
+ item = new QWaylandSurfaceItem(surface, rootObject());
+
+ item->setTouchEventsEnabled(true);
+ //item->takeFocus();
+ emit windowAdded(QVariant::fromValue(static_cast<QQuickItem *>(item)));
}
void surfaceUnmapped() {
- QWaylandQuickSurface *surface = qobject_cast<QWaylandQuickSurface *>(sender());
+ QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(sender());
if (surface == m_fullscreenSurface)
m_fullscreenSurface = 0;
- emit windowDestroyed(QVariant::fromValue(surface));
+ QQuickItem *item = surface->surfaceItem();
+ emit windowDestroyed(QVariant::fromValue(item));
}
void surfaceDestroyed(QObject *object) {
- QWaylandQuickSurface *surface = static_cast<QWaylandQuickSurface *>(object);
+ QWaylandSurface *surface = static_cast<QWaylandSurface *>(object);
if (surface == m_fullscreenSurface)
m_fullscreenSurface = 0;
- emit windowDestroyed(QVariant::fromValue(surface));
+ QQuickItem *item = surface->surfaceItem();
+ emit windowDestroyed(QVariant::fromValue(item));
}
void sendCallbacks() {
@@ -125,6 +137,9 @@
else
sendFrameCallbacks(surfaces());
}
+ void startFrame() {
+ frameStarted();
+ }
protected:
void resizeEvent(QResizeEvent *event)
@@ -140,7 +155,7 @@
}
private:
- QWaylandQuickSurface *m_fullscreenSurface;
+ QWaylandSurface *m_fullscreenSurface;
};
int main(int argc, char *argv[])
@@ -155,6 +170,7 @@
compositor.rootContext()->setContextProperty("compositor", &compositor);
QObject::connect(&compositor, SIGNAL(windowAdded(QVariant)), compositor.rootObject(), SLOT(windowAdded(QVariant)));
+ QObject::connect(&compositor, SIGNAL(windowDestroyed(QVariant)), compositor.rootObject(), SLOT(windowDestroyed(QVariant)));
QObject::connect(&compositor, SIGNAL(windowResized(QVariant)), compositor.rootObject(), SLOT(windowResized(QVariant)));
return app.exec();
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/examples/qml-compositor/main.qml
^
|
@@ -39,7 +39,6 @@
****************************************************************************/
import QtQuick 2.0
-import QtCompositor 1.0
import "compositor.js" as CompositorLogic
Item {
@@ -48,6 +47,8 @@
property variant selectedWindow: null
property bool hasFullscreenWindow: typeof compositor != "undefined" && compositor.fullscreenSurface !== null
+ onHasFullscreenWindowChanged: console.log("has fullscreen window: " + hasFullscreenWindow);
+
Image {
id: background
Behavior on opacity {
@@ -82,25 +83,16 @@
function windowAdded(window) {
var windowContainerComponent = Qt.createComponent("WindowContainer.qml");
- if (windowContainerComponent.status != Component.Ready) {
- console.warn("Error loading WindowContainer.qml: " + windowContainerComponent.errorString());
- return;
- }
var windowContainer = windowContainerComponent.createObject(root);
- windowContainer.child = compositor.item(window);
- windowContainer.child.parent = windowContainer;
- windowContainer.child.touchEventsEnabled = true;
+ window.parent = windowContainer;
- windowContainer.targetWidth = window.size.width;
- windowContainer.targetHeight = window.size.height;
+ windowContainer.targetWidth = window.width;
+ windowContainer.targetHeight = window.height;
+ windowContainer.child = window;
var windowChromeComponent = Qt.createComponent("WindowChrome.qml");
- if (windowChromeComponent.status != Component.Ready) {
- console.warn("Error loading WindowChrome.qml: " + windowChromeComponent.errorString());
- return;
- }
- var windowChrome = windowChromeComponent.createObject(windowContainer.child);
+ var windowChrome = windowChromeComponent.createObject(window);
CompositorLogic.addWindow(windowContainer);
@@ -110,16 +102,25 @@
}
function windowResized(window) {
- window.width = window.surface.size.width;
- window.height = window.surface.size.height;
+ var windowContainer = window.parent;
+ windowContainer.width = window.width;
+ windowContainer.height = window.height;
CompositorLogic.relayout();
}
+ function windowDestroyed(window) {
+ var windowContainer = window.parent;
+ if (windowContainer.runDestroyAnimation)
+ windowContainer.runDestroyAnimation();
+ }
+
function removeWindow(window) {
- CompositorLogic.removeWindow(window);
- window.chrome.destroy();
- window.destroy();
+ var windowContainer = window.parent;
+ CompositorLogic.removeWindow(windowContainer);
+ windowContainer.chrome.destroy();
+ windowContainer.destroy();
+ compositor.destroyWindow(window);
}
onHeightChanged: CompositorLogic.relayout();
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/examples/qwindow-compositor/compositorwindow.cpp
^
|
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the examples of the Qt Wayland module
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "compositorwindow.h"
-#include <QTouchEvent>
-
-CompositorWindow::CompositorWindow(const QSurfaceFormat &format, const QRect &geometry)
- : m_format(format)
-{
- setSurfaceType(QWindow::OpenGLSurface);
- setGeometry(geometry);
- setFormat(format);
- create();
- m_context = new QOpenGLContext;
- m_context->setFormat(format);
- m_context->create();
-}
-
-void CompositorWindow::touchEvent(QTouchEvent *event)
-{
- // Do not want any automatically synthesized mouse events
- // so make sure the touch is always accepted.
- event->accept();
-}
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/examples/qwindow-compositor/compositorwindow.h
^
|
@@ -1,64 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the examples of the Qt Wayland module
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef COMPOSITORWINDOW_H
-#define COMPOSITORWINDOW_H
-
-#include <QWindow>
-#include <QOpenGLContext>
-#include <QSurfaceFormat>
-
-class CompositorWindow : public QWindow
-{
-public:
- CompositorWindow(const QSurfaceFormat &format, const QRect &geometry);
- QOpenGLContext* context() { return m_context; }
- bool makeCurrent() { return m_context->makeCurrent(this); }
- void swapBuffers() { m_context->swapBuffers(this); }
-
-protected:
- void touchEvent(QTouchEvent *event);
-
-private:
- QOpenGLContext *m_context;
- QSurfaceFormat m_format;
-};
-
-#endif // COMPOSITORWINDOW_H
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/examples/qwindow-compositor/main.cpp
^
|
@@ -38,7 +38,7 @@
**
****************************************************************************/
-#include "compositorwindow.h"
+#include "qopenglwindow.h"
#include "qwindowcompositor.h"
#include <QGuiApplication>
@@ -65,7 +65,7 @@
geom = QRect(screenGeometry.width() / 4, screenGeometry.height() / 4,
screenGeometry.width() / 2, screenGeometry.height() / 2);
- CompositorWindow window(format, geom);
+ QOpenGLWindow window(format, geom);
QWindowCompositor compositor(&window);
window.show();
|
[-]
[+]
|
Added |
qtwayland.tar.bz2/examples/qwindow-compositor/qopenglwindow.cpp
^
|
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Compositor.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qopenglwindow.h"
+#include <QTouchEvent>
+
+QOpenGLWindow::QOpenGLWindow(const QSurfaceFormat &format, const QRect &geometry)
+ : m_format(format)
+{
+ setSurfaceType(QWindow::OpenGLSurface);
+ setGeometry(geometry);
+ setFormat(format);
+ create();
+ m_context = new QOpenGLContext;
+ m_context->setFormat(format);
+ m_context->create();
+}
+
+void QOpenGLWindow::touchEvent(QTouchEvent *event)
+{
+ // Do not want any automatically synthesized mouse events
+ // so make sure the touch is always accepted.
+ event->accept();
+}
|
[-]
[+]
|
Added |
qtwayland.tar.bz2/examples/qwindow-compositor/qopenglwindow.h
^
|
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Compositor.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QOPENGLWINDOW_H
+#define QOPENGLWINDOW_H
+
+#include <QWindow>
+#include <QOpenGLContext>
+#include <QSurfaceFormat>
+
+class QOpenGLWindow : public QWindow
+{
+public:
+ QOpenGLWindow(const QSurfaceFormat &format, const QRect &geometry);
+public:
+ QOpenGLContext* context() { return m_context; }
+ bool makeCurrent() { return m_context->makeCurrent(this); }
+ void swapBuffers() { m_context->swapBuffers(this); }
+protected:
+ void touchEvent(QTouchEvent *event);
+private:
+ QOpenGLContext *m_context;
+ QSurfaceFormat m_format;
+};
+
+#endif // QOPENGLWINDOW_H
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/examples/qwindow-compositor/qwindow-compositor.pro
^
|
@@ -4,12 +4,12 @@
#include (../../src/qt-compositor/qt-compositor.pri)
HEADERS += \
- compositorwindow.h \
+ qopenglwindow.h \
qwindowcompositor.h \
textureblitter.h
SOURCES += main.cpp \
- compositorwindow.cpp \
+ qopenglwindow.cpp \
qwindowcompositor.cpp \
textureblitter.cpp
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/examples/qwindow-compositor/qwindowcompositor.cpp
^
|
@@ -44,7 +44,6 @@
#include <QKeyEvent>
#include <QTouchEvent>
#include <QOpenGLFunctions>
-#include <QOpenGLTexture>
#include <QGuiApplication>
#include <QCursor>
#include <QPixmap>
@@ -53,61 +52,8 @@
#include <QPainter>
#include <QtCompositor/qwaylandinput.h>
-#include <QtCompositor/qwaylandbufferref.h>
-#include <QtCompositor/qwaylandsurfaceview.h>
-QT_BEGIN_NAMESPACE
-
-class BufferAttacher : public QWaylandBufferAttacher
-{
-public:
- BufferAttacher()
- : QWaylandBufferAttacher()
- , shmTex(0)
- {
- }
-
- ~BufferAttacher()
- {
- delete shmTex;
- }
-
- void attach(const QWaylandBufferRef &ref) Q_DECL_OVERRIDE
- {
- if (bufferRef) {
- if (bufferRef.isShm()) {
- delete shmTex;
- shmTex = 0;
- } else {
- bufferRef.destroyTexture();
- }
- }
-
- bufferRef = ref;
-
- if (bufferRef) {
- if (bufferRef.isShm()) {
- shmTex = new QOpenGLTexture(bufferRef.image(), QOpenGLTexture::DontGenerateMipMaps);
- texture = shmTex->textureId();
- } else {
- texture = bufferRef.createTexture();
- }
- }
- }
-
- QImage image() const
- {
- if (!bufferRef || !bufferRef.isShm())
- return QImage();
- return bufferRef.image();
- }
-
- QOpenGLTexture *shmTex;
- QWaylandBufferRef bufferRef;
- GLuint texture;
-};
-
-QWindowCompositor::QWindowCompositor(CompositorWindow *window)
+QWindowCompositor::QWindowCompositor(QOpenGLWindow *window)
: QWaylandCompositor(window, 0, DefaultExtensions | SubSurfaceExtension)
, m_window(window)
, m_backgroundTexture(0)
@@ -136,11 +82,11 @@
setOutputGeometry(QRect(QPoint(0, 0), window->size()));
setOutputRefreshRate(qRound(qGuiApp->primaryScreen()->refreshRate() * 1000.0));
- addDefaultShell();
}
QWindowCompositor::~QWindowCompositor()
{
+ glDeleteTextures(1, &m_backgroundTexture);
delete m_textureBlitter;
}
@@ -172,9 +118,9 @@
defaultInputDevice()->setKeyboardFocus(m_surfaces.isEmpty() ? 0 : m_surfaces.last());
}
-void QWindowCompositor::surfaceDestroyed()
+void QWindowCompositor::surfaceDestroyed(QObject *object)
{
- QWaylandSurface *surface = static_cast<QWaylandSurface *>(sender());
+ QWaylandSurface *surface = static_cast<QWaylandSurface *>(object);
m_surfaces.removeOne(surface);
ensureKeyboardFocusSurface(surface);
m_renderScheduler.start(0);
@@ -185,29 +131,22 @@
QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(sender());
QPoint pos;
if (!m_surfaces.contains(surface)) {
- if (surface->windowType() != QWaylandSurface::Popup) {
- uint px = 0;
- uint py = 0;
- if (!QCoreApplication::arguments().contains(QLatin1String("-stickytopleft"))) {
- px = 1 + (qrand() % (m_window->width() - surface->size().width() - 2));
- py = 1 + (qrand() % (m_window->height() - surface->size().height() - 2));
- }
- pos = QPoint(px, py);
- QWaylandSurfaceView *view = surface->views().first();
- view->setPos(pos);
+ uint px = 0;
+ uint py = 0;
+ if (!QCoreApplication::arguments().contains(QLatin1String("-stickytopleft"))) {
+ px = 1 + (qrand() % (m_window->width() - surface->size().width() - 2));
+ py = 1 + (qrand() % (m_window->height() - surface->size().height() - 2));
}
+ pos = QPoint(px, py);
+ surface->setPos(pos);
} else {
m_surfaces.removeOne(surface);
}
-
- if (surface->windowType() == QWaylandSurface::Popup) {
- QWaylandSurfaceView *view = surface->views().first();
- view->setPos(surface->transientParent()->views().first()->pos() + surface->transientOffset());
+ //Sometimes surfaces dont have shell_surfaces, so don't render them
+ if (surface->hasShellSurface()) {
+ m_surfaces.append(surface);
+ defaultInputDevice()->setKeyboardFocus(surface);
}
-
- m_surfaces.append(surface);
- defaultInputDevice()->setKeyboardFocus(surface);
-
m_renderScheduler.start(0);
}
@@ -218,7 +157,6 @@
m_surfaces.insert(0, surface);
ensureKeyboardFocusSurface(surface);
- m_renderScheduler.start(0);
}
void QWindowCompositor::surfaceCommitted()
@@ -240,14 +178,13 @@
void QWindowCompositor::surfaceCreated(QWaylandSurface *surface)
{
- connect(surface, SIGNAL(surfaceDestroyed()), this, SLOT(surfaceDestroyed()));
+ connect(surface, SIGNAL(destroyed(QObject *)), this, SLOT(surfaceDestroyed(QObject *)));
connect(surface, SIGNAL(mapped()), this, SLOT(surfaceMapped()));
connect(surface, SIGNAL(unmapped()), this, SLOT(surfaceUnmapped()));
- connect(surface, SIGNAL(redraw()), this, SLOT(surfaceCommitted()));
+ connect(surface, SIGNAL(committed()), this, SLOT(surfaceCommitted()));
connect(surface, SIGNAL(extendedSurfaceReady()), this, SLOT(sendExpose()));
+ connect(surface, SIGNAL(posChanged()), this, SLOT(surfacePosChanged()));
m_renderScheduler.start(0);
-
- surface->setBufferAttacher(new BufferAttacher);
}
void QWindowCompositor::sendExpose()
@@ -256,15 +193,11 @@
surface->sendOnScreenVisibilityChange(true);
}
-void QWindowCompositor::updateCursor(bool hasBuffer)
+void QWindowCompositor::updateCursor()
{
- Q_UNUSED(hasBuffer)
if (!m_cursorSurface)
return;
-
- QImage image = static_cast<BufferAttacher *>(m_cursorSurface->bufferAttacher())->image();
-
- QCursor cursor(QPixmap::fromImage(image), m_cursorHotspotX, m_cursorHotspotY);
+ QCursor cursor(QPixmap::fromImage(m_cursorSurface->image()), m_cursorHotspotX, m_cursorHotspotY);
static bool cursorIsSet = false;
if (cursorIsSet) {
QGuiApplication::changeOverrideCursor(cursor);
@@ -274,39 +207,105 @@
}
}
-QPointF QWindowCompositor::toView(QWaylandSurfaceView *view, const QPointF &pos) const
+QPointF QWindowCompositor::toSurface(QWaylandSurface *surface, const QPointF &pos) const
{
- return pos - view->pos();
+ return pos - surface->pos();
}
void QWindowCompositor::setCursorSurface(QWaylandSurface *surface, int hotspotX, int hotspotY)
{
if ((m_cursorSurface != surface) && surface)
- connect(surface, SIGNAL(configure(bool)), this, SLOT(updateCursor(bool)));
+ connect(surface, SIGNAL(damaged(QRect)), this, SLOT(updateCursor()));
m_cursorSurface = surface;
m_cursorHotspotX = hotspotX;
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/examples/qwindow-compositor/qwindowcompositor.h
^
|
@@ -44,26 +44,21 @@
#include "qwaylandcompositor.h"
#include "qwaylandsurface.h"
#include "textureblitter.h"
-#include "compositorwindow.h"
+#include "qopenglwindow.h"
#include <QtGui/private/qopengltexturecache_p.h>
#include <QObject>
#include <QTimer>
-QT_BEGIN_NAMESPACE
-
-class QWaylandSurfaceView;
-class QOpenGLTexture;
-
class QWindowCompositor : public QObject, public QWaylandCompositor
{
Q_OBJECT
public:
- QWindowCompositor(CompositorWindow *window);
+ QWindowCompositor(QOpenGLWindow *window);
~QWindowCompositor();
private slots:
- void surfaceDestroyed();
+ void surfaceDestroyed(QObject *object);
void surfaceMapped();
void surfaceUnmapped();
void surfaceCommitted();
@@ -74,10 +69,14 @@
void surfaceCommitted(QWaylandSurface *surface);
void surfaceCreated(QWaylandSurface *surface);
- QWaylandSurfaceView* viewAt(const QPointF &point, QPointF *local = 0);
+ QWaylandSurface* surfaceAt(const QPointF &point, QPointF *local = 0);
+
+ GLuint composeSurface(QWaylandSurface *surface, bool *textureOwned);
+ void paintChildren(QWaylandSurface *surface, QWaylandSurface *window, const QSize &windowSize);
+
bool eventFilter(QObject *obj, QEvent *event);
- QPointF toView(QWaylandSurfaceView *view, const QPointF &pos) const;
+ QPointF toSurface(QWaylandSurface *surface, const QPointF &pos) const;
void setCursorSurface(QWaylandSurface *surface, int hotspotX, int hotspotY);
@@ -86,21 +85,19 @@
private slots:
void sendExpose();
- void updateCursor(bool hasBuffer);
+ void updateCursor();
private:
- void drawSubSurface(const QPoint &offset, QWaylandSurface *surface);
-
- CompositorWindow *m_window;
+ QOpenGLWindow *m_window;
QImage m_backgroundImage;
- QOpenGLTexture *m_backgroundTexture;
+ GLuint m_backgroundTexture;
QList<QWaylandSurface *> m_surfaces;
TextureBlitter *m_textureBlitter;
GLuint m_surface_fbo;
QTimer m_renderScheduler;
//Dragging windows around
- QWaylandSurfaceView *m_draggingWindow;
+ QWaylandSurface *m_draggingWindow;
bool m_dragKeyIsPressed;
QPointF m_drag_diff;
@@ -112,6 +109,4 @@
Qt::KeyboardModifiers m_modifiers;
};
-QT_END_NAMESPACE
-
#endif // QWINDOWCOMPOSITOR_H
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/examples/qwindow-compositor/textureblitter.cpp
^
|
@@ -44,8 +44,6 @@
#include <QtGui/QOpenGLContext>
#include <QtGui/QOpenGLFunctions>
-QT_BEGIN_NAMESPACE
-
TextureBlitter::TextureBlitter()
: m_shaderProgram(new QOpenGLShaderProgram)
{
@@ -68,7 +66,7 @@
//Enable transparent windows
glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glBlendFunc (GL_ONE,GL_ONE_MINUS_SRC_ALPHA);
m_shaderProgram->addShaderFromSourceCode(QOpenGLShader::Vertex, textureVertexProgram);
m_shaderProgram->addShaderFromSourceCode(QOpenGLShader::Fragment, textureFragmentProgram);
@@ -162,5 +160,3 @@
currentContext->functions()->glDisableVertexAttribArray(m_vertexCoordEntry);
currentContext->functions()->glDisableVertexAttribArray(m_textureCoordEntry);
}
-
-QT_END_NAMESPACE
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/examples/qwindow-compositor/textureblitter.h
^
|
@@ -43,8 +43,6 @@
#include <QtGui/QMatrix4x4>
-QT_BEGIN_NAMESPACE
-
class QOpenGLShaderProgram;
class TextureBlitter
{
@@ -66,6 +64,4 @@
int m_textureCoordEntry;
};
-QT_END_NAMESPACE
-
#endif // TEXTUREBLITTER_H
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/examples/server-buffer/client/main.cpp
^
|
@@ -149,7 +149,7 @@
{
Q_UNUSED(version);
if (interface == QStringLiteral("qt_share_buffer")) {
- QtWayland::qt_share_buffer::init(QtWayland::wl_registry::object(), name, 1);
+ QtWayland::qt_share_buffer::init(QtWayland::wl_registry::object(), name);
}
}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/examples/server-buffer/compositor/main.cpp
^
|
@@ -38,7 +38,7 @@
**
****************************************************************************/
-#include "qwaylandquickcompositor.h"
+#include "qwaylandcompositor.h"
#include "qwaylandsurface.h"
#include "qwaylandsurfaceitem.h"
@@ -63,15 +63,15 @@
class QmlCompositor
: public QQuickView
- , public QWaylandQuickCompositor
+ , public QWaylandCompositor
, public QtWaylandServer::qt_share_buffer
{
Q_OBJECT
public:
QmlCompositor()
- : QWaylandQuickCompositor(this, 0, DefaultExtensions | SubSurfaceExtension)
- , QtWaylandServer::qt_share_buffer(QWaylandCompositor::handle()->wl_display(), 1)
+ : QWaylandCompositor(this, 0, DefaultExtensions | SubSurfaceExtension)
+ , QtWaylandServer::qt_share_buffer(QWaylandCompositor::handle()->wl_display())
, m_server_buffer_32_bit(0)
, m_server_buffer_item_32_bit(0)
, m_server_buffer_8_bit(0)
@@ -82,19 +82,14 @@
setColor(Qt::black);
create();
grabWindow();
- addDefaultShell();
+ connect(this, SIGNAL(beforeSynchronizing()), this, SLOT(startFrame()), Qt::DirectConnection);
connect(this, SIGNAL(afterRendering()), this, SLOT(sendCallbacks()));
connect(this, SIGNAL(sceneGraphInitialized()), this, SLOT(initiateServerBuffer()),Qt::DirectConnection);
connect(this, SIGNAL(serverBuffersCreated()), this, SLOT(createServerBufferItems()));
}
- Q_INVOKABLE QWaylandSurfaceItem *item(QWaylandSurface *surf)
- {
- return static_cast<QWaylandSurfaceItem *>(surf->views().first());
- }
-
signals:
void windowAdded(QVariant window);
void windowDestroyed(QVariant window);
@@ -103,26 +98,38 @@
void serverBuffersCreated();
public slots:
+ void destroyWindow(QVariant window)
+ {
+ qvariant_cast<QObject *>(window)->deleteLater();
+ }
+
void destroyClientForWindow(QVariant window)
{
- QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(qvariant_cast<QObject *>(window));
+ QWaylandSurface *surface = qobject_cast<QWaylandSurfaceItem *>(qvariant_cast<QObject *>(window))->surface();
destroyClientForSurface(surface);
}
private slots:
void surfaceMapped() {
QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(sender());
- emit windowAdded(QVariant::fromValue(surface));
+ QQuickItem *item = surface->surfaceItem();
+ emit windowAdded(QVariant::fromValue(static_cast<QQuickItem *>(item)));
}
void surfaceUnmapped() {
QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(sender());
- emit windowDestroyed(QVariant::fromValue(surface));
+ QQuickItem *item = surface->surfaceItem();
+ emit windowDestroyed(QVariant::fromValue(item));
}
void surfaceDestroyed(QObject *object) {
QWaylandSurface *surface = static_cast<QWaylandSurface *>(object);
- emit windowDestroyed(QVariant::fromValue(surface));
+ QQuickItem *item = surface->surfaceItem();
+ emit windowDestroyed(QVariant::fromValue(item));
+ }
+
+ void startFrame() {
+ frameStarted();
}
void sendCallbacks() {
@@ -212,6 +219,11 @@
}
void surfaceCreated(QWaylandSurface *surface) {
+ QWaylandSurfaceItem *item = new QWaylandSurfaceItem(surface, rootObject());
+ item->setUseTextureAlpha(true);
+ item->setTouchEventsEnabled(true);
+
+ connect(surface, SIGNAL(destroyed(QObject *)), this, SLOT(surfaceDestroyed(QObject *)));
connect(surface, SIGNAL(mapped()), this, SLOT(surfaceMapped()));
connect(surface,SIGNAL(unmapped()), this,SLOT(surfaceUnmapped()));
}
@@ -258,6 +270,7 @@
compositor.rootContext()->setContextProperty("compositor", &compositor);
QObject::connect(&compositor, SIGNAL(windowAdded(QVariant)), compositor.rootObject(), SLOT(windowAdded(QVariant)));
+ QObject::connect(&compositor, SIGNAL(windowDestroyed(QVariant)), compositor.rootObject(), SLOT(windowDestroyed(QVariant)));
QObject::connect(&compositor, SIGNAL(windowResized(QVariant)), compositor.rootObject(), SLOT(windowResized(QVariant)));
QObject::connect(&compositor, SIGNAL(serverBufferItemCreated(QVariant)), compositor.rootObject(), SLOT(serverBufferItemCreated(QVariant)));
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/examples/server-buffer/compositor/qml/main.qml
^
|
@@ -39,7 +39,6 @@
****************************************************************************/
import QtQuick 2.0
-import QtCompositor 1.0
Item {
id: root
@@ -60,14 +59,16 @@
}
function windowAdded(window) {
- var item = compositor.item(window);
- item.parent = root;
- item.surfaceDestroyed.connect(item.destroy);
+ window.parent = root;
}
function windowResized(window) {
}
+ function windowDestroyed(window) {
+ compositor.destroyWindow(window);
+ }
+
function removeWindow(window) {
}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/qtwayland.pro
^
|
@@ -11,27 +11,17 @@
qtCompileTest(drm_egl_server)
qtCompileTest(libhybris_egl_server)
+!config_wayland: error("QtWayland requires Wayland 1.3.0 or higher")
+!config_wayland_scanner: error("QtWayland requires wayland-scanner")
+!config_wayland_cursor: error("QtWayland requires wayland-cursor")
+
load(qt_parts)
-!config_wayland {
- warning("QtWayland requires Wayland 1.2.0 or higher, QtWayland will not be built")
- SUBDIRS =
-}
!config_xkbcommon {
warning("No xkbcommon 0.2.0 or higher found, disabling support for it")
}
-!config_wayland_scanner {
- warning("QtWayland requires wayland-scanner, QtWayland will not be built")
- SUBDIRS =
-}
-
-!config_wayland_cursor {
- warning("QtWayland requires wayland-cursor, QtWayland will not be built")
- SUBDIRS =
-}
-
!config_wayland_egl {
message("no wayland-egl support detected, cross-toolkit compatibility disabled");
}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/rpm/qtwayland-nogl.spec
^
|
@@ -86,8 +86,9 @@
# We don't need qt5/Qt/
rm -rf %{buildroot}/%{_includedir}/qt5/Qt
-rm -f %{buildroot}/%{_libdir}/qt5/plugins/wayland-graphics-integration-server/liblibhybris-egl-server.so
-rm -f %{buildroot}/%{_libdir}/qt5/plugins/wayland-graphics-integration-client/liblibhybris-egl-server.so
+rm -f %{buildroot}/%{_libdir}/qt5/plugins/wayland-graphics-integration/server/liblibhybris-egl-server.so
+rm -f %{buildroot}/%{_libdir}/qt5/plugins/wayland-graphics-integration/client/liblibhybris-egl-server.so
+
%fdupes %{buildroot}/%{_includedir}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/rpm/qtwayland-xcomposite_egl.spec
^
|
@@ -86,8 +86,9 @@
# We don't need qt5/Qt/
rm -rf %{buildroot}/%{_includedir}/qt5/Qt
-rm -f %{buildroot}/%{_libdir}/qt5/plugins/wayland-graphics-integration-server/liblibhybris-egl-server.so
-rm -f %{buildroot}/%{_libdir}/qt5/plugins/wayland-graphics-integration-client/liblibhybris-egl-server.so
+rm -f %{buildroot}/%{_libdir}/qt5/plugins/wayland-graphics-integration/server/liblibhybris-egl-server.so
+rm -f %{buildroot}/%{_libdir}/qt5/plugins/wayland-graphics-integration/client/liblibhybris-egl-server.so
+
%fdupes %{buildroot}/%{_includedir}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/rpm/qtwayland.spec
^
|
@@ -8,14 +8,16 @@
URL: http://qt.nokia.com
Source0: %{name}-%{version}.tar.bz2
Source100: precheckin.sh
-BuildRequires: pkgconfig(Qt5Core) >= 5.2.1
-BuildRequires: pkgconfig(Qt5Gui) >= 5.2.1
-BuildRequires: pkgconfig(Qt5PlatformSupport) >= 5.2.1
-BuildRequires: pkgconfig(Qt5Qml) >= 5.2.1
-BuildRequires: pkgconfig(Qt5Quick) >= 5.2.1
-BuildRequires: pkgconfig(Qt5DBus) >= 5.2.1
-BuildRequires: pkgconfig(wayland-server) >= 1.2.0
-BuildRequires: pkgconfig(wayland-client) >= 1.2.0
+BuildRequires: pkgconfig(Qt5Core)
+BuildRequires: pkgconfig(Qt5Gui)
+BuildRequires: pkgconfig(Qt5Widgets)
+BuildRequires: pkgconfig(Qt5OpenGL)
+BuildRequires: pkgconfig(Qt5PlatformSupport)
+BuildRequires: pkgconfig(Qt5Qml)
+BuildRequires: pkgconfig(Qt5Quick)
+BuildRequires: pkgconfig(Qt5DBus)
+
+BuildRequires: pkgconfig(wayland-client)
%if "%{name}" == "qt5-qtwayland-wayland_egl"
BuildRequires: pkgconfig(wayland-egl)
%endif
@@ -84,9 +86,9 @@
# We don't need qt5/Qt/
rm -rf %{buildroot}/%{_includedir}/qt5/Qt
-rm -f %{buildroot}/%{_libdir}/qt5/plugins/wayland-graphics-integration-server/liblibhybris-egl-server.so
-rm -f %{buildroot}/%{_libdir}/qt5/plugins/wayland-graphics-integration-client/liblibhybris-egl-server.so
-rm -r %{buildroot}/%{_libdir}/qt5/plugins/wayland-decoration-client/libbradient.so
+rm -f %{buildroot}/%{_libdir}/qt5/plugins/wayland-graphics-integration/server/liblibhybris-egl-server.so
+rm -f %{buildroot}/%{_libdir}/qt5/plugins/wayland-graphics-integration/client/liblibhybris-egl-server.so
+
%fdupes %{buildroot}/%{_includedir}
@@ -103,10 +105,10 @@
%if "%{name}" == "qt5-qtwayland-wayland_egl"
%{_libdir}/qt5/plugins/platforms/libqwayland-egl.so
-%{_libdir}/qt5/plugins/wayland-graphics-integration-client/libdrm-egl-server.so
-%{_libdir}/qt5/plugins/wayland-graphics-integration-client/libwayland-egl.so
-%{_libdir}/qt5/plugins/wayland-graphics-integration-server/libdrm-egl-server.so
-%{_libdir}/qt5/plugins/wayland-graphics-integration-server/libwayland-egl.so
+%{_libdir}/qt5/plugins/wayland-graphics-integration/client/libdrm-egl-server.so
+%{_libdir}/qt5/plugins/wayland-graphics-integration/client/libwayland-egl.so
+%{_libdir}/qt5/plugins/wayland-graphics-integration/server/libdrm-egl-server.so
+%{_libdir}/qt5/plugins/wayland-graphics-integration/server/libwayland-egl.so
%endif
%if "%{name}" == "qt5-qtwayland-xcomposite_egl"
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/3rdparty/protocol/xdg-shell.xml
^
|
@@ -1,444 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<protocol name="xdg_shell">
-
- <copyright>
- Copyright © 2008-2013 Kristian Høgsberg
- Copyright © 2013 Rafael Antognolli
- Copyright © 2013 Jasper St. Pierre
- Copyright © 2010-2013 Intel Corporation
-
- Permission to use, copy, modify, distribute, and sell this
- software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
- all copies and that both that copyright notice and this permission
- notice appear in supporting documentation, and that the name of
- the copyright holders not be used in advertising or publicity
- pertaining to distribution of the software without specific,
- written prior permission. The copyright holders make no
- representations about the suitability of this software for any
- purpose. It is provided "as is" without express or implied
- warranty.
-
- THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
- SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
- SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
- THIS SOFTWARE.
- </copyright>
-
- <interface name="xdg_shell" version="1">
- <description summary="create desktop-style surfaces">
- This interface is implemented by servers that provide
- desktop-style user interfaces.
-
- It allows clients to associate a xdg_surface with
- a basic surface.
- </description>
-
- <enum name="version">
- <description summary="latest protocol version">
- The 'current' member of this enum gives the version of the
- protocol. Implementations can compare this to the version
- they implement using static_assert to ensure the protocol and
- implementation versions match.
- </description>
- <entry name="current" value="3" summary="Always the latest version"/>
- </enum>
-
-
- <request name="use_unstable_version">
- <description summary="enable use of this unstable version">
- Negotiate the unstable version of the interface. This
- mechanism is in place to ensure client and server agree on the
- unstable versions of the protocol that they speak or exit
- cleanly if they don't agree. This request will go away once
- the xdg-shell protocol is stable.
- </description>
- <arg name="version" type="int"/>
- </request>
-
- <request name="get_xdg_surface">
- <description summary="create a shell surface from a surface">
- Create a shell surface for an existing surface.
-
- Only one shell or popup surface can be associated with a given
- surface.
- </description>
- <arg name="id" type="new_id" interface="xdg_surface"/>
- <arg name="surface" type="object" interface="wl_surface"/>
- </request>
-
- <request name="get_xdg_popup">
- <description summary="create a shell surface from a surface">
- Create a popup surface for an existing surface.
-
- Only one shell or popup surface can be associated with a given
- surface.
- </description>
- <arg name="id" type="new_id" interface="xdg_popup"/>
- <arg name="surface" type="object" interface="wl_surface"/>
- <arg name="parent" type="object" interface="wl_surface"/>
- <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat whose pointer is used"/>
- <arg name="serial" type="uint" summary="serial of the implicit grab on the pointer"/>
- <arg name="x" type="int"/>
- <arg name="y" type="int"/>
- <arg name="flags" type="uint"/>
- </request>
-
- <event name="ping">
- <description summary="check if the client is alive">
- The ping event asks the client if it's still alive. Pass the
- serial specified in the event back to the compositor by sending
- a "pong" request back with the specified serial.
-
- Compositors can use this to determine if the client is still
- alive. It's unspecified what will happen if the client doesn't
- respond to the ping request, or in what timeframe. Clients should
- try to respond in a reasonable amount of time.
- </description>
- <arg name="serial" type="uint" summary="pass this to the callback"/>
- </event>
-
- <request name="pong">
- <description summary="respond to a ping event">
- A client must respond to a ping event with a pong request or
- the client may be deemed unresponsive.
- </description>
- <arg name="serial" type="uint" summary="serial of the ping event"/>
- </request>
- </interface>
-
- <interface name="xdg_surface" version="1">
-
- <description summary="desktop-style metadata interface">
- An interface that may be implemented by a wl_surface, for
- implementations that provide a desktop-style user interface.
-
- It provides requests to treat surfaces like windows, allowing to set
- properties like maximized, fullscreen, minimized, and to move and resize
- them, and associate metadata like title and app id.
-
- On the server side the object is automatically destroyed when
- the related wl_surface is destroyed. On client side,
- xdg_surface.destroy() must be called before destroying
- the wl_surface object.
- </description>
-
- <request name="destroy" type="destructor">
- <description summary="remove xdg_surface interface">
- The xdg_surface interface is removed from the wl_surface object
- that was turned into a xdg_surface with
- xdg_shell.get_xdg_surface request. The xdg_surface properties,
- like maximized and fullscreen, are lost. The wl_surface loses
- its role as a xdg_surface. The wl_surface is unmapped.
- </description>
- </request>
-
- <request name="set_transient_for">
- <description summary="surface is a child of another surface">
- Setting a surface as transient of another means that it is child
- of another surface.
-
- Child surfaces are stacked above their parents, and will be
- unmapped if the parent is unmapped too. They should not appear
- on task bars and alt+tab.
- </description>
- <arg name="parent" type="object" interface="wl_surface" allow-null="true"/>
- </request>
-
- <request name="set_margin">
- <description summary="set the visible frame boundaries">
- This tells the compositor what the visible size of the window
- should be, so it can use it to determine what borders to use for
- constrainment and alignment.
-
- CSD often has invisible areas for decoration purposes, like drop
- shadows. These "shadow" drawings need to be subtracted out of the
- normal boundaries of the window when computing where to place
- windows (e.g. to set this window so it's centered on top of another,
- or to put it to the left or right of the screen.)
-
- This value should change as little as possible at runtime, to
- prevent flicker.
-
- This value is also ignored when the window is maximized or
- fullscreen, and assumed to be 0.
-
- If never called, this value is assumed to be 0.
- </description>
- <arg name="left_margin" type="int"/>
- <arg name="right_margin" type="int"/>
- <arg name="top_margin" type="int"/>
- <arg name="bottom_margin" type="int"/>
- </request>
-
- <request name="set_title">
- <description summary="set surface title">
- Set a short title for the surface.
-
- This string may be used to identify the surface in a task bar,
- window list, or other user interface elements provided by the
- compositor.
-
- The string must be encoded in UTF-8.
- </description>
- <arg name="title" type="string"/>
- </request>
-
- <request name="set_app_id">
- <description summary="set surface class">
- Set an id for the surface.
-
- The app id identifies the general class of applications to which
- the surface belongs.
-
- It should be the ID that appears in the new desktop entry
- specification, the interface name.
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/client.pro
^
|
@@ -3,12 +3,8 @@
QT_FOR_PRIVATE += platformsupport-private
MODULE=waylandclient
-MODULE_PLUGIN_TYPES = wayland-graphics-integration-client wayland-decoration-client
-
load(qt_module)
-CONFIG -= precompile_header
-CONFIG -= create_cmake
CONFIG += link_pkgconfig qpa/genericunixfontdatabase wayland-scanner
!equals(QT_WAYLAND_GL_CONFIG, nogl) {
@@ -43,7 +39,6 @@
../extensions/qtkey-extension.xml \
../extensions/windowmanager.xml \
../3rdparty/protocol/text.xml \
- ../3rdparty/protocol/xdg-shell.xml \
SOURCES += qwaylandintegration.cpp \
qwaylandnativeinterface.cpp \
@@ -60,18 +55,13 @@
qwaylanddatadevicemanager.cpp \
qwaylanddatasource.cpp \
qwaylandshellsurface.cpp \
- qwaylandwlshellsurface.cpp \
- qwaylandxdgshell.cpp \
- qwaylandxdgsurface.cpp \
qwaylandextendedoutput.cpp \
qwaylandextendedsurface.cpp \
qwaylandsubsurface.cpp \
qwaylandtouch.cpp \
qwaylandqtkey.cpp \
../shared/qwaylandmimehelper.cpp \
- qwaylandabstractdecoration.cpp \
- qwaylanddecorationfactory.cpp \
- qwaylanddecorationplugin.cpp \
+ qwaylanddecoration.cpp \
qwaylandeventthread.cpp\
qwaylandwindowmanagerintegration.cpp \
qwaylandinputcontext.cpp \
@@ -93,22 +83,16 @@
qwaylanddatadevicemanager_p.h \
qwaylanddatasource_p.h \
qwaylandshellsurface_p.h \
- qwaylandwlshellsurface_p.h \
- qwaylandxdgshell_p.h \
- qwaylandxdgsurface_p.h \
qwaylandextendedoutput_p.h \
qwaylandextendedsurface_p.h \
qwaylandsubsurface_p.h \
qwaylandtouch_p.h \
qwaylandqtkey_p.h \
../shared/qwaylandmimehelper.h \
- qwaylandabstractdecoration_p.h \
- qwaylanddecorationfactory_p.h \
- qwaylanddecorationplugin_p.h \
+ qwaylanddecoration_p.h \
qwaylandeventthread_p.h \
qwaylandwindowmanagerintegration_p.h \
qwaylandinputcontext_p.h \
qwaylanddatadevice_p.h \
include(hardwareintegration/hardwareintegration.pri)
-include(shellintegration/shellintegration.pri)
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/hardwareintegration/qwaylandclientbufferintegration_p.h
^
|
@@ -63,7 +63,6 @@
virtual void initialize(QWaylandDisplay *display) = 0;
virtual bool supportsThreadedOpenGL() const { return false; }
- virtual bool supportsWindowDecoration() const { return false; }
virtual QWaylandWindow *createEglWindow(QWindow *window) = 0;
virtual QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const = 0;
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp
^
|
@@ -50,7 +50,7 @@
#ifndef QT_NO_LIBRARY
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
- (QWaylandClientBufferIntegrationFactoryInterface_iid, QLatin1String("/wayland-graphics-integration-client"), Qt::CaseInsensitive))
+ (QWaylandClientBufferIntegrationFactoryInterface_iid, QLatin1String("/wayland-graphics-integration/client"), Qt::CaseInsensitive))
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
(QWaylandClientBufferIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive))
#endif
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/hardwareintegration/qwaylandhardwareintegration.cpp
^
|
@@ -45,7 +45,7 @@
QT_BEGIN_NAMESPACE
QWaylandHardwareIntegration::QWaylandHardwareIntegration(struct ::wl_registry *registry, int id)
- : qt_hardware_integration(registry, id, 1)
+ : qt_hardware_integration(registry, id)
{
}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/hardwareintegration/qwaylandserverbufferintegration.cpp
^
|
@@ -1,44 +1,3 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
#include "qwaylandserverbufferintegration_p.h"
QT_BEGIN_NAMESPACE
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.cpp
^
|
@@ -50,7 +50,7 @@
#ifndef QT_NO_LIBRARY
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
- (QWaylandServerBufferIntegrationFactoryInterface_iid, QLatin1String("/wayland-graphics-integration-client"), Qt::CaseInsensitive))
+ (QWaylandServerBufferIntegrationFactoryInterface_iid, QLatin1String("/wayland-graphics-integration/client"), Qt::CaseInsensitive))
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
(QWaylandServerBufferIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive))
#endif
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/client/qwaylandabstractdecoration.cpp
^
|
@@ -1,187 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Robin Burchell <robin.burchell@viroteck.net>
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwaylandabstractdecoration_p.h"
-
-#include <private/qobject_p.h>
-#include "qwaylandwindow_p.h"
-#include "qwaylandshellsurface_p.h"
-#include "qwaylandinputdevice_p.h"
-#include "qwaylandscreen_p.h"
-
-#include <QtGui/QImage>
-
-QT_BEGIN_NAMESPACE
-
-class QWaylandAbstractDecorationPrivate : public QObjectPrivate
-{
- Q_DECLARE_PUBLIC(QWaylandAbstractDecoration)
-
-public:
- QWaylandAbstractDecorationPrivate();
- ~QWaylandAbstractDecorationPrivate();
-
- QWindow *m_window;
- QWaylandWindow *m_wayland_window;
-
- bool m_isDirty;
- QImage m_decorationContentImage;
-
- Qt::MouseButtons m_mouseButtons;
-};
-
-QWaylandAbstractDecorationPrivate::QWaylandAbstractDecorationPrivate()
- : m_window(0)
- , m_wayland_window(0)
- , m_isDirty(true)
- , m_decorationContentImage(0)
- , m_mouseButtons(Qt::NoButton)
-{
-}
-
-QWaylandAbstractDecorationPrivate::~QWaylandAbstractDecorationPrivate()
-{
-}
-
-QWaylandAbstractDecoration::QWaylandAbstractDecoration()
- : QObject(*new QWaylandAbstractDecorationPrivate)
-{
-}
-
-QWaylandAbstractDecoration::~QWaylandAbstractDecoration()
-{
-}
-
-// we do this as a setter to get around plugin factory creates not really
-// being a great way to pass arguments
-void QWaylandAbstractDecoration::setWaylandWindow(QWaylandWindow *window)
-{
- Q_D(QWaylandAbstractDecoration);
-
- // double initialization is probably not great
- Q_ASSERT(!d->m_window && !d->m_wayland_window);
-
- d->m_window = window->window();
- d->m_wayland_window = window;
-}
-
-const QImage &QWaylandAbstractDecoration::contentImage()
-{
- Q_D(QWaylandAbstractDecoration);
- if (d->m_isDirty) {
- //Update the decoration backingstore
-
- d->m_decorationContentImage = QImage(window()->frameGeometry().size(), QImage::Format_ARGB32_Premultiplied);
- d->m_decorationContentImage.fill(Qt::transparent);
- this->paint(&d->m_decorationContentImage);
-
- d->m_isDirty = false;
- }
-
- return d->m_decorationContentImage;
-}
-
-void QWaylandAbstractDecoration::update()
-{
- Q_D(QWaylandAbstractDecoration);
- d->m_isDirty = true;
-}
-
-void QWaylandAbstractDecoration::setMouseButtons(Qt::MouseButtons mb)
-{
- Q_D(QWaylandAbstractDecoration);
- d->m_mouseButtons = mb;
-}
-
-void QWaylandAbstractDecoration::startResize(QWaylandInputDevice *inputDevice, enum wl_shell_surface_resize resize, Qt::MouseButtons buttons)
-{
- Q_D(QWaylandAbstractDecoration);
- if (isLeftClicked(buttons)) {
- d->m_wayland_window->shellSurface()->resize(inputDevice, resize);
- inputDevice->removeMouseButtonFromState(Qt::LeftButton);
- }
-}
-
-void QWaylandAbstractDecoration::startMove(QWaylandInputDevice *inputDevice, Qt::MouseButtons buttons)
-{
- Q_D(QWaylandAbstractDecoration);
- if (isLeftClicked(buttons)) {
- d->m_wayland_window->shellSurface()->move(inputDevice);
- inputDevice->removeMouseButtonFromState(Qt::LeftButton);
- }
-}
-
-bool QWaylandAbstractDecoration::isLeftClicked(Qt::MouseButtons newMouseButtonState)
-{
- Q_D(QWaylandAbstractDecoration);
- if ((!d->m_mouseButtons & Qt::LeftButton) && (newMouseButtonState & Qt::LeftButton))
- return true;
- return false;
-}
-
-bool QWaylandAbstractDecoration::isLeftReleased(Qt::MouseButtons newMouseButtonState)
-{
- Q_D(QWaylandAbstractDecoration);
- if ((d->m_mouseButtons & Qt::LeftButton) && !(newMouseButtonState & Qt::LeftButton))
- return true;
- return false;
-}
-
-bool QWaylandAbstractDecoration::isDirty() const
-{
- Q_D(const QWaylandAbstractDecoration);
- return d->m_isDirty;
-}
-
-QWindow *QWaylandAbstractDecoration::window() const
-{
- Q_D(const QWaylandAbstractDecoration);
- return d->m_window;
-}
-
-QWaylandWindow *QWaylandAbstractDecoration::waylandWindow() const
-{
- Q_D(const QWaylandAbstractDecoration);
- return d->m_wayland_window;
-}
-
-QT_END_NAMESPACE
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/client/qwaylandabstractdecoration_p.h
^
|
@@ -1,105 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Robin Burchell <robin.burchell@viroteck.net>
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDABSTRACTDECORATION_H
-#define QWAYLANDABSTRACTDECORATION_H
-
-#include <QtCore/QMargins>
-#include <QtCore/QPointF>
-#include <QtGui/QGuiApplication>
-#include <QtGui/QCursor>
-#include <QtGui/QColor>
-#include <QtGui/QStaticText>
-#include <QtGui/QImage>
-#include <QtWaylandClient/private/qwaylandclientexport_p.h>
-
-#include <wayland-client.h>
-
-#include <QtCore/QDebug>
-
-QT_BEGIN_NAMESPACE
-
-class QWindow;
-class QPaintDevice;
-class QPainter;
-class QEvent;
-class QWaylandScreen;
-class QWaylandWindow;
-class QWaylandInputDevice;
-class QWaylandAbstractDecorationPrivate;
-
-class Q_WAYLAND_CLIENT_EXPORT QWaylandAbstractDecoration : public QObject
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(QWaylandAbstractDecoration)
-public:
- QWaylandAbstractDecoration();
- virtual ~QWaylandAbstractDecoration();
-
- void setWaylandWindow(QWaylandWindow *window);
- QWaylandWindow *waylandWindow() const;
-
- void update();
- bool isDirty() const;
-
- virtual QMargins margins() const = 0;
- QWindow *window() const;
- const QImage &contentImage();
-
- virtual bool handleMouse(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global,Qt::MouseButtons b,Qt::KeyboardModifiers mods) = 0;
- virtual bool handleTouch(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global, Qt::TouchPointState state, Qt::KeyboardModifiers mods) = 0;
-
-protected:
- virtual void paint(QPaintDevice *device) = 0;
-
- void setMouseButtons(Qt::MouseButtons mb);
-
- void startResize(QWaylandInputDevice *inputDevice,enum wl_shell_surface_resize resize, Qt::MouseButtons buttons);
- void startMove(QWaylandInputDevice *inputDevice, Qt::MouseButtons buttons);
-
- bool isLeftClicked(Qt::MouseButtons newMouseButtonState);
- bool isLeftReleased(Qt::MouseButtons newMouseButtonState);
-};
-
-QT_END_NAMESPACE
-
-#endif // QWAYLANDABSTRACTDECORATION_H
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylanddatadevice.cpp
^
|
@@ -77,11 +77,6 @@
return m_selectionOffer.data();
}
-void QWaylandDataDevice::invalidateSelectionOffer()
-{
- m_selectionOffer.reset();
-}
-
QWaylandDataSource *QWaylandDataDevice::selectionSource() const
{
return m_selectionSource.data();
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylanddatadevice_p.h
^
|
@@ -65,7 +65,6 @@
~QWaylandDataDevice();
QWaylandDataOffer *selectionOffer() const;
- void invalidateSelectionOffer();
QWaylandDataSource *selectionSource() const;
void setSelectionSource(QWaylandDataSource *source);
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylanddatadevicemanager.cpp
^
|
@@ -51,7 +51,7 @@
QT_BEGIN_NAMESPACE
QWaylandDataDeviceManager::QWaylandDataDeviceManager(QWaylandDisplay *display, uint32_t id)
- : wl_data_device_manager(display->wl_registry(), id, 1)
+ : wl_data_device_manager(display->wl_registry(), id)
, m_display(display)
{
// Create transfer devices for all input devices.
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylanddataoffer.cpp
^
|
@@ -94,18 +94,30 @@
void QWaylandMimeData::appendFormat(const QString &mimeType)
{
- m_types << mimeType;
+ if (m_types.contains(mimeType))
+ close(m_types.take(mimeType)); // Unconsumed data
m_data.remove(mimeType); // Clear previous contents
+
+ int pipefd[2];
+ if (::pipe2(pipefd, O_CLOEXEC|O_NONBLOCK) == -1) {
+ qWarning("QWaylandMimeData: pipe2() failed");
+ return;
+ }
+
+ m_dataOffer->receive(mimeType, pipefd[1]);
+ m_display->forceRoundTrip();
+ close(pipefd[1]);
+ m_types.insert(mimeType, pipefd[0]);
}
bool QWaylandMimeData::hasFormat_sys(const QString &mimeType) const
{
- return m_types.contains(mimeType);
+ return m_types.contains(mimeType) || m_data.contains(mimeType);
}
QStringList QWaylandMimeData::formats_sys() const
{
- return m_types;
+ return m_types.keys() << m_data.keys();
}
QVariant QWaylandMimeData::retrieveData_sys(const QString &mimeType, QVariant::Type type) const
@@ -118,24 +130,14 @@
if (!m_types.contains(mimeType))
return QVariant();
- int pipefd[2];
- if (::pipe2(pipefd, O_CLOEXEC|O_NONBLOCK) == -1) {
- qWarning("QWaylandMimeData: pipe2() failed");
- return QVariant();
- }
-
- m_dataOffer->receive(mimeType, pipefd[1]);
- m_display->flushRequests();
-
- close(pipefd[1]);
-
QByteArray content;
- if (readData(pipefd[0], content) != 0) {
+ int fd = m_types.take(mimeType);
+ if (readData(fd, content) != 0) {
qWarning("QWaylandDataOffer: error reading data for mimeType %s", qPrintable(mimeType));
content = QByteArray();
}
- close(pipefd[0]);
+ close(fd);
m_data.insert(mimeType, content);
return content;
}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylanddataoffer_p.h
^
|
@@ -87,7 +87,7 @@
mutable QWaylandDataOffer *m_dataOffer;
QWaylandDisplay *m_display;
- mutable QStringList m_types;
+ mutable QHash<QString, int> m_types;
mutable QHash<QString, QByteArray> m_data;
};
|
[-]
[+]
|
Added |
qtwayland.tar.bz2/src/client/qwaylanddecoration.cpp
^
|
@@ -0,0 +1,459 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** 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, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qwaylanddecoration_p.h"
+
+#include "qwaylandwindow_p.h"
+#include "qwaylandshellsurface_p.h"
+#include "qwaylandinputdevice_p.h"
+#include "qwaylandscreen_p.h"
+
+#include <QtGui/QGuiApplication>
+#include <QtGui/QImage>
+#include <QtGui/QCursor>
+#include <QtGui/QPainter>
+#include <QtGui/QPalette>
+#include <QtGui/QLinearGradient>
+
+QT_BEGIN_NAMESPACE
+
+#define BUTTON_SPACING 5
+
+#ifndef QT_NO_IMAGEFORMAT_XPM
+# define BUTTON_WIDTH 10
+
+static const char * const qt_close_xpm[] = {
+"10 10 2 1",
+"# c #000000",
+". c None",
+"..........",
+".##....##.",
+"..##..##..",
+"...####...",
+"....##....",
+"...####...",
+"..##..##..",
+".##....##.",
+"..........",
+".........."};
+
+static const char * const qt_maximize_xpm[]={
+"10 10 2 1",
+"# c #000000",
+". c None",
+"#########.",
+"#########.",
+"#.......#.",
+"#.......#.",
+"#.......#.",
+"#.......#.",
+"#.......#.",
+"#.......#.",
+"#########.",
+".........."};
+
+static const char * const qt_minimize_xpm[] = {
+"10 10 2 1",
+"# c #000000",
+". c None",
+"..........",
+"..........",
+"..........",
+"..........",
+"..........",
+"..........",
+"..........",
+".#######..",
+".#######..",
+".........."};
+
+static const char * const qt_normalizeup_xpm[] = {
+"10 10 2 1",
+"# c #000000",
+". c None",
+"...######.",
+"...######.",
+"...#....#.",
+".######.#.",
+".######.#.",
+".#....###.",
+".#....#...",
+".#....#...",
+".######...",
+".........."};
+#else
+# define BUTTON_WIDTH 22
+#endif
+
+QWaylandDecoration::QWaylandDecoration(QWaylandWindow *window)
+ : m_window(window->window())
+ , m_wayland_window(window)
+ , m_isDirty(true)
+ , m_decorationContentImage(0)
+ , m_margins(3,30,3,3)
+ , m_mouseButtons(Qt::NoButton)
+{
+ m_wayland_window->setDecoration(this);
+
+ QPalette palette;
+ m_foregroundColor = palette.color(QPalette::Active, QPalette::HighlightedText);
+ m_backgroundColor = palette.color(QPalette::Active, QPalette::Highlight);
+
+ QTextOption option(Qt::AlignHCenter | Qt::AlignVCenter);
+ option.setWrapMode(QTextOption::NoWrap);
+ m_windowTitle.setTextOption(option);
+}
+
+QWaylandDecoration::~QWaylandDecoration()
+{
+ m_wayland_window->setDecoration(0);
+}
+
+const QImage &QWaylandDecoration::contentImage()
+{
+ if (m_isDirty) {
+ //Update the decoration backingstore
+
+ m_decorationContentImage = QImage(window()->frameGeometry().size(), QImage::Format_ARGB32_Premultiplied);
+ m_decorationContentImage.fill(Qt::transparent);
+ this->paint(&m_decorationContentImage);
+
+ m_isDirty = false;
+ }
+
+ return m_decorationContentImage;
+}
+
+void QWaylandDecoration::update()
+{
+ m_isDirty = true;
+}
+
+void QWaylandDecoration::paint(QPaintDevice *device)
+{
+ QRect surfaceRect(QPoint(), window()->frameGeometry().size());
+ QRect clips[] =
+ {
+ QRect(0, 0, surfaceRect.width(), margins().top()),
+ QRect(0, surfaceRect.height() - margins().bottom(), surfaceRect.width(), margins().bottom()),
+ QRect(0, margins().top(), margins().left(), surfaceRect.height() - margins().top() - margins().bottom()),
+ QRect(surfaceRect.width() - margins().right(), margins().top(), margins().left(), surfaceRect.height() - margins().top() - margins().bottom())
+ };
+
+ QRect top = clips[0];
+
+ QPainter p(device);
+ p.setRenderHint(QPainter::Antialiasing);
+
+ // Title bar
+ QPoint gradCenter(top.center()+ QPoint(30, 60));
+ QLinearGradient grad(top.topLeft(), top.bottomLeft());
+ QColor base(backgroundColor());
+ grad.setColorAt(0, base.lighter(100));
+ grad.setColorAt(1, base.darker(180));
+ QPainterPath roundedRect;
+ roundedRect.addRoundedRect(surfaceRect, 6, 6);
+ for (int i = 0; i < 4; ++i) {
+ p.save();
+ p.setClipRect(clips[i]);
+ p.fillPath(roundedRect, grad);
+ p.restore();
+ }
|
[-]
[+]
|
Added |
qtwayland.tar.bz2/src/client/qwaylanddecoration_p.h
^
|
@@ -0,0 +1,155 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** 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, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWAYLANDDECORATION_H
+#define QWAYLANDDECORATION_H
+
+#include <QtCore/QMargins>
+#include <QtCore/QPointF>
+#include <QtGui/QGuiApplication>
+#include <QtGui/QCursor>
+#include <QtGui/QColor>
+#include <QtGui/QStaticText>
+#include <QtGui/QImage>
+#include <QtWaylandClient/private/qwaylandclientexport_p.h>
+
+#include <wayland-client.h>
+
+#include <QtCore/QDebug>
+
+QT_BEGIN_NAMESPACE
+
+class QWindow;
+class QPaintDevice;
+class QPainter;
+class QEvent;
+class QWaylandScreen;
+class QWaylandWindow;
+class QWaylandInputDevice;
+
+class Q_WAYLAND_CLIENT_EXPORT QWaylandDecoration
+{
+public:
+ QWaylandDecoration(QWaylandWindow *window);
+ virtual ~QWaylandDecoration();
+
+ void update();
+ bool isDirty() const;
+
+ bool handleMouse(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global,Qt::MouseButtons b,Qt::KeyboardModifiers mods);
+ bool inMouseButtonPressedState() const;
+
+ void startResize(QWaylandInputDevice *inputDevice,enum wl_shell_surface_resize resize, Qt::MouseButtons buttons);
+ void startMove(QWaylandInputDevice *inputDevice, Qt::MouseButtons buttons);
+ QMargins margins() const;
+ QWindow *window() const;
+ QWaylandWindow *waylandWindow() const;
+ const QImage &contentImage();
+
+ void setForegroundColor(const QColor &c);
+ inline QColor foregroundColor() const;
+
+ void setBackgroundColor(const QColor &c);
+ inline QColor backgroundColor() const;
+
+protected:
+ void paint(QPaintDevice *device);
+
+private:
+ void processMouseTop(QWaylandInputDevice *inputDevice, const QPointF &local, Qt::MouseButtons b,Qt::KeyboardModifiers mods);
+ void processMouseBottom(QWaylandInputDevice *inputDevice, const QPointF &local, Qt::MouseButtons b,Qt::KeyboardModifiers mods);
+ void processMouseLeft(QWaylandInputDevice *inputDevice, const QPointF &local, Qt::MouseButtons b,Qt::KeyboardModifiers mods);
+ void processMouseRight(QWaylandInputDevice *inputDevice, const QPointF &local, Qt::MouseButtons b,Qt::KeyboardModifiers mods);
+
+ bool isLeftClicked(Qt::MouseButtons newMouseButtonState);
+ bool isLeftReleased(Qt::MouseButtons newMouseButtonState);
+
+ QRectF closeButtonRect() const;
+ QRectF maximizeButtonRect() const;
+ QRectF minimizeButtonRect() const;
+
+ QWindow *m_window;
+ QWaylandWindow *m_wayland_window;
+
+ bool m_isDirty;
+ QImage m_decorationContentImage;
+
+ QMargins m_margins;
+ Qt::MouseButtons m_mouseButtons;
+
+ QColor m_foregroundColor;
+ QColor m_backgroundColor;
+ QStaticText m_windowTitle;
+};
+
+inline bool QWaylandDecoration::isDirty() const
+{
+ return m_isDirty;
+}
+
+inline QMargins QWaylandDecoration::margins() const
+{
+ return m_margins;
+}
+
+inline QWindow *QWaylandDecoration::window() const
+{
+ return m_window;
+}
+
+inline QWaylandWindow *QWaylandDecoration::waylandWindow() const
+{
+ return m_wayland_window;
+}
+
+inline QColor QWaylandDecoration::foregroundColor() const
+{
+ return m_foregroundColor;
+}
+
+inline QColor QWaylandDecoration::backgroundColor() const
+{
+ return m_backgroundColor;
+}
+
+QT_END_NAMESPACE
+
+#endif // QWAYLANDDECORATION_H
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/client/qwaylanddecorationfactory.cpp
^
|
@@ -1,97 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Robin Burchell <robin.burchell@viroteck.net>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwaylanddecorationfactory_p.h"
-#include "qwaylanddecorationplugin_p.h"
-
-#include <QtCore/private/qfactoryloader_p.h>
-#include <QtCore/QCoreApplication>
-#include <QtCore/QDir>
-
-QT_BEGIN_NAMESPACE
-
-#ifndef QT_NO_LIBRARY
-Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
- (QWaylandDecorationFactoryInterface_iid, QLatin1String("/wayland-decoration-client"), Qt::CaseInsensitive))
-Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
- (QWaylandDecorationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive))
-#endif
-
-QStringList QWaylandDecorationFactory::keys(const QString &pluginPath)
-{
-#ifndef QT_NO_LIBRARY
- QStringList list;
- if (!pluginPath.isEmpty()) {
- QCoreApplication::addLibraryPath(pluginPath);
- list = directLoader()->keyMap().values();
- if (!list.isEmpty()) {
- const QString postFix = QStringLiteral(" (from ")
- + QDir::toNativeSeparators(pluginPath)
- + QLatin1Char(')');
- const QStringList::iterator end = list.end();
- for (QStringList::iterator it = list.begin(); it != end; ++it)
- (*it).append(postFix);
- }
- }
- list.append(loader()->keyMap().values());
- return list;
-#else
- return QStringList();
-#endif
-}
-
-QWaylandAbstractDecoration *QWaylandDecorationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath)
-{
-#ifndef QT_NO_LIBRARY
- // Try loading the plugin from platformPluginPath first:
- if (!pluginPath.isEmpty()) {
- QCoreApplication::addLibraryPath(pluginPath);
- if (QWaylandAbstractDecoration *ret = qLoadPlugin1<QWaylandAbstractDecoration, QWaylandDecorationPlugin>(directLoader(), name, args))
- return ret;
- }
- if (QWaylandAbstractDecoration *ret = qLoadPlugin1<QWaylandAbstractDecoration, QWaylandDecorationPlugin>(loader(), name, args))
- return ret;
-#endif
-
- return 0;
-}
-
-QT_END_NAMESPACE
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/client/qwaylanddecorationfactory_p.h
^
|
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Robin Burchell <robin.burchell@viroteck.net>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDDECORATIONFACTORY_H
-#define QWAYLANDDECORATIONFACTORY_H
-
-#include <QtWaylandClient/private/qwaylandclientexport_p.h>
-#include <QtCore/QStringList>
-
-QT_BEGIN_NAMESPACE
-
-class QWaylandAbstractDecoration;
-
-class Q_WAYLAND_CLIENT_EXPORT QWaylandDecorationFactory
-{
-public:
- static QStringList keys(const QString &pluginPath = QString());
- static QWaylandAbstractDecoration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString());
-};
-
-QT_END_NAMESPACE
-
-#endif // QWAYLANDDECORATIONFACTORY_H
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/client/qwaylanddecorationplugin.cpp
^
|
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Robin Burchell <robin.burchell@viroteck.net>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwaylanddecorationplugin_p.h"
-
-QT_BEGIN_NAMESPACE
-
-QWaylandDecorationPlugin::QWaylandDecorationPlugin(QObject *parent)
- : QObject(parent)
-{
-}
-QWaylandDecorationPlugin::~QWaylandDecorationPlugin()
-{
-}
-
-QT_END_NAMESPACE
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/client/qwaylanddecorationplugin_p.h
^
|
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Robin Burchell <robin.burchell@viroteck.net>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDDECORATIONPLUGIN_H
-#define QWAYLANDDECORATIONPLUGIN_H
-
-#include <QtWaylandClient/private/qwaylandclientexport_p.h>
-
-#include <QtCore/qplugin.h>
-#include <QtCore/qfactoryinterface.h>
-#include <QtCore/QObject>
-
-QT_BEGIN_NAMESPACE
-
-class QWaylandAbstractDecoration;
-
-#define QWaylandDecorationFactoryInterface_iid "org.qt-project.Qt.WaylandClient.QWaylandDecorationFactoryInterface.5.4"
-
-class Q_WAYLAND_CLIENT_EXPORT QWaylandDecorationPlugin : public QObject
-{
- Q_OBJECT
-public:
- explicit QWaylandDecorationPlugin(QObject *parent = 0);
- ~QWaylandDecorationPlugin();
-
- virtual QWaylandAbstractDecoration *create(const QString &key, const QStringList ¶mList) = 0;
-};
-
-QT_END_NAMESPACE
-
-#endif // QWAYLANDDECORATIONPLUGIN_H
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylanddisplay.cpp
^
|
@@ -50,13 +50,9 @@
#include "qwaylandclipboard_p.h"
#include "qwaylanddatadevicemanager_p.h"
#include "qwaylandhardwareintegration_p.h"
-#include "qwaylandxdgshell_p.h"
-#include "qwaylandxdgsurface_p.h"
-#include "qwaylandwlshellsurface_p.h"
+
#include "qwaylandwindowmanagerintegration_p.h"
-#include "qwaylandshellintegration_p.h"
-#include "qwaylandclientbufferintegration_p.h"
#include "qwaylandextendedoutput_p.h"
#include "qwaylandextendedsurface_p.h"
@@ -65,7 +61,6 @@
#include "qwaylandqtkey_p.h"
#include <QtWaylandClient/private/qwayland-text.h>
-#include <QtWaylandClient/private/qwayland-xdg-shell.h>
#include <QtCore/QAbstractEventDispatcher>
#include <QtGui/private/qguiapplication_p.h>
@@ -83,20 +78,6 @@
return surface;
}
-QWaylandShellSurface *QWaylandDisplay::createShellSurface(QWaylandWindow *window)
-{
- if (mWaylandIntegration->shellIntegration())
- return mWaylandIntegration->shellIntegration()->createShellSurface(window);
-
- if (shellXdg()) {
- return new QWaylandXdgSurface(shellXdg()->get_xdg_surface(window->object()), window);
- } else if (shell()) {
- return new QWaylandWlShellSurface(shell()->get_shell_surface(window->object()), window);
- }
-
- return Q_NULLPTR;
-}
-
QWaylandClientBufferIntegration * QWaylandDisplay::clientBufferIntegration() const
{
return mWaylandIntegration->clientBufferIntegration();
@@ -117,6 +98,8 @@
mLastKeyboardFocusInputDevice = device;
}
+static QWaylandDisplay *display = 0;
+
QWaylandDisplay::QWaylandDisplay(QWaylandIntegration *waylandIntegration)
: mWaylandIntegration(waylandIntegration)
, mLastKeyboardFocusInputDevice(0)
@@ -129,11 +112,12 @@
, mTextInputManager(0)
, mHardwareIntegration(0)
{
+ display = this;
qRegisterMetaType<uint32_t>("uint32_t");
mEventThreadObject = new QWaylandEventThread(0);
mEventThread = new QThread(this);
- mEventThread->setObjectName(QStringLiteral("QtWayland"));
+ mEventThread->setObjectName("QtWayland event thread");
mEventThreadObject->moveToThread(mEventThread);
mEventThread->start();
@@ -149,17 +133,16 @@
init(registry);
connect(mEventThreadObject, SIGNAL(newEventsRead()), this, SLOT(flushRequests()));
- connect(mEventThreadObject, &QWaylandEventThread::fatalError, this, &QWaylandDisplay::exitWithError);
mWindowManagerIntegration.reset(new QWaylandWindowManagerIntegration(this));
- forceRoundTrip();
+ blockingReadEvents();
+
+ waitForScreens();
}
QWaylandDisplay::~QWaylandDisplay(void)
{
- qDeleteAll(mScreens);
- mScreens.clear();
delete mDndSelectionHandler.take();
mEventThread->quit();
mEventThread->wait();
@@ -168,28 +151,22 @@
void QWaylandDisplay::flushRequests()
{
- if (wl_display_dispatch_queue_pending(mDisplay, mEventQueue) < 0) {
- mEventThreadObject->checkError();
- exitWithError();
+ if (wl_display_dispatch_queue_pending(mDisplay, mEventQueue) == -1 && (errno == EPIPE || errno == ECONNRESET)) {
+ qWarning("The Wayland connection broke. Did the Wayland compositor die?");
+ ::exit(1);
}
-
wl_display_flush(mDisplay);
}
void QWaylandDisplay::blockingReadEvents()
{
- if (wl_display_dispatch_queue(mDisplay, mEventQueue) < 0) {
- mEventThreadObject->checkError();
- exitWithError();
+ if (wl_display_dispatch_queue(mDisplay, mEventQueue) == -1 && (errno == EPIPE || errno == ECONNRESET)) {
+ qWarning("The Wayland connection broke. Did the Wayland compositor die?");
+ ::exit(1);
}
}
-void QWaylandDisplay::exitWithError()
-{
- ::exit(1);
-}
-
QWaylandScreen *QWaylandDisplay::screenForOutput(struct wl_output *output) const
{
for (int i = 0; i < mScreens.size(); ++i) {
@@ -226,44 +203,34 @@
struct ::wl_registry *registry = object();
if (interface == QStringLiteral("wl_output")) {
- QWaylandScreen *screen = new QWaylandScreen(this, id);
- mScreens.append(screen);
- // We need to get the output events before creating surfaces
- forceRoundTrip();
- mWaylandIntegration->screenAdded(screen);
+ mScreens.append(new QWaylandScreen(this, id));
} else if (interface == QStringLiteral("wl_compositor")) {
- mCompositor.init(registry, id, 3);
+ mCompositor.init(registry, id);
} else if (interface == QStringLiteral("wl_shm")) {
mShm = static_cast<struct wl_shm *>(wl_registry_bind(registry, id, &wl_shm_interface,1));
- } else if (interface == QStringLiteral("xdg_shell")
- && qEnvironmentVariableIsSet("QT_WAYLAND_USE_XDG_SHELL")) {
- mShellXdg.reset(new QWaylandXdgShell(registry,id));
} else if (interface == QStringLiteral("wl_shell")){
- mShell.reset(new QtWayland::wl_shell(registry, id, 1));
+ mShell.reset(new QtWayland::wl_shell(registry, id));
} else if (interface == QStringLiteral("wl_seat")) {
QWaylandInputDevice *inputDevice = new QWaylandInputDevice(this, id);
mInputDevices.append(inputDevice);
} else if (interface == QStringLiteral("wl_data_device_manager")) {
mDndSelectionHandler.reset(new QWaylandDataDeviceManager(this, id));
} else if (interface == QStringLiteral("qt_output_extension")) {
- mOutputExtension.reset(new QtWayland::qt_output_extension(registry, id, 1));
+ mOutputExtension.reset(new QtWayland::qt_output_extension(registry, id));
foreach (QPlatformScreen *screen, screens())
static_cast<QWaylandScreen *>(screen)->createExtendedOutput();
} else if (interface == QStringLiteral("qt_surface_extension")) {
- mWindowExtension.reset(new QtWayland::qt_surface_extension(registry, id, 2));
+ mWindowExtension.reset(new QtWayland::qt_surface_extension(registry, id));
} else if (interface == QStringLiteral("qt_sub_surface_extension")) {
- mSubSurfaceExtension.reset(new QtWayland::qt_sub_surface_extension(registry, id, 1));
+ mSubSurfaceExtension.reset(new QtWayland::qt_sub_surface_extension(registry, id));
} else if (interface == QStringLiteral("qt_touch_extension")) {
mTouchExtension.reset(new QWaylandTouchExtension(this, id));
} else if (interface == QStringLiteral("qt_key_extension")) {
mQtKeyExtension.reset(new QWaylandQtKeyExtension(this, id));
} else if (interface == QStringLiteral("wl_text_input_manager")) {
- mTextInputManager.reset(new QtWayland::wl_text_input_manager(registry, id, 1));
+ mTextInputManager.reset(new QtWayland::wl_text_input_manager(registry, id));
} else if (interface == QStringLiteral("qt_hardware_integration")) {
mHardwareIntegration.reset(new QWaylandHardwareIntegration(registry, id));
- // make a roundtrip here since we need to receive the events sent by
- // qt_hardware_integration before creating windows
- forceRoundTrip();
}
mGlobals.append(RegistryGlobal(id, interface, version, registry));
@@ -275,17 +242,7 @@
void QWaylandDisplay::registry_global_remove(uint32_t id)
{
for (int i = 0, ie = mGlobals.count(); i != ie; ++i) {
- RegistryGlobal &global = mGlobals[i];
- if (global.id == id) {
- if (global.interface == QStringLiteral("wl_output")) {
- foreach (QWaylandScreen *screen, mScreens) {
- if (screen->outputId() == id) {
- delete screen;
- mScreens.removeOne(screen);
- break;
- }
- }
- }
+ if (mGlobals[i].id == id) {
mGlobals.removeAt(i);
break;
}
@@ -310,52 +267,9 @@
return 0;
}
-static void
-sync_callback(void *data, struct wl_callback *callback, uint32_t serial)
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylanddisplay_p.h
^
|
@@ -51,7 +51,6 @@
#include <QtWaylandClient/private/qwayland-wayland.h>
#include <QtWaylandClient/private/qwaylandclientexport_p.h>
-#include <QtWaylandClient/private/qwayland-xdg-shell.h>
struct wl_cursor_image;
@@ -72,8 +71,6 @@
class QWaylandEventThread;
class QWaylandIntegration;
class QWaylandHardwareIntegration;
-class QWaylandXdgShell;
-class QWaylandShellSurface;
namespace QtWayland {
class qt_output_extension;
@@ -81,7 +78,6 @@
class qt_sub_surface_extension;
class qt_surface_extension;
class wl_text_input_manager;
- class xdg_shell;
}
typedef void (*RegistryListener)(void *data,
@@ -97,12 +93,11 @@
QWaylandDisplay(QWaylandIntegration *waylandIntegration);
~QWaylandDisplay(void);
- QList<QWaylandScreen *> screens() const { return mScreens; }
+ QList<QPlatformScreen *> screens() const { return mScreens; }
QWaylandScreen *screenForOutput(struct wl_output *output) const;
struct wl_surface *createSurface(void *handle);
- QWaylandShellSurface *createShellSurface(QWaylandWindow *window);
QWaylandClientBufferIntegration *clientBufferIntegration() const;
@@ -118,7 +113,6 @@
QtWayland::wl_compositor *compositor() { return &mCompositor; }
QtWayland::wl_shell *shell() { return mShell.data(); }
- QtWayland::xdg_shell *shellXdg();
QList<QWaylandInputDevice *> inputDevices() const { return mInputDevices; }
QWaylandInputDevice *defaultInputDevice() const;
@@ -144,7 +138,6 @@
RegistryGlobal(uint32_t id_, const QString &interface_, uint32_t version_, struct ::wl_registry *registry_)
: id(id_), interface(interface_), version(version_), registry(registry_) { }
};
- QList<RegistryGlobal> globals() const { return mGlobals; }
/* wl_registry_add_listener does not add but rather sets a listener, so this function is used
* to enable many listeners at once. */
@@ -156,15 +149,12 @@
void forceRoundTrip();
- bool supportsWindowDecoration() const;
-
public slots:
void blockingReadEvents();
void flushRequests();
private:
void waitForScreens();
- void exitWithError();
struct Listener {
RegistryListener listener;
@@ -178,8 +168,7 @@
QThread *mEventThread;
QWaylandEventThread *mEventThreadObject;
QScopedPointer<QtWayland::wl_shell> mShell;
- QScopedPointer<QWaylandXdgShell> mShellXdg;
- QList<QWaylandScreen *> mScreens;
+ QList<QPlatformScreen *> mScreens;
QList<QWaylandInputDevice *> mInputDevices;
QList<Listener> mRegistryListeners;
QWaylandIntegration *mWaylandIntegration;
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylandeventthread.cpp
^
|
@@ -1,44 +1,3 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
#include "qwaylandeventthread_p.h"
#include <QtCore/QSocketNotifier>
#include <QCoreApplication>
@@ -71,28 +30,12 @@
QMetaObject::invokeMethod(this, "waylandDisplayConnect", Qt::QueuedConnection);
}
-// ### be careful what you do, this function may also be called from other
-// threads to clean up & exit.
-void QWaylandEventThread::checkError() const
-{
- int ecode = wl_display_get_error(m_display);
- if ((ecode == EPIPE || ecode == ECONNRESET)) {
- // special case this to provide a nicer error
- qWarning("The Wayland connection broke. Did the Wayland compositor die?");
- } else {
- qErrnoWarning(ecode, "The Wayland connection experienced a fatal error");
- }
-}
-
void QWaylandEventThread::readWaylandEvents()
{
- if (wl_display_dispatch(m_display) < 0) {
- checkError();
- m_readNotifier->setEnabled(false);
- emit fatalError();
- return;
+ if (wl_display_dispatch(m_display) == -1 && (errno == EPIPE || errno == ECONNRESET)) {
+ qWarning("The Wayland connection broke. Did the Wayland compositor die?");
+ ::exit(1);
}
-
emit newEventsRead();
}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylandeventthread_p.h
^
|
@@ -1,44 +1,3 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
#ifndef QWAYLANDEVENTTHREAD_H
#define QWAYLANDEVENTTHREAD_H
@@ -63,8 +22,6 @@
wl_display *display() const;
- void checkError() const;
-
private slots:
void readWaylandEvents();
@@ -72,7 +29,6 @@
signals:
void newEventsRead();
- void fatalError();
private:
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylandextendedoutput.cpp
^
|
@@ -52,7 +52,49 @@
QWaylandExtendedOutput::QWaylandExtendedOutput(QWaylandScreen *screen, ::qt_extended_output *extended_output)
: QtWayland::qt_extended_output(extended_output)
, m_screen(screen)
+ , m_orientation(m_screen->orientation())
{
}
+Qt::ScreenOrientation QWaylandExtendedOutput::currentOrientation() const
+{
+ return m_orientation;
+}
+
+void QWaylandExtendedOutput::setOrientationUpdateMask(Qt::ScreenOrientations orientations)
+{
+ int mask = 0;
+ if (orientations & Qt::PortraitOrientation)
+ mask |= QT_EXTENDED_OUTPUT_ROTATION_PORTRAITORIENTATION;
+ if (orientations & Qt::LandscapeOrientation)
+ mask |= QT_EXTENDED_OUTPUT_ROTATION_LANDSCAPEORIENTATION;
+ if (orientations & Qt::InvertedPortraitOrientation)
+ mask |= QT_EXTENDED_OUTPUT_ROTATION_INVERTEDPORTRAITORIENTATION;
+ if (orientations & Qt::InvertedLandscapeOrientation)
+ mask |= QT_EXTENDED_OUTPUT_ROTATION_INVERTEDLANDSCAPEORIENTATION;
+ set_orientation_update_mask(mask);
+}
+
+void QWaylandExtendedOutput::extended_output_set_screen_rotation(int32_t rotation)
+{
+ switch (rotation) {
+ case QT_EXTENDED_OUTPUT_ROTATION_PORTRAITORIENTATION:
+ m_orientation = Qt::PortraitOrientation;
+ break;
+ case QT_EXTENDED_OUTPUT_ROTATION_LANDSCAPEORIENTATION:
+ m_orientation = Qt::LandscapeOrientation;
+ break;
+ case QT_EXTENDED_OUTPUT_ROTATION_INVERTEDPORTRAITORIENTATION:
+ m_orientation = Qt::InvertedPortraitOrientation;
+ break;
+ case QT_EXTENDED_OUTPUT_ROTATION_INVERTEDLANDSCAPEORIENTATION:
+ m_orientation = Qt::InvertedLandscapeOrientation;
+ break;
+ default:
+ m_orientation = Qt::PortraitOrientation;
+ break;
+ }
+ QWindowSystemInterface::handleScreenOrientationChange(m_screen->screen(), m_orientation);
+}
+
QT_END_NAMESPACE
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylandextendedoutput_p.h
^
|
@@ -56,9 +56,14 @@
public:
QWaylandExtendedOutput(QWaylandScreen *screen, struct ::qt_extended_output *extended_output);
+ Qt::ScreenOrientation currentOrientation() const;
+ void setOrientationUpdateMask(Qt::ScreenOrientations mask);
+
private:
+ void extended_output_set_screen_rotation(int32_t rotation) Q_DECL_OVERRIDE;
QWaylandScreen *m_screen;
+ Qt::ScreenOrientation m_orientation;
};
QT_END_NAMESPACE
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylandextendedsurface.cpp
^
|
@@ -53,8 +53,8 @@
QT_BEGIN_NAMESPACE
-QWaylandExtendedSurface::QWaylandExtendedSurface(QWaylandWindow *window)
- : QtWayland::qt_extended_surface(window->display()->windowExtension()->get_extended_surface(window->object()))
+QWaylandExtendedSurface::QWaylandExtendedSurface(QWaylandWindow *window, struct ::qt_extended_surface *extended_surface)
+ : QtWayland::qt_extended_surface(extended_surface)
, m_window(window)
{
}
@@ -71,22 +71,42 @@
ds << value;
update_generic_property(name, byteValue);
+
+ m_properties.insert(name, value);
+ QWaylandNativeInterface *nativeInterface = static_cast<QWaylandNativeInterface *>(
+ QGuiApplication::platformNativeInterface());
+ nativeInterface->emitWindowPropertyChanged(m_window, name);
+}
+
+static int32_t waylandRotationFromScreenOrientation(Qt::ScreenOrientation orientation)
+{
+ switch (orientation) {
+ case Qt::PortraitOrientation: return QT_EXTENDED_SURFACE_ORIENTATION_PORTRAITORIENTATION;
+ case Qt::InvertedPortraitOrientation: return QT_EXTENDED_SURFACE_ORIENTATION_INVERTEDPORTRAITORIENTATION;
+ case Qt::LandscapeOrientation: return QT_EXTENDED_SURFACE_ORIENTATION_LANDSCAPEORIENTATION;
+ case Qt::InvertedLandscapeOrientation: return QT_EXTENDED_SURFACE_ORIENTATION_INVERTEDLANDSCAPEORIENTATION;
+ default: return QT_EXTENDED_SURFACE_ORIENTATION_PRIMARYORIENTATION;
+ }
+}
+
+void QWaylandExtendedSurface::setContentOrientation(Qt::ScreenOrientation orientation)
+{
+ set_content_orientation(waylandRotationFromScreenOrientation(orientation));
}
-void QWaylandExtendedSurface::setContentOrientationMask(Qt::ScreenOrientations mask)
+QVariantMap QWaylandExtendedSurface::properties() const
{
- int32_t wlmask = 0;
- if (mask & Qt::PrimaryOrientation)
- wlmask |= QT_EXTENDED_SURFACE_ORIENTATION_PRIMARYORIENTATION;
- if (mask & Qt::PortraitOrientation)
- wlmask |= QT_EXTENDED_SURFACE_ORIENTATION_PORTRAITORIENTATION;
- if (mask & Qt::LandscapeOrientation)
- wlmask |= QT_EXTENDED_SURFACE_ORIENTATION_LANDSCAPEORIENTATION;
- if (mask & Qt::InvertedPortraitOrientation)
- wlmask |= QT_EXTENDED_SURFACE_ORIENTATION_INVERTEDPORTRAITORIENTATION;
- if (mask & Qt::InvertedLandscapeOrientation)
- wlmask |= QT_EXTENDED_SURFACE_ORIENTATION_INVERTEDLANDSCAPEORIENTATION;
- set_content_orientation_mask(wlmask);
+ return m_properties;
+}
+
+QVariant QWaylandExtendedSurface::property(const QString &name)
+{
+ return m_properties.value(name);
+}
+
+QVariant QWaylandExtendedSurface::property(const QString &name, const QVariant &defaultValue)
+{
+ return m_properties.value(name,defaultValue);
}
void QWaylandExtendedSurface::extended_surface_onscreen_visibility(int32_t visibility)
@@ -102,7 +122,11 @@
QDataStream ds(data);
ds >> variantValue;
- m_window->setProperty(name, variantValue);
+ m_properties.insert(name, variantValue);
+
+ QWaylandNativeInterface *nativeInterface = static_cast<QWaylandNativeInterface *>(
+ QGuiApplication::platformNativeInterface());
+ nativeInterface->emitWindowPropertyChanged(m_window, name);
}
void QWaylandExtendedSurface::extended_surface_close()
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylandextendedsurface_p.h
^
|
@@ -58,13 +58,17 @@
class Q_WAYLAND_CLIENT_EXPORT QWaylandExtendedSurface : public QtWayland::qt_extended_surface
{
public:
- QWaylandExtendedSurface(QWaylandWindow *window);
+ QWaylandExtendedSurface(QWaylandWindow *window, struct ::qt_extended_surface *extended_surface);
~QWaylandExtendedSurface();
- void setContentOrientationMask(Qt::ScreenOrientations mask);
+ void setContentOrientation(Qt::ScreenOrientation orientation);
void updateGenericProperty(const QString &name, const QVariant &value);
+ QVariantMap properties() const;
+ QVariant property(const QString &name);
+ QVariant property(const QString &name, const QVariant &defaultValue);
+
Qt::WindowFlags setWindowFlags(Qt::WindowFlags flags);
private:
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylandinputdevice.cpp
^
|
@@ -82,7 +82,6 @@
, mXkbState(0)
#endif
, mFocusCallback(0)
- , mNativeModifiers(0)
{
#ifndef QT_NO_WAYLAND_XKB
xkb_rule_names names;
@@ -141,15 +140,11 @@
xkb_state *mXkbState;
#endif
struct wl_callback *mFocusCallback;
- uint32_t mNativeModifiers;
int mRepeatKey;
uint32_t mRepeatCode;
uint32_t mRepeatTime;
QString mRepeatText;
-#ifndef QT_NO_WAYLAND_XKB
- xkb_keysym_t mRepeatSym;
-#endif
static const wl_callback_listener callback;
static void focusCallback(void *data, struct wl_callback *callback, uint32_t time);
@@ -220,8 +215,6 @@
void touch_frame() Q_DECL_OVERRIDE;
void touch_cancel() Q_DECL_OVERRIDE;
- bool allTouchPointsReleased();
-
QWaylandInputDevice *mParent;
QWaylandWindow *mFocus;
QList<QWindowSystemInterface::TouchPoint> mTouchPoints;
@@ -230,7 +223,7 @@
QWaylandInputDevice::QWaylandInputDevice(QWaylandDisplay *display, uint32_t id)
: QObject()
- , QtWayland::wl_seat(display->wl_registry(), id, 2)
+ , QtWayland::wl_seat(display->wl_registry(), id)
, mQDisplay(display)
, mDisplay(display->wl_display())
, mCaps(0)
@@ -525,12 +518,6 @@
QPoint pixelDelta;
QPoint angleDelta;
- if (window == NULL) {
- // We destroyed the pointer focus surface, but the server
- // didn't get the message yet.
- return;
- }
-
//normalize value and inverse axis
int valueDelta = wl_fixed_to_int(value) * -12;
@@ -717,11 +704,6 @@
Q_UNUSED(time);
Q_UNUSED(surface);
- if (surface) {
- QWaylandWindow *window = QWaylandWindow::fromWlSurface(surface);
- window->unfocus();
- }
-
mFocus = NULL;
// Use a callback to set the focus because we may get a leave/enter pair, and
@@ -762,51 +744,51 @@
QString text;
int qtkey = key + 8; // qt-compositor substracts 8 for some reason
- if (!window) {
- // We destroyed the keyboard focus surface, but the server
- // didn't get the message yet.
- return;
- }
-
#ifndef QT_NO_WAYLAND_XKB
if (!mXkbMap)
return;
- const xkb_keysym_t sym = xkb_state_key_get_one_sym(mXkbState, code);
- xkb_state_update_key(mXkbState, code, isDown ? XKB_KEY_DOWN : XKB_KEY_UP);
-
- Qt::KeyboardModifiers modifiers = mParent->modifiers();
-
- uint utf32 = xkb_keysym_to_utf32(sym);
- text = QString::fromUcs4(&utf32, 1);
+ const xkb_keysym_t *syms;
+ uint32_t numSyms = xkb_key_get_syms(mXkbState, code, &syms);
+ xkb_state_update_key(mXkbState, code,
+ isDown ? XKB_KEY_DOWN : XKB_KEY_UP);
- qtkey = keysymToQtKey(sym, modifiers, text);
+ if (!window) {
+ // We destroyed the keyboard focus surface, but the server
+ // didn't get the message yet.
+ return;
+ }
- QWindowSystemInterface::handleExtendedKeyEvent(window->window(),
- time, type, qtkey,
- modifiers,
- code, sym, mNativeModifiers, text);
+ if (numSyms == 1) {
+ xkb_keysym_t sym = syms[0];
+ Qt::KeyboardModifiers modifiers = mParent->modifiers();
+
+ uint utf32 = xkb_keysym_to_utf32(sym);
+ text = QString::fromUcs4(&utf32, 1);
+
+ qtkey = keysymToQtKey(sym, modifiers, text);
+
+ QWindowSystemInterface::handleExtendedKeyEvent(window->window(),
+ time, type, qtkey,
+ modifiers,
+ code, 0, 0, text);
+ }
#else
// Generic fallback for single hard keys: Assume 'key' is a Qt key code.
- QWindowSystemInterface::handleExtendedKeyEvent(window->window(),
- time, type,
- qtkey,
- Qt::NoModifier,
- code, 0, 0);
+ if (window) {
+ QWindowSystemInterface::handleExtendedKeyEvent(window->window(),
+ time, type,
+ qtkey,
+ Qt::NoModifier,
+ code, 0, 0);
+ }
#endif
- if (state == WL_KEYBOARD_KEY_STATE_PRESSED
-#ifndef QT_NO_WAYLAND_XKB
- && xkb_keymap_key_repeats(mXkbMap, code)
-#endif
- ) {
+ if (state == WL_KEYBOARD_KEY_STATE_PRESSED) {
mRepeatKey = qtkey;
mRepeatCode = code;
mRepeatTime = time;
mRepeatText = text;
-#ifndef QT_NO_WAYLAND_XKB
- mRepeatSym = sym;
-#endif
mParent->mRepeatTimer.setInterval(400);
mParent->mRepeatTimer.start();
} else if (mRepeatCode == code) {
@@ -817,28 +799,10 @@
void QWaylandInputDevice::repeatKey()
{
mRepeatTimer.setInterval(25);
-
- QWindowSystemInterface::handleExtendedKeyEvent(mKeyboard->mFocus->window(),
- mKeyboard->mRepeatTime, QEvent::KeyRelease, mKeyboard->mRepeatKey,
- modifiers(),
- mKeyboard->mRepeatCode,
-#ifndef QT_NO_WAYLAND_XKB
- mKeyboard->mRepeatSym, mKeyboard->mNativeModifiers,
-#else
- 0, 0,
-#endif
- mKeyboard->mRepeatText, true);
-
QWindowSystemInterface::handleExtendedKeyEvent(mKeyboard->mFocus->window(),
mKeyboard->mRepeatTime, QEvent::KeyPress, mKeyboard->mRepeatKey,
modifiers(),
- mKeyboard->mRepeatCode,
-#ifndef QT_NO_WAYLAND_XKB
- mKeyboard->mRepeatSym, mKeyboard->mNativeModifiers,
-#else
- 0, 0,
-#endif
- mKeyboard->mRepeatText, true);
+ mKeyboard->mRepeatCode, 0, 0, mKeyboard->mRepeatText);
}
void QWaylandInputDevice::Keyboard::keyboard_modifiers(uint32_t serial,
@@ -853,7 +817,6 @@
xkb_state_update_mask(mXkbState,
mods_depressed, mods_latched, mods_locked,
0, 0, group);
- mNativeModifiers = mods_depressed | mods_latched | mods_locked;
#else
Q_UNUSED(serial);
Q_UNUSED(mods_depressed);
@@ -870,8 +833,8 @@
wl_fixed_t x,
wl_fixed_t y)
{
- mParent->mTime = time;
- mParent->mSerial = serial;
+ Q_UNUSED(serial);
+ Q_UNUSED(time);
mFocus = QWaylandWindow::fromWlSurface(surface);
mParent->handleTouchPoint(id, wl_fixed_to_double(x), wl_fixed_to_double(y), Qt::TouchPointPressed);
}
@@ -882,13 +845,6 @@
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylandinputdevice_p.h
^
|
@@ -61,8 +61,6 @@
struct xkb_state;
#endif
-struct wl_cursor_image;
-
QT_BEGIN_NAMESPACE
class QWaylandWindow;
@@ -83,7 +81,7 @@
struct ::wl_seat *wl_seat() { return QtWayland::wl_seat::object(); }
void setCursor(Qt::CursorShape cursor, QWaylandScreen *screen);
- void setCursor(struct wl_buffer *buffer, struct ::wl_cursor_image *image);
+ void setCursor(struct wl_buffer *buffer, struct wl_cursor_image *image);
void handleWindowDestroyed(QWaylandWindow *window);
void setDataDevice(QWaylandDataDevice *device);
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylandintegration.cpp
^
|
@@ -49,7 +49,6 @@
#include "qwaylandclipboard_p.h"
#include "qwaylanddnd_p.h"
#include "qwaylandwindowmanagerintegration_p.h"
-#include "qwaylandscreen_p.h"
#include "QtPlatformSupport/private/qgenericunixfontdatabase_p.h"
#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
@@ -73,9 +72,6 @@
#include "qwaylandserverbufferintegration_p.h"
#include "qwaylandserverbufferintegrationfactory_p.h"
-#include "qwaylandshellintegration_p.h"
-#include "qwaylandshellintegrationfactory_p.h"
-
QT_BEGIN_NAMESPACE
class GenericWaylandTheme: public QGenericUnixTheme
@@ -112,7 +108,6 @@
QWaylandIntegration::QWaylandIntegration()
: mClientBufferIntegration(0)
- , mShellIntegration(Q_NULLPTR)
, mFontDb(new QGenericUnixFontDatabase())
, mNativeInterface(new QWaylandNativeInterface(this))
#ifndef QT_NO_ACCESSIBILITY
@@ -122,12 +117,14 @@
#endif
, mClientBufferIntegrationInitialized(false)
, mServerBufferIntegrationInitialized(false)
- , mShellIntegrationInitialized(false)
{
mDisplay = new QWaylandDisplay(this);
mClipboard = new QWaylandClipboard(mDisplay);
mDrag = new QWaylandDrag(mDisplay);
+ foreach (QPlatformScreen *screen, mDisplay->screens())
+ screenAdded(screen);
+
//mInputContext.reset(new QWaylandInputContext(mDisplay));
mInputContext.reset(QPlatformInputContextFactory::create());
}
@@ -193,7 +190,6 @@
{
QAbstractEventDispatcher *dispatcher = QGuiApplicationPrivate::eventDispatcher;
QObject::connect(dispatcher, SIGNAL(aboutToBlock()), mDisplay, SLOT(flushRequests()));
- QObject::connect(dispatcher, SIGNAL(awake()), mDisplay, SLOT(flushRequests()));
}
QPlatformFontDatabase *QWaylandIntegration::fontDatabase() const
@@ -265,14 +261,6 @@
return mServerBufferIntegration;
}
-QWaylandShellIntegration *QWaylandIntegration::shellIntegration() const
-{
- if (!mShellIntegrationInitialized)
- const_cast<QWaylandIntegration *>(this)->initializeShellIntegration();
-
- return mShellIntegration;
-}
-
void QWaylandIntegration::initializeClientBufferIntegration()
{
mClientBufferIntegrationInitialized = true;
@@ -290,7 +278,7 @@
}
if (targetKey.isEmpty()) {
- qWarning("Failed to determine what client buffer integration to use");
+ qWarning("Failed to determin what client buffer integration to use");
return;
}
@@ -334,28 +322,4 @@
qWarning("Failed to load server buffer integration %s\n", qPrintable(targetKey));
}
-void QWaylandIntegration::initializeShellIntegration()
-{
- mShellIntegrationInitialized = true;
-
- QByteArray integrationName = qgetenv("QT_WAYLAND_SHELL_INTEGRATION");
- QString targetKey = QString::fromLocal8Bit(integrationName);
-
- if (targetKey.isEmpty()) {
- return;
- }
-
- QStringList keys = QWaylandShellIntegrationFactory::keys();
- if (keys.contains(targetKey)) {
- mShellIntegration = QWaylandShellIntegrationFactory::create(targetKey, QStringList());
- }
- if (mShellIntegration && mShellIntegration->initialize(mDisplay)) {
- qDebug("Using the '%s' shell integration", qPrintable(targetKey));
- } else {
- delete mShellIntegration;
- mShellIntegration = Q_NULLPTR;
- qWarning("Failed to load shell integration %s", qPrintable(targetKey));
- }
-}
-
QT_END_NAMESPACE
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylandintegration_p.h
^
|
@@ -51,7 +51,6 @@
class QWaylandDisplay;
class QWaylandClientBufferIntegration;
class QWaylandServerBufferIntegration;
-class QWaylandShellIntegration;
class Q_WAYLAND_CLIENT_EXPORT QWaylandIntegration : public QPlatformIntegration
{
@@ -91,15 +90,12 @@
virtual QWaylandClientBufferIntegration *clientBufferIntegration() const;
virtual QWaylandServerBufferIntegration *serverBufferIntegration() const;
- virtual QWaylandShellIntegration *shellIntegration() const;
protected:
QWaylandClientBufferIntegration *mClientBufferIntegration;
QWaylandServerBufferIntegration *mServerBufferIntegration;
- QWaylandShellIntegration *mShellIntegration;
private:
void initializeClientBufferIntegration();
void initializeServerBufferIntegration();
- void initializeShellIntegration();
QPlatformFontDatabase *mFontDb;
QPlatformClipboard *mClipboard;
QPlatformDrag *mDrag;
@@ -109,9 +105,6 @@
QPlatformAccessibility *mAccessibility;
bool mClientBufferIntegrationInitialized;
bool mServerBufferIntegrationInitialized;
- bool mShellIntegrationInitialized;
-
- friend class QWaylandDisplay;
};
QT_END_NAMESPACE
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylandnativeinterface.cpp
^
|
@@ -99,25 +99,34 @@
QVariantMap QWaylandNativeInterface::windowProperties(QPlatformWindow *window) const
{
QWaylandWindow *waylandWindow = static_cast<QWaylandWindow *>(window);
- return waylandWindow->properties();
+ if (QWaylandExtendedSurface *extendedWindow = waylandWindow->extendedWindow())
+ return extendedWindow->properties();
+ return QVariantMap();
}
+
QVariant QWaylandNativeInterface::windowProperty(QPlatformWindow *window, const QString &name) const
{
QWaylandWindow *waylandWindow = static_cast<QWaylandWindow *>(window);
- return waylandWindow->property(name);
+ if (QWaylandExtendedSurface *extendedWindow = waylandWindow->extendedWindow())
+ return extendedWindow->property(name);
+ return QVariant();
}
QVariant QWaylandNativeInterface::windowProperty(QPlatformWindow *window, const QString &name, const QVariant &defaultValue) const
{
QWaylandWindow *waylandWindow = static_cast<QWaylandWindow *>(window);
- return waylandWindow->property(name, defaultValue);
+ if (QWaylandExtendedSurface *extendedWindow = waylandWindow->extendedWindow()) {
+ return extendedWindow->property(name,defaultValue);
+ }
+ return defaultValue;
}
void QWaylandNativeInterface::setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value)
{
QWaylandWindow *wlWindow = static_cast<QWaylandWindow*>(window);
- wlWindow->sendProperty(name, value);
+ if (QWaylandExtendedSurface *extendedWindow = wlWindow->extendedWindow())
+ extendedWindow->updateGenericProperty(name,value);
}
void QWaylandNativeInterface::emitWindowPropertyChanged(QPlatformWindow *window, const QString &name)
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylandnativeinterface_p.h
^
|
@@ -68,6 +68,8 @@
void setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value);
void emitWindowPropertyChanged(QPlatformWindow *window, const QString &name);
+private:
+ static QWaylandScreen *qPlatformScreenForWindow(QWindow *window);
private:
QWaylandIntegration *m_integration;
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylandqtkey.cpp
^
|
@@ -46,7 +46,7 @@
QT_BEGIN_NAMESPACE
QWaylandQtKeyExtension::QWaylandQtKeyExtension(QWaylandDisplay *display, uint32_t id)
- : QtWayland::qt_key_extension(display->wl_registry(), id, 2)
+ : QtWayland::qt_key_extension(display->wl_registry(), id)
, m_display(display)
{
}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylandscreen.cpp
^
|
@@ -44,27 +44,19 @@
#include "qwaylanddisplay_p.h"
#include "qwaylandcursor_p.h"
#include "qwaylandextendedoutput_p.h"
-#include "qwaylandwindow_p.h"
-
-#include <QtGui/QGuiApplication>
#include <qpa/qwindowsysteminterface.h>
-#include <qpa/qplatformwindow.h>
QT_BEGIN_NAMESPACE
QWaylandScreen::QWaylandScreen(QWaylandDisplay *waylandDisplay, uint32_t id)
- : QPlatformScreen()
- , QtWayland::wl_output(waylandDisplay->wl_registry(), id, 2)
- , m_outputId(id)
+ : QtWayland::wl_output(waylandDisplay->wl_registry(), id)
, mWaylandDisplay(waylandDisplay)
, mExtendedOutput(0)
, mDepth(32)
, mRefreshRate(60000)
- , mTransform(-1)
, mFormat(QImage::Format_ARGB32_Premultiplied)
, mOutputName(QStringLiteral("Screen%1").arg(id))
- , m_orientation(Qt::PrimaryOrientation)
, mWaylandCursor(new QWaylandCursor(this))
{
// handle case of output extension global being sent after outputs
@@ -96,14 +88,6 @@
return mFormat;
}
-QSizeF QWaylandScreen::physicalSize() const
-{
- if (mPhysicalSize.isEmpty())
- return QPlatformScreen::physicalSize();
- else
- return mPhysicalSize;
-}
-
QDpi QWaylandScreen::logicalDpi() const
{
static int force_dpi = !qgetenv("QT_WAYLAND_FORCE_DPI").isEmpty() ? qgetenv("QT_WAYLAND_FORCE_DPI").toInt() : -1;
@@ -115,16 +99,15 @@
void QWaylandScreen::setOrientationUpdateMask(Qt::ScreenOrientations mask)
{
- foreach (QWindow *window, QGuiApplication::allWindows()) {
- QWaylandWindow *w = static_cast<QWaylandWindow *>(window->handle());
- if (w && w->screen() == this)
- w->setOrientationMask(mask);
- }
+ if (mExtendedOutput)
+ mExtendedOutput->setOrientationUpdateMask(mask);
}
Qt::ScreenOrientation QWaylandScreen::orientation() const
{
- return m_orientation;
+ if (mExtendedOutput)
+ return mExtendedOutput->currentOrientation();
+ return QPlatformScreen::orientation();
}
qreal QWaylandScreen::refreshRate() const
@@ -162,11 +145,16 @@
QSize size(width, height);
- if (size != mGeometry.size())
+ if (size != mGeometry.size()) {
mGeometry.setSize(size);
+ QWindowSystemInterface::handleScreenGeometryChange(screen(), mGeometry);
+ QWindowSystemInterface::handleScreenAvailableGeometryChange(screen(), mGeometry);
+ }
- if (refresh != mRefreshRate)
+ if (refresh != mRefreshRate) {
mRefreshRate = refresh;
+ QWindowSystemInterface::handleScreenRefreshRateChange(screen(), refreshRate());
+ }
}
void QWaylandScreen::output_geometry(int32_t x, int32_t y,
@@ -178,51 +166,19 @@
{
Q_UNUSED(subpixel);
Q_UNUSED(make);
-
- mTransform = transform;
+ Q_UNUSED(transform);
if (!model.isEmpty())
mOutputName = model;
- mPhysicalSize = QSize(width, height);
- mGeometry.moveTopLeft(QPoint(x, y));
-}
+ QRect geom(x, y, width, height);
-void QWaylandScreen::output_done()
-{
- // the done event is sent after all the geometry and the mode events are sent,
- // and the last mode event to be sent is the active one, so we can trust the
- // values of mGeometry and mRefreshRate here
-
- if (mTransform >= 0) {
- bool isPortrait = mGeometry.height() > mGeometry.width();
- switch (mTransform) {
- case WL_OUTPUT_TRANSFORM_NORMAL:
- m_orientation = isPortrait ? Qt::PortraitOrientation : Qt::LandscapeOrientation;
- break;
- case WL_OUTPUT_TRANSFORM_90:
- m_orientation = isPortrait ? Qt::InvertedLandscapeOrientation : Qt::PortraitOrientation;
- break;
- case WL_OUTPUT_TRANSFORM_180:
- m_orientation = isPortrait ? Qt::InvertedPortraitOrientation : Qt::InvertedLandscapeOrientation;
- break;
- case WL_OUTPUT_TRANSFORM_270:
- m_orientation = isPortrait ? Qt::LandscapeOrientation : Qt::InvertedPortraitOrientation;
- break;
- // Ignore these ones, at least for now
- case WL_OUTPUT_TRANSFORM_FLIPPED:
- case WL_OUTPUT_TRANSFORM_FLIPPED_90:
- case WL_OUTPUT_TRANSFORM_FLIPPED_180:
- case WL_OUTPUT_TRANSFORM_FLIPPED_270:
- break;
- }
+ if (mGeometry == geom)
+ return;
- QWindowSystemInterface::handleScreenOrientationChange(screen(), m_orientation);
- mTransform = -1;
- }
+ mGeometry = geom;
QWindowSystemInterface::handleScreenGeometryChange(screen(), mGeometry);
QWindowSystemInterface::handleScreenAvailableGeometryChange(screen(), mGeometry);
- QWindowSystemInterface::handleScreenRefreshRateChange(screen(), refreshRate());
}
QT_END_NAMESPACE
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylandscreen_p.h
^
|
@@ -65,8 +65,6 @@
int depth() const;
QImage::Format format() const;
- QSizeF physicalSize() const Q_DECL_OVERRIDE;
-
QDpi logicalDpi() const Q_DECL_OVERRIDE;
void setOrientationUpdateMask(Qt::ScreenOrientations mask);
@@ -79,7 +77,6 @@
QPlatformCursor *cursor() const;
QWaylandCursor *waylandCursor() const { return mWaylandCursor; };
- uint32_t outputId() const { return m_outputId; }
::wl_output *output() { return object(); }
QWaylandExtendedOutput *extendedOutput() const;
@@ -95,19 +92,15 @@
const QString &make,
const QString &model,
int32_t transform) Q_DECL_OVERRIDE;
- void output_done() Q_DECL_OVERRIDE;
- int m_outputId;
QWaylandDisplay *mWaylandDisplay;
QWaylandExtendedOutput *mExtendedOutput;
QRect mGeometry;
int mDepth;
int mRefreshRate;
- int mTransform;
QImage::Format mFormat;
QSize mPhysicalSize;
QString mOutputName;
- Qt::ScreenOrientation m_orientation;
QWaylandCursor *mWaylandCursor;
};
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylandshellsurface.cpp
^
|
@@ -40,21 +40,137 @@
****************************************************************************/
#include "qwaylandshellsurface_p.h"
+
+#include "qwaylanddisplay_p.h"
#include "qwaylandwindow_p.h"
-#include "qwaylandextendedsurface_p.h"
+#include "qwaylandinputdevice_p.h"
+#include "qwaylanddecoration_p.h"
+#include "qwaylandscreen_p.h"
+
+#include <QtCore/QDebug>
+
+QT_BEGIN_NAMESPACE
+
+QWaylandShellSurface::QWaylandShellSurface(struct ::wl_shell_surface *shell_surface, QWaylandWindow *window)
+ : QtWayland::wl_shell_surface(shell_surface)
+ , m_window(window)
+ , m_maximized(false)
+ , m_fullscreen(false)
+{
+}
+
+QWaylandShellSurface::~QWaylandShellSurface()
+{
+ wl_shell_surface_destroy(object());
+}
+
+void QWaylandShellSurface::resize(QWaylandInputDevice *inputDevice, enum wl_shell_surface_resize edges)
+{
+ resize(inputDevice->wl_seat(),
+ inputDevice->serial(),
+ edges);
+}
+
+void QWaylandShellSurface::move(QWaylandInputDevice *inputDevice)
+{
+ move(inputDevice->wl_seat(),
+ inputDevice->serial());
+}
+
+void QWaylandShellSurface::setMaximized()
+{
+ m_maximized = true;
+ m_size = m_window->window()->geometry().size();
+ set_maximized(0);
+}
+
+void QWaylandShellSurface::setFullscreen()
+{
+ m_fullscreen = true;
+ m_size = m_window->window()->geometry().size();
+ set_fullscreen(WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, 0, 0);
+}
-QWaylandShellSurface::QWaylandShellSurface(QWaylandWindow *window)
- : m_window(window)
+void QWaylandShellSurface::setNormal()
{
+ if (m_fullscreen || m_maximized) {
+ m_fullscreen = m_maximized = false;
+ setTopLevel();
+ QMargins m = m_window->frameMargins();
+ m_window->configure(0, m_size.width() + m.left() + m.right(), m_size.height() + m.top() + m.bottom());
+ }
}
-void QWaylandShellSurface::setWindowFlags(Qt::WindowFlags flags)
+void QWaylandShellSurface::setMinimized()
{
- Q_UNUSED(flags);
+ // TODO: There's no wl_shell_surface API for this
}
-void QWaylandShellSurface::sendProperty(const QString &name, const QVariant &value)
+void QWaylandShellSurface::setTopLevel()
{
- Q_UNUSED(name)
- Q_UNUSED(value)
+ set_toplevel();
}
+
+void QWaylandShellSurface::updateTransientParent(QWindow *parent)
+{
+ QWaylandWindow *parent_wayland_window = static_cast<QWaylandWindow *>(parent->handle());
+ if (!parent_wayland_window)
+ return;
+
+ // set_transient expects a position relative to the parent
+ QPoint transientPos = m_window->geometry().topLeft(); // this is absolute
+ QWindow *parentWin = m_window->window()->transientParent();
+ transientPos -= parentWin->geometry().topLeft();
+ if (parent_wayland_window->decoration()) {
+ transientPos.setX(transientPos.x() + parent_wayland_window->decoration()->margins().left());
+ transientPos.setY(transientPos.y() + parent_wayland_window->decoration()->margins().top());
+ }
+
+ uint32_t flags = 0;
+ Qt::WindowFlags wf = m_window->window()->flags();
+ if (wf.testFlag(Qt::ToolTip)
+ || wf.testFlag(Qt::WindowTransparentForInput))
+ flags |= WL_SHELL_SURFACE_TRANSIENT_INACTIVE;
+
+ set_transient(parent_wayland_window->object(),
+ transientPos.x(),
+ transientPos.y(),
+ flags);
+}
+
+void QWaylandShellSurface::setPopup(QWaylandWindow *parent, QWaylandInputDevice *device, int serial)
+{
+ QWaylandWindow *parent_wayland_window = parent;
+ if (!parent_wayland_window)
+ return;
+
+ // set_popup expects a position relative to the parent
+ QPoint transientPos = m_window->geometry().topLeft(); // this is absolute
+ transientPos -= parent_wayland_window->geometry().topLeft();
+ if (parent_wayland_window->decoration()) {
+ transientPos.setX(transientPos.x() + parent_wayland_window->decoration()->margins().left());
+ transientPos.setY(transientPos.y() + parent_wayland_window->decoration()->margins().top());
+ }
+
+ set_popup(device->wl_seat(), serial, parent_wayland_window->object(),
+ transientPos.x(), transientPos.y(), 0);
+}
+
+void QWaylandShellSurface::shell_surface_ping(uint32_t serial)
+{
+ pong(serial);
+}
+
+void QWaylandShellSurface::shell_surface_configure(uint32_t edges,
+ int32_t width,
+ int32_t height)
+{
+ m_window->configure(edges, width, height);
+}
+
+void QWaylandShellSurface::shell_surface_popup_done()
+{
+ QCoreApplication::postEvent(m_window->window(), new QCloseEvent());
+}
+
+QT_END_NAMESPACE
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylandshellsurface_p.h
^
|
@@ -51,46 +51,43 @@
QT_BEGIN_NAMESPACE
-class QVariant;
class QWaylandWindow;
class QWaylandInputDevice;
class QWindow;
-class Q_WAYLAND_CLIENT_EXPORT QWaylandShellSurface
+class Q_WAYLAND_CLIENT_EXPORT QWaylandShellSurface : public QtWayland::wl_shell_surface
{
public:
- explicit QWaylandShellSurface(QWaylandWindow *window);
- virtual ~QWaylandShellSurface() {}
- virtual void resize(QWaylandInputDevice * /*inputDevice*/, enum wl_shell_surface_resize /*edges*/)
- {}
+ QWaylandShellSurface(struct ::wl_shell_surface *shell_surface, QWaylandWindow *window);
+ ~QWaylandShellSurface();
- virtual void move(QWaylandInputDevice * /*inputDevice*/) {}
- virtual void setTitle(const QString & /*title*/) {}
- virtual void setAppId(const QString & /*appId*/) {}
+ using QtWayland::wl_shell_surface::resize;
+ void resize(QWaylandInputDevice *inputDevice, enum wl_shell_surface_resize edges);
- virtual void setWindowFlags(Qt::WindowFlags flags);
-
- virtual bool isExposed() const { return true; }
-
- virtual void raise() {}
- virtual void lower() {}
- virtual void setContentOrientationMask(Qt::ScreenOrientations orientation) { Q_UNUSED(orientation) }
-
- virtual void sendProperty(const QString &name, const QVariant &value);
-
- inline QWaylandWindow *window() { return m_window; }
-
-protected:
- virtual void setMaximized() {}
- virtual void setFullscreen() {}
- virtual void setNormal() {}
- virtual void setMinimized() {}
-
- virtual void setTopLevel() {}
- virtual void updateTransientParent(QWindow * /*parent*/) {}
+ using QtWayland::wl_shell_surface::move;
+ void move(QWaylandInputDevice *inputDevice);
private:
+ void setMaximized();
+ void setFullscreen();
+ void setNormal();
+ void setMinimized();
+
+ void setTopLevel();
+ void updateTransientParent(QWindow *parent);
+ void setPopup(QWaylandWindow *parent, QWaylandInputDevice *device, int serial);
+
QWaylandWindow *m_window;
+ bool m_maximized;
+ bool m_fullscreen;
+ QSize m_size;
+
+ void shell_surface_ping(uint32_t serial) Q_DECL_OVERRIDE;
+ void shell_surface_configure(uint32_t edges,
+ int32_t width,
+ int32_t height) Q_DECL_OVERRIDE;
+ void shell_surface_popup_done() Q_DECL_OVERRIDE;
+
friend class QWaylandWindow;
};
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylandshmbackingstore.cpp
^
|
@@ -45,7 +45,7 @@
#include "qwaylanddisplay_p.h"
#include "qwaylandshmwindow_p.h"
#include "qwaylandscreen_p.h"
-#include "qwaylandabstractdecoration_p.h"
+#include "qwaylanddecoration_p.h"
#include <QtGui/QPainter>
@@ -142,9 +142,6 @@
QWaylandShmBackingStore::~QWaylandShmBackingStore()
{
- if (QWaylandWindow *w = waylandWindow())
- w->setBackingStore(Q_NULLPTR);
-
if (mFrameCallback)
wl_callback_destroy(mFrameCallback);
@@ -184,14 +181,6 @@
waylandWindow()->setCanResize(true);
}
-void QWaylandShmBackingStore::hidden()
-{
- if (mFrameCallback) {
- wl_callback_destroy(mFrameCallback);
- mFrameCallback = Q_NULLPTR;
- }
-}
-
void QWaylandShmBackingStore::ensureSize()
{
waylandWindow()->setBackingStore(this);
@@ -301,7 +290,7 @@
decorationPainter.drawImage(target, sourceImage, target);
}
-QWaylandAbstractDecoration *QWaylandShmBackingStore::windowDecoration() const
+QWaylandDecoration *QWaylandShmBackingStore::windowDecoration() const
{
return waylandWindow()->decoration();
}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylandshmbackingstore_p.h
^
|
@@ -51,7 +51,7 @@
QT_BEGIN_NAMESPACE
class QWaylandDisplay;
-class QWaylandAbstractDecoration;
+class QWaylandDecoration;
class QWaylandShmWindow;
class Q_WAYLAND_CLIENT_EXPORT QWaylandShmBuffer : public QWaylandBuffer {
@@ -82,9 +82,8 @@
void resize(const QSize &size);
void beginPaint(const QRegion &);
void endPaint();
- void hidden();
- QWaylandAbstractDecoration *windowDecoration() const;
+ QWaylandDecoration *windowDecoration() const;
QMargins windowDecorationMargins() const;
QImage *entireSurface() const;
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylandtouch.cpp
^
|
@@ -46,7 +46,7 @@
QT_BEGIN_NAMESPACE
QWaylandTouchExtension::QWaylandTouchExtension(QWaylandDisplay *display, uint32_t id)
- : QtWayland::qt_touch_extension(display->wl_registry(), id, 1),
+ : QtWayland::qt_touch_extension(display->wl_registry(), id),
mDisplay(display),
mTouchDevice(0),
mPointsLeft(0),
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylandwindow.cpp
^
|
@@ -42,19 +42,14 @@
#include "qwaylandwindow_p.h"
#include "qwaylandbuffer_p.h"
-#include "qwaylanddatadevice_p.h"
#include "qwaylanddisplay_p.h"
#include "qwaylandinputdevice_p.h"
#include "qwaylandscreen_p.h"
#include "qwaylandshellsurface_p.h"
-#include "qwaylandwlshellsurface_p.h"
-#include "qwaylandxdgsurface_p.h"
+#include "qwaylandextendedsurface_p.h"
#include "qwaylandsubsurface_p.h"
-#include "qwaylandabstractdecoration_p.h"
+#include "qwaylanddecoration_p.h"
#include "qwaylandwindowmanagerintegration_p.h"
-#include "qwaylandnativeinterface_p.h"
-#include "qwaylanddecorationfactory_p.h"
-#include "qwaylandshmbackingstore_p.h"
#include <QtCore/QFileInfo>
#include <QtCore/QPointer>
@@ -75,6 +70,7 @@
, mScreen(QWaylandScreen::waylandScreenFromWindow(window))
, mDisplay(mScreen->display())
, mShellSurface(0)
+ , mExtendedWindow(0)
, mSubSurfaceWindow(0)
, mWindowDecoration(0)
, mMouseEventsInContentArea(false)
@@ -91,28 +87,27 @@
, mMouseDevice(0)
, mMouseSerial(0)
, mState(Qt::WindowNoState)
- , mBackingStore(Q_NULLPTR)
{
init(mDisplay->createSurface(static_cast<QtWayland::wl_surface *>(this)));
static WId id = 1;
mWindowId = id++;
+ if (mDisplay->shell() && window->type() & Qt::Window && !(window->flags() & Qt::BypassWindowManagerHint))
+ mShellSurface = new QWaylandShellSurface(mDisplay->shell()->get_shell_surface(object()), this);
+ if (mDisplay->windowExtension())
+ mExtendedWindow = new QWaylandExtendedSurface(this, mDisplay->windowExtension()->get_extended_surface(object()));
if (mDisplay->subSurfaceExtension())
mSubSurfaceWindow = new QWaylandSubSurface(this, mDisplay->subSurfaceExtension()->get_sub_surface_aware_surface(object()));
- if (!(window->flags() & Qt::BypassWindowManagerHint)) {
- mShellSurface = mDisplay->createShellSurface(this);
- }
-
if (mShellSurface) {
// Set initial surface title
- mShellSurface->setTitle(window->title());
+ mShellSurface->set_title(window->title());
// Set surface class to the .desktop file name (obtained from executable name)
QFileInfo exeFileInfo(qApp->applicationFilePath());
QString className = exeFileInfo.baseName() + QLatin1String(".desktop");
- mShellSurface->setAppId(className);
+ mShellSurface->set_class(className);
}
if (QPlatformWindow::parent() && mSubSurfaceWindow) {
@@ -125,7 +120,6 @@
mShellSurface->setTopLevel();
}
- setOrientationMask(window->screen()->orientationUpdateMask());
setWindowFlags(window->flags());
setGeometry_helper(window->geometry());
setWindowStateInternal(window->windowState());
@@ -134,10 +128,9 @@
QWaylandWindow::~QWaylandWindow()
{
- delete mWindowDecoration;
-
if (isInitialized()) {
delete mShellSurface;
+ delete mExtendedWindow;
destroy();
}
if (mFrameCallback)
@@ -179,7 +172,7 @@
void QWaylandWindow::setWindowTitle(const QString &title)
{
if (mShellSurface) {
- mShellSurface->setTitle(title);
+ mShellSurface->set_title(title);
}
if (mWindowDecoration && window()->isVisible())
@@ -217,10 +210,10 @@
else
QWindowSystemInterface::handleGeometryChange(window(), geometry());
+ QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
+
mSentInitialResize = true;
}
-
- QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
}
void QWaylandWindow::setVisible(bool visible)
@@ -231,10 +224,8 @@
mMouseDevice = parent->mMouseDevice;
mMouseSerial = parent->mMouseSerial;
- QWaylandWlShellSurface *wlshellSurface = dynamic_cast<QWaylandWlShellSurface*>(mShellSurface);
- if (mMouseDevice && wlshellSurface) {
- wlshellSurface->setPopup(transientParent(), mMouseDevice, mMouseSerial);
- }
+ if (mMouseDevice)
+ mShellSurface->setPopup(transientParent(), mMouseDevice, mMouseSerial);
}
setGeometry(window()->geometry());
@@ -243,8 +234,6 @@
// QWaylandShmBackingStore::beginPaint().
} else {
QWindowSystemInterface::handleExposeEvent(window(), QRegion());
- if (window()->type() == Qt::CoverWindow)
- return;
// when flushing the event queue, it could contain a close event, in which
// case 'this' will be deleted. When that happens, we must abort right away.
QPointer<QWaylandWindow> deleteGuard(this);
@@ -252,9 +241,6 @@
if (!deleteGuard.isNull()) {
attach(static_cast<QWaylandBuffer *>(0), 0, 0);
commit();
- if (mBackingStore) {
- mBackingStore->hidden();
- }
}
}
}
@@ -262,15 +248,15 @@
void QWaylandWindow::raise()
{
- if (mShellSurface)
- mShellSurface->raise();
+ if (mExtendedWindow)
+ mExtendedWindow->raise();
}
void QWaylandWindow::lower()
{
- if (mShellSurface)
- mShellSurface->lower();
+ if (mExtendedWindow)
+ mExtendedWindow->lower();
}
void QWaylandWindow::configure(uint32_t edges, int32_t width, int32_t height)
@@ -326,9 +312,9 @@
}
if (!mConfigure.isEmpty()) {
doResize();
- QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
+ QWindowSystemInterface::handleExposeEvent(window(), geometry());
} else if (mResizeDirty) {
- QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
+ QWindowSystemInterface::handleExposeEvent(window(), geometry());
mResizeDirty = false;
}
}
@@ -344,7 +330,7 @@
mRequestResizeSent = false;
lock.unlock();
- QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
+ QWindowSystemInterface::handleExposeEvent(window(), geometry());
QWindowSystemInterface::flushWindowSystemEvents();
}
@@ -424,43 +410,20 @@
return mShellSurface;
}
-QWaylandSubSurface *QWaylandWindow::subSurfaceWindow() const
+QWaylandExtendedSurface *QWaylandWindow::extendedWindow() const
{
- return mSubSurfaceWindow;
+ return mExtendedWindow;
}
-void QWaylandWindow::handleContentOrientationChange(Qt::ScreenOrientation orientation)
+QWaylandSubSurface *QWaylandWindow::subSurfaceWindow() const
{
- wl_output_transform transform;
- bool isPortrait = window()->screen() && window()->screen()->primaryOrientation() == Qt::PortraitOrientation;
- switch (orientation) {
- case Qt::PrimaryOrientation:
- transform = WL_OUTPUT_TRANSFORM_NORMAL;
- break;
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylandwindow_p.h
^
|
@@ -45,7 +45,6 @@
#include <QtCore/QWaitCondition>
#include <QtCore/QMutex>
#include <QtGui/QIcon>
-#include <QtCore/QVariant>
#include <qpa/qplatformwindow.h>
@@ -59,11 +58,11 @@
class QWaylandDisplay;
class QWaylandBuffer;
class QWaylandShellSurface;
+class QWaylandExtendedSurface;
class QWaylandSubSurface;
-class QWaylandAbstractDecoration;
+class QWaylandDecoration;
class QWaylandInputDevice;
class QWaylandScreen;
-class QWaylandShmBackingStore;
class Q_WAYLAND_CLIENT_EXPORT QWaylandWindowConfigure
{
@@ -126,13 +125,11 @@
static QWaylandWindow *fromWlSurface(::wl_surface *surface);
- QWaylandDisplay *display() const { return mDisplay; }
QWaylandShellSurface *shellSurface() const;
+ QWaylandExtendedSurface *extendedWindow() const;
QWaylandSubSurface *subSurfaceWindow() const;
- QWaylandScreen *screen() const { return mScreen; }
void handleContentOrientationChange(Qt::ScreenOrientation orientation);
- void setOrientationMask(Qt::ScreenOrientations mask);
void setWindowState(Qt::WindowState state);
void setWindowFlags(Qt::WindowFlags flags);
@@ -141,10 +138,10 @@
void lower() Q_DECL_OVERRIDE;
void requestActivateWindow() Q_DECL_OVERRIDE;
- bool isExposed() const Q_DECL_OVERRIDE;
- void unfocus();
- QWaylandAbstractDecoration *decoration() const;
+ QWaylandDecoration *decoration() const;
+ void setDecoration(QWaylandDecoration *decoration);
+
void handleMouse(QWaylandInputDevice *inputDevice,
ulong timestamp,
@@ -155,9 +152,6 @@
void handleMouseEnter(QWaylandInputDevice *inputDevice);
void handleMouseLeave(QWaylandInputDevice *inputDevice);
- bool touchDragDecoration(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global,
- Qt::TouchPointState state, Qt::KeyboardModifiers mods);
-
bool createDecoration();
inline bool isMaximized() const { return mState == Qt::WindowMaximized; }
@@ -175,19 +169,6 @@
bool setMouseGrabEnabled(bool grab);
static QWaylandWindow *mouseGrab() { return mMouseGrab; }
- void sendProperty(const QString &name, const QVariant &value);
- void setProperty(const QString &name, const QVariant &value);
-
- QVariantMap properties() const;
- QVariant property(const QString &name);
- QVariant property(const QString &name, const QVariant &defaultValue);
-
- void setBackingStore(QWaylandShmBackingStore *backingStore) { mBackingStore = backingStore; }
- QWaylandShmBackingStore *backingStore() const { return mBackingStore; }
-
- bool setKeyboardGrabEnabled(bool) Q_DECL_OVERRIDE { return false; }
- void propagateSizeHints() Q_DECL_OVERRIDE { }
-
public slots:
void requestResize();
@@ -195,9 +176,10 @@
QWaylandScreen *mScreen;
QWaylandDisplay *mDisplay;
QWaylandShellSurface *mShellSurface;
+ QWaylandExtendedSurface *mExtendedWindow;
QWaylandSubSurface *mSubSurfaceWindow;
- QWaylandAbstractDecoration *mWindowDecoration;
+ QWaylandDecoration *mWindowDecoration;
bool mMouseEventsInContentArea;
Qt::MouseButtons mMousePressedInContentArea;
Qt::CursorShape m_cursorShape;
@@ -214,7 +196,6 @@
bool mCanResize;
bool mResizeDirty;
bool mResizeAfterSwap;
- QVariantMap m_properties;
bool mSentInitialResize;
QPoint mOffset;
@@ -225,8 +206,6 @@
Qt::WindowState mState;
- QWaylandShmBackingStore *mBackingStore;
-
private:
bool setWindowStateInternal(Qt::WindowState flags);
void setGeometry_helper(const QRect &rect);
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/client/qwaylandwindowmanagerintegration.cpp
^
|
@@ -95,7 +95,7 @@
{
Q_UNUSED(version);
if (interface == QStringLiteral("qt_windowmanager"))
- static_cast<QWaylandWindowManagerIntegration *>(data)->init(registry, id, 1);
+ static_cast<QWaylandWindowManagerIntegration *>(data)->init(registry, id);
}
void QWaylandWindowManagerIntegration::windowmanager_hints(int32_t showIsFullScreen)
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/client/qwaylandwlshellsurface.cpp
^
|
@@ -1,222 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the config.tests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwaylandwlshellsurface_p.h"
-
-#include "qwaylanddisplay_p.h"
-#include "qwaylandwindow_p.h"
-#include "qwaylandinputdevice_p.h"
-#include "qwaylandabstractdecoration_p.h"
-#include "qwaylandscreen_p.h"
-#include "qwaylandextendedsurface_p.h"
-
-#include <QtCore/QDebug>
-
-QT_BEGIN_NAMESPACE
-
-QWaylandWlShellSurface::QWaylandWlShellSurface(struct ::wl_shell_surface *shell_surface, QWaylandWindow *window)
- : QtWayland::wl_shell_surface(shell_surface)
- , QWaylandShellSurface(window)
- , m_window(window)
- , m_maximized(false)
- , m_fullscreen(false)
- , m_extendedWindow(Q_NULLPTR)
-{
- if (window->display()->windowExtension())
- m_extendedWindow = new QWaylandExtendedSurface(window);
-}
-
-QWaylandWlShellSurface::~QWaylandWlShellSurface()
-{
- wl_shell_surface_destroy(object());
- delete m_extendedWindow;
-}
-
-void QWaylandWlShellSurface::resize(QWaylandInputDevice *inputDevice, enum wl_shell_surface_resize edges)
-{
- resize(inputDevice->wl_seat(),
- inputDevice->serial(),
- edges);
-}
-
-void QWaylandWlShellSurface::move(QWaylandInputDevice *inputDevice)
-{
- move(inputDevice->wl_seat(),
- inputDevice->serial());
-}
-
-void QWaylandWlShellSurface::setTitle(const QString & title)
-{
- return QtWayland::wl_shell_surface::set_title(title);
-}
-
-void QWaylandWlShellSurface::setAppId(const QString & appId)
-{
- return QtWayland::wl_shell_surface::set_class(appId);
-}
-
-void QWaylandWlShellSurface::raise()
-{
- if (m_extendedWindow)
- m_extendedWindow->raise();
-}
-
-void QWaylandWlShellSurface::lower()
-{
- if (m_extendedWindow)
- m_extendedWindow->lower();
-}
-
-void QWaylandWlShellSurface::setContentOrientationMask(Qt::ScreenOrientations orientation)
-{
- if (m_extendedWindow)
- m_extendedWindow->setContentOrientationMask(orientation);
-}
-
-void QWaylandWlShellSurface::setWindowFlags(Qt::WindowFlags flags)
-{
- if (m_extendedWindow)
- m_extendedWindow->setWindowFlags(flags);
-}
-
-void QWaylandWlShellSurface::sendProperty(const QString &name, const QVariant &value)
-{
- if (m_extendedWindow)
- m_extendedWindow->updateGenericProperty(name, value);
-}
-
-void QWaylandWlShellSurface::setMaximized()
-{
- m_maximized = true;
- m_size = m_window->window()->geometry().size();
- set_maximized(0);
-}
-
-void QWaylandWlShellSurface::setFullscreen()
-{
- m_fullscreen = true;
- m_size = m_window->window()->geometry().size();
- set_fullscreen(WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, 0, 0);
-}
-
-void QWaylandWlShellSurface::setNormal()
-{
- if (m_fullscreen || m_maximized) {
- m_fullscreen = m_maximized = false;
- setTopLevel();
- QMargins m = m_window->frameMargins();
- m_window->configure(0, m_size.width() + m.left() + m.right(), m_size.height() + m.top() + m.bottom());
- }
-}
-
-void QWaylandWlShellSurface::setMinimized()
-{
- // TODO: There's no wl_shell_surface API for this
-}
-
-void QWaylandWlShellSurface::setTopLevel()
-{
- set_toplevel();
-}
-
-void QWaylandWlShellSurface::updateTransientParent(QWindow *parent)
-{
- QWaylandWindow *parent_wayland_window = static_cast<QWaylandWindow *>(parent->handle());
- if (!parent_wayland_window)
- return;
-
- // set_transient expects a position relative to the parent
- QPoint transientPos = m_window->geometry().topLeft(); // this is absolute
- QWindow *parentWin = m_window->window()->transientParent();
- transientPos -= parentWin->geometry().topLeft();
- if (parent_wayland_window->decoration()) {
- transientPos.setX(transientPos.x() + parent_wayland_window->decoration()->margins().left());
- transientPos.setY(transientPos.y() + parent_wayland_window->decoration()->margins().top());
- }
-
- uint32_t flags = 0;
- Qt::WindowFlags wf = m_window->window()->flags();
- if (wf.testFlag(Qt::ToolTip)
- || wf.testFlag(Qt::WindowTransparentForInput))
- flags |= WL_SHELL_SURFACE_TRANSIENT_INACTIVE;
-
- set_transient(parent_wayland_window->object(),
- transientPos.x(),
- transientPos.y(),
- flags);
-}
-
-void QWaylandWlShellSurface::setPopup(QWaylandWindow *parent, QWaylandInputDevice *device, int serial)
-{
- QWaylandWindow *parent_wayland_window = parent;
- if (!parent_wayland_window)
- return;
-
- // set_popup expects a position relative to the parent
- QPoint transientPos = m_window->geometry().topLeft(); // this is absolute
- transientPos -= parent_wayland_window->geometry().topLeft();
- if (parent_wayland_window->decoration()) {
- transientPos.setX(transientPos.x() + parent_wayland_window->decoration()->margins().left());
- transientPos.setY(transientPos.y() + parent_wayland_window->decoration()->margins().top());
- }
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/client/qwaylandwlshellsurface_p.h
^
|
@@ -1,109 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the config.tests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDWLSHELLSURFACE_H
-#define QWAYLANDWLSHELLSURFACE_H
-
-#include <QtCore/QSize>
-
-#include <wayland-client.h>
-
-#include <QtWaylandClient/private/qwayland-wayland.h>
-#include <QtWaylandClient/private/qwaylandclientexport_p.h>
-#include "qwaylandshellsurface_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QWaylandWindow;
-class QWaylandInputDevice;
-class QWindow;
-class QWaylandExtendedSurface;
-
-class Q_WAYLAND_CLIENT_EXPORT QWaylandWlShellSurface : public QtWayland::wl_shell_surface
- , public QWaylandShellSurface
-{
-public:
- QWaylandWlShellSurface(struct ::wl_shell_surface *shell_surface, QWaylandWindow *window);
- virtual ~QWaylandWlShellSurface();
-
- using QtWayland::wl_shell_surface::resize;
- void resize(QWaylandInputDevice *inputDevice, enum wl_shell_surface_resize edges) Q_DECL_OVERRIDE;
-
- using QtWayland::wl_shell_surface::move;
- void move(QWaylandInputDevice *inputDevice) Q_DECL_OVERRIDE;
-
- void setTitle(const QString & title) Q_DECL_OVERRIDE;
- void setAppId(const QString &appId) Q_DECL_OVERRIDE;
-
- void raise() Q_DECL_OVERRIDE;
- void lower() Q_DECL_OVERRIDE;
- void setContentOrientationMask(Qt::ScreenOrientations orientation) Q_DECL_OVERRIDE;
- void setWindowFlags(Qt::WindowFlags flags) Q_DECL_OVERRIDE;
- void sendProperty(const QString &name, const QVariant &value) Q_DECL_OVERRIDE;
-
-private:
- void setMaximized() Q_DECL_OVERRIDE;
- void setFullscreen() Q_DECL_OVERRIDE;
- void setNormal() Q_DECL_OVERRIDE;
- void setMinimized() Q_DECL_OVERRIDE;
-
- void setTopLevel() Q_DECL_OVERRIDE;
- void updateTransientParent(QWindow *parent) Q_DECL_OVERRIDE;
- void setPopup(QWaylandWindow *parent, QWaylandInputDevice *device, int serial);
-
- QWaylandWindow *m_window;
- bool m_maximized;
- bool m_fullscreen;
- QSize m_size;
- QWaylandExtendedSurface *m_extendedWindow;
-
- void shell_surface_ping(uint32_t serial) Q_DECL_OVERRIDE;
- void shell_surface_configure(uint32_t edges,
- int32_t width,
- int32_t height) Q_DECL_OVERRIDE;
- void shell_surface_popup_done() Q_DECL_OVERRIDE;
-
- friend class QWaylandWindow;
-};
-
-QT_END_NAMESPACE
-
-#endif // QWAYLANDSHELLSURFACE_H
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/client/qwaylandxdgshell.cpp
^
|
@@ -1,76 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Eurogiciel, author: <philippe.coval@eurogiciel.fr>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the config.tests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwaylandxdgshell_p.h"
-
-#include "qwaylanddisplay_p.h"
-#include "qwaylandwindow_p.h"
-#include "qwaylandinputdevice_p.h"
-#include "qwaylandscreen_p.h"
-
-#include <QtCore/QDebug>
-
-QT_BEGIN_NAMESPACE
-
-QWaylandXdgShell::QWaylandXdgShell(struct ::xdg_shell *shell)
- : QtWayland::xdg_shell(shell)
-{
-}
-
-QWaylandXdgShell::QWaylandXdgShell(struct ::wl_registry *registry, uint32_t id)
- : QtWayland::xdg_shell(registry, id, 1)
-{
- use_unstable_version(QtWayland::xdg_shell::version_current);
-}
-
-QWaylandXdgShell::~QWaylandXdgShell()
-{
- xdg_shell_destroy(object());
-}
-
-
-void QWaylandXdgShell::xdg_shell_ping(uint32_t serial)
-{
- pong(serial);
-}
-
-
-QT_END_NAMESPACE
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/client/qwaylandxdgshell_p.h
^
|
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Eurogiciel, author: <philippe.coval@eurogiciel.fr>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the config.tests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDXDGSHELL_H
-#define QWAYLANDXDGSHELL_H
-
-#include <QtCore/QSize>
-
-#include <wayland-client.h>
-
-#include <QtWaylandClient/private/qwayland-xdg-shell.h>
-#include <QtWaylandClient/private/qwaylandclientexport_p.h>
-#include "qwaylandshellsurface_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QWaylandWindow;
-class QWaylandInputDevice;
-class QWindow;
-
-class Q_WAYLAND_CLIENT_EXPORT QWaylandXdgShell : public QtWayland::xdg_shell
-{
-public:
- QWaylandXdgShell(struct ::xdg_shell *shell);
- QWaylandXdgShell(struct ::wl_registry *registry, uint32_t id);
-
- virtual ~QWaylandXdgShell();
-
-private:
- void xdg_shell_ping(uint32_t serial) Q_DECL_OVERRIDE;
-};
-
-QT_END_NAMESPACE
-
-#endif // QWAYLANDXDGSHELL_H
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/client/qwaylandxdgsurface.cpp
^
|
@@ -1,243 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the config.tests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwaylandxdgsurface_p.h"
-
-#include "qwaylanddisplay_p.h"
-#include "qwaylandwindow_p.h"
-#include "qwaylandinputdevice_p.h"
-#include "qwaylandabstractdecoration_p.h"
-#include "qwaylandscreen_p.h"
-#include "qwaylandextendedsurface_p.h"
-
-#include <QtCore/QDebug>
-
-QT_BEGIN_NAMESPACE
-
-QWaylandXdgSurface::QWaylandXdgSurface(struct ::xdg_surface *xdg_surface, QWaylandWindow *window)
- : QtWayland::xdg_surface(xdg_surface)
- , QWaylandShellSurface(window)
- , m_window(window)
- , m_maximized(false)
- , m_minimized(false)
- , m_fullscreen(false)
- , m_extendedWindow(Q_NULLPTR)
-{
- if (window->display()->windowExtension())
- m_extendedWindow = new QWaylandExtendedSurface(window);
-}
-
-QWaylandXdgSurface::~QWaylandXdgSurface()
-{
- xdg_surface_destroy(object());
- delete m_extendedWindow;
-}
-
-void QWaylandXdgSurface::resize(QWaylandInputDevice *inputDevice, enum wl_shell_surface_resize edges)
-{
- // May need some conversion if types get incompatibles, ATM they're identical
- enum resize_edge const * const arg = reinterpret_cast<enum resize_edge const * const>(&edges);
- resize(inputDevice, *arg);
-}
-
-void QWaylandXdgSurface::resize(QWaylandInputDevice *inputDevice, enum resize_edge edges)
-{
- resize(inputDevice->wl_seat(),
- inputDevice->serial(),
- edges);
-}
-
-void QWaylandXdgSurface::move(QWaylandInputDevice *inputDevice)
-{
- move(inputDevice->wl_seat(),
- inputDevice->serial());
-}
-
-void QWaylandXdgSurface::setMaximized()
-{
- if (!m_maximized)
- request_change_state(XDG_SURFACE_STATE_MAXIMIZED, true, 0);
-}
-
-void QWaylandXdgSurface::setFullscreen()
-{
- if (!m_fullscreen)
- request_change_state(XDG_SURFACE_STATE_FULLSCREEN, true, 0);
-}
-
-void QWaylandXdgSurface::setNormal()
-{
- if (m_fullscreen || m_maximized || m_minimized) {
- if (m_maximized) {
- request_change_state(XDG_SURFACE_STATE_MAXIMIZED, false, 0);
- }
- if (m_fullscreen) {
- request_change_state(XDG_SURFACE_STATE_FULLSCREEN, false, 0);
- }
-
- m_fullscreen = m_maximized = m_minimized = false;
- setTopLevel();
- QMargins m = m_window->frameMargins();
- m_window->configure(0, m_size.width() + m.left() + m.right(), m_size.height() + m.top() + m.bottom());
- }
-}
-
-void QWaylandXdgSurface::setMinimized()
-{
- m_minimized = true;
- m_size = m_window->window()->geometry().size();
- set_minimized();
-}
-
-void QWaylandXdgSurface::setTopLevel()
-{
- // There's no xdg_shell_surface API for this, ignoring
-}
-
-void QWaylandXdgSurface::updateTransientParent(QWindow *parent)
-{
- QWaylandWindow *parent_wayland_window = static_cast<QWaylandWindow *>(parent->handle());
- if (!parent_wayland_window)
- return;
-
- // set_transient expects a position relative to the parent
- QPoint transientPos = m_window->geometry().topLeft(); // this is absolute
- QWindow *parentWin = m_window->window()->transientParent();
- transientPos -= parentWin->geometry().topLeft();
- if (parent_wayland_window->decoration()) {
- transientPos.setX(transientPos.x() + parent_wayland_window->decoration()->margins().left());
- transientPos.setY(transientPos.y() + parent_wayland_window->decoration()->margins().top());
- }
-
- uint32_t flags = 0;
- Qt::WindowFlags wf = m_window->window()->flags();
- if (wf.testFlag(Qt::ToolTip)
- || wf.testFlag(Qt::WindowTransparentForInput))
- flags |= XDG_SURFACE_SET_TRANSIENT_FOR;
-
- set_transient_for(parent_wayland_window->object());
-}
-
-void QWaylandXdgSurface::setTitle(const QString & title)
-{
- return QtWayland::xdg_surface::set_title(title);
-}
-
-void QWaylandXdgSurface::setAppId(const QString & appId)
-{
- return QtWayland::xdg_surface::set_app_id(appId);
-}
-
-void QWaylandXdgSurface::raise()
-{
- if (m_extendedWindow)
- m_extendedWindow->raise();
-}
-
-void QWaylandXdgSurface::lower()
-{
- if (m_extendedWindow)
- m_extendedWindow->lower();
-}
-
-void QWaylandXdgSurface::setContentOrientationMask(Qt::ScreenOrientations orientation)
-{
- if (m_extendedWindow)
- m_extendedWindow->setContentOrientationMask(orientation);
-}
-
-void QWaylandXdgSurface::setWindowFlags(Qt::WindowFlags flags)
-{
- if (m_extendedWindow)
- m_extendedWindow->setWindowFlags(flags);
-}
-
-void QWaylandXdgSurface::sendProperty(const QString &name, const QVariant &value)
-{
- if (m_extendedWindow)
- m_extendedWindow->updateGenericProperty(name, value);
-}
-
-void QWaylandXdgSurface::xdg_surface_configure(int32_t width, int32_t height)
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/client/qwaylandxdgsurface_p.h
^
|
@@ -1,118 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the config.tests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDXDGSURFACE_H
-#define QWAYLANDXDGSURFACE_H
-
-#include <QtCore/QSize>
-
-#include <wayland-client.h>
-
-#include <QtWaylandClient/private/qwayland-xdg-shell.h>
-#include <QtWaylandClient/private/qwaylandclientexport_p.h>
-#include "qwaylandshellsurface_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QWaylandWindow;
-class QWaylandInputDevice;
-class QWindow;
-class QWaylandExtendedSurface;
-
-class Q_WAYLAND_CLIENT_EXPORT QWaylandXdgSurface : public QtWayland::xdg_surface
- , public QWaylandShellSurface
-{
-public:
- QWaylandXdgSurface(struct ::xdg_surface *shell_surface, QWaylandWindow *window);
- virtual ~QWaylandXdgSurface();
-
- using QtWayland::xdg_surface::resize;
- void resize(QWaylandInputDevice *inputDevice, enum resize_edge edges);
-
- void resize(QWaylandInputDevice *inputDevice, enum wl_shell_surface_resize edges) Q_DECL_OVERRIDE;
-
- using QtWayland::xdg_surface::move;
- void move(QWaylandInputDevice *inputDevice) Q_DECL_OVERRIDE;
-
- void setTitle(const QString &title) Q_DECL_OVERRIDE;
- void setAppId(const QString &appId) Q_DECL_OVERRIDE;
-
- void raise() Q_DECL_OVERRIDE;
- void lower() Q_DECL_OVERRIDE;
- void setContentOrientationMask(Qt::ScreenOrientations orientation) Q_DECL_OVERRIDE;
- void setWindowFlags(Qt::WindowFlags flags) Q_DECL_OVERRIDE;
- void sendProperty(const QString &name, const QVariant &value) Q_DECL_OVERRIDE;
-
- bool isFullscreen() const { return m_fullscreen; }
- bool isMaximized() const { return m_maximized; }
-
-private:
- void setMaximized() Q_DECL_OVERRIDE;
- void setFullscreen() Q_DECL_OVERRIDE;
- void setNormal() Q_DECL_OVERRIDE;
- void setMinimized() Q_DECL_OVERRIDE;
-
- void setTopLevel() Q_DECL_OVERRIDE;
- void updateTransientParent(QWindow *parent) Q_DECL_OVERRIDE;
-
-private:
- QWaylandWindow *m_window;
- bool m_maximized;
- bool m_minimized;
- bool m_fullscreen;
- QSize m_size;
- QWaylandExtendedSurface *m_extendedWindow;
-
- void xdg_surface_configure(int32_t width,
- int32_t height) Q_DECL_OVERRIDE;
- void xdg_surface_change_state(uint32_t state,
- uint32_t value,
- uint32_t serial) Q_DECL_OVERRIDE;
- void xdg_surface_activated() Q_DECL_OVERRIDE;
- void xdg_surface_deactivated() Q_DECL_OVERRIDE;
- void xdg_surface_close() Q_DECL_OVERRIDE;
-
- friend class QWaylandWindow;
-};
-
-QT_END_NAMESPACE
-
-#endif // QWAYLANDXDGSURFACE_H
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/client/shellintegration
^
|
-(directory)
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/client/shellintegration/qwaylandshellintegration_p.h
^
|
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Jolla Ltd
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDSHELLINTEGRATION_H
-#define QWAYLANDSHELLINTEGRATION_H
-
-#include <QtCore/qglobal.h>
-#include <QtWaylandClient/private/qwaylandclientexport_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class QWaylandWindow;
-class QWaylandDisplay;
-class QWaylandShellSurface;
-
-class Q_WAYLAND_CLIENT_EXPORT QWaylandShellIntegration
-{
-public:
- QWaylandShellIntegration() {}
- virtual ~QWaylandShellIntegration() {}
-
- virtual bool initialize(QWaylandDisplay *display) = 0;
- virtual QWaylandShellSurface *createShellSurface(QWaylandWindow *window) = 0;
-};
-
-QT_END_NAMESPACE
-
-#endif // QWAYLANDSHELLINTEGRATION_H
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/client/shellintegration/qwaylandshellintegrationfactory.cpp
^
|
@@ -1,96 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Jolla Ltd
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwaylandshellintegrationfactory_p.h"
-#include "qwaylandshellintegrationplugin_p.h"
-#include "qwaylandshellintegration_p.h"
-#include <QtCore/private/qfactoryloader_p.h>
-#include <QtCore/QCoreApplication>
-#include <QtCore/QDir>
-
-QT_BEGIN_NAMESPACE
-
-#ifndef QT_NO_LIBRARY
-Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
- (QWaylandShellIntegrationFactoryInterface_iid, QLatin1String("/wayland-shell-integration"), Qt::CaseInsensitive))
-Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
- (QWaylandShellIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive))
-#endif
-
-QStringList QWaylandShellIntegrationFactory::keys(const QString &pluginPath)
-{
-#ifndef QT_NO_LIBRARY
- QStringList list;
- if (!pluginPath.isEmpty()) {
- QCoreApplication::addLibraryPath(pluginPath);
- list = directLoader()->keyMap().values();
- if (!list.isEmpty()) {
- const QString postFix = QStringLiteral(" (from ")
- + QDir::toNativeSeparators(pluginPath)
- + QLatin1Char(')');
- const QStringList::iterator end = list.end();
- for (QStringList::iterator it = list.begin(); it != end; ++it)
- (*it).append(postFix);
- }
- }
- list.append(loader()->keyMap().values());
- return list;
-#else
- return QStringList();
-#endif
-}
-
-QWaylandShellIntegration *QWaylandShellIntegrationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath)
-{
-#ifndef QT_NO_LIBRARY
- // Try loading the plugin from platformPluginPath first:
- if (!pluginPath.isEmpty()) {
- QCoreApplication::addLibraryPath(pluginPath);
- if (QWaylandShellIntegration *ret = qLoadPlugin1<QWaylandShellIntegration, QWaylandShellIntegrationPlugin>(directLoader(), name, args))
- return ret;
- }
- if (QWaylandShellIntegration *ret = qLoadPlugin1<QWaylandShellIntegration, QWaylandShellIntegrationPlugin>(loader(), name, args))
- return ret;
-#endif
- return Q_NULLPTR;
-}
-
-QT_END_NAMESPACE
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/client/shellintegration/qwaylandshellintegrationfactory_p.h
^
|
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Jolla Ltd
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDSHELLINTEGRATIONFACTORY_H
-#define QWAYLANDSHELLINTEGRATIONFACTORY_H
-
-#include <QtWaylandClient/private/qwaylandclientexport_p.h>
-#include <QtCore/QStringList>
-
-QT_BEGIN_NAMESPACE
-
-class QWaylandShellIntegration;
-
-class Q_WAYLAND_CLIENT_EXPORT QWaylandShellIntegrationFactory
-{
-public:
- static QStringList keys(const QString &pluginPath = QString());
- static QWaylandShellIntegration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString());
-};
-
-QT_END_NAMESPACE
-
-#endif // QWAYLANDSHELLINTEGRATIONFACTORY_H
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/client/shellintegration/qwaylandshellintegrationplugin.cpp
^
|
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Jolla Ltd
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwaylandshellintegrationplugin_p.h"
-
-QT_BEGIN_NAMESPACE
-
-QWaylandShellIntegrationPlugin::QWaylandShellIntegrationPlugin(QObject *parent)
- : QObject(parent)
-{
-}
-
-QWaylandShellIntegrationPlugin::~QWaylandShellIntegrationPlugin()
-{
-}
-
-QT_END_NAMESPACE
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/client/shellintegration/qwaylandshellintegrationplugin_p.h
^
|
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Jolla Ltd
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDSHELLINTEGRATIONPLUGIN_H
-#define QWAYLANDSHELLINTEGRATIONPLUGIN_H
-
-#include <QtWaylandClient/private/qwaylandclientexport_p.h>
-
-#include <QtCore/qplugin.h>
-#include <QtCore/qfactoryinterface.h>
-#include <QtCore/QObject>
-
-QT_BEGIN_NAMESPACE
-
-class QWaylandShellIntegration;
-
-#define QWaylandShellIntegrationFactoryInterface_iid "org.qt-project.Qt.WaylandClient.QWaylandShellIntegrationFactoryInterface.5.3"
-
-class Q_WAYLAND_CLIENT_EXPORT QWaylandShellIntegrationPlugin : public QObject
-{
- Q_OBJECT
-public:
- explicit QWaylandShellIntegrationPlugin(QObject *parent = 0);
- ~QWaylandShellIntegrationPlugin();
-
- virtual QWaylandShellIntegration *create(const QString &key, const QStringList ¶mList) = 0;
-};
-
-QT_END_NAMESPACE
-
-#endif // QWAYLANDSHELLINTEGRATIONPLUGIN_H
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/client/shellintegration/shellintegration.pri
^
|
@@ -1,11 +0,0 @@
-INCLUDEPATH += $$PWD
-
-SOURCES += \
- $$PWD/qwaylandshellintegrationplugin.cpp \
- $$PWD/qwaylandshellintegrationfactory.cpp
-
-HEADERS += \
- $$PWD/qwaylandshellintegration_p.h \
- $$PWD/qwaylandshellintegrationplugin_p.h \
- $$PWD/qwaylandshellintegrationfactory_p.h
-
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/compositor.pro
^
|
@@ -3,10 +3,8 @@
contains(QT_CONFIG, opengl):MODULE_DEFINES = QT_COMPOSITOR_WAYLAND_GL
-MODULE_PLUGIN_TYPES = wayland-graphics-integration-server
load(qt_module)
-CONFIG -= precompile_header
CONFIG += link_pkgconfig
DEFINES += QT_WAYLAND_WINDOWMANAGER_SUPPORT
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/compositor_api/compositor_api.pri
^
|
@@ -3,38 +3,28 @@
HEADERS += \
compositor_api/qwaylandcompositor.h \
compositor_api/qwaylandsurface.h \
- compositor_api/qwaylandsurface_p.h \
compositor_api/qwaylandinput.h \
compositor_api/qwaylandinputpanel.h \
- compositor_api/qwaylanddrag.h \
- compositor_api/qwaylandbufferref.h \
- compositor_api/qwaylandsurfaceview.h \
- compositor_api/qwaylandglobalinterface.h \
- compositor_api/qwaylandsurfaceinterface.h
+ compositor_api/qwaylanddrag.h
SOURCES += \
compositor_api/qwaylandcompositor.cpp \
compositor_api/qwaylandsurface.cpp \
compositor_api/qwaylandinput.cpp \
compositor_api/qwaylandinputpanel.cpp \
- compositor_api/qwaylanddrag.cpp \
- compositor_api/qwaylandbufferref.cpp \
- compositor_api/qwaylandsurfaceview.cpp \
- compositor_api/qwaylandglobalinterface.cpp \
- compositor_api/qwaylandsurfaceinterface.cpp
+ compositor_api/qwaylanddrag.cpp
QT += core-private
qtHaveModule(quick) {
SOURCES += \
- compositor_api/qwaylandquickcompositor.cpp \
- compositor_api/qwaylandquicksurface.cpp \
compositor_api/qwaylandsurfaceitem.cpp
HEADERS += \
- compositor_api/qwaylandquickcompositor.h \
- compositor_api/qwaylandquicksurface.h \
compositor_api/qwaylandsurfaceitem.h
+ DEFINES += QT_COMPOSITOR_QUICK
+
QT += qml quick
+ QT += quick-private gui-private
}
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/compositor/compositor_api/qwaylandbufferref.cpp
^
|
@@ -1,131 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Jolla Ltd, author: <giulio.camuffo@jollamobile.com>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QDebug>
-#include <QAtomicInt>
-
-#include "qwaylandbufferref.h"
-#include "wayland_wrapper/qwlsurfacebuffer_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QWaylandBufferRefPrivate
-{
-public:
- QtWayland::SurfaceBuffer *buffer;
-};
-
-QWaylandBufferRef::QWaylandBufferRef()
- : d(new QWaylandBufferRefPrivate)
-{
- d->buffer = 0;
-}
-
-QWaylandBufferRef::QWaylandBufferRef(QtWayland::SurfaceBuffer *buffer)
- : d(new QWaylandBufferRefPrivate)
-{
- d->buffer = buffer;
- if (buffer)
- buffer->ref();
-}
-
-QWaylandBufferRef::QWaylandBufferRef(const QWaylandBufferRef &ref)
- : d(new QWaylandBufferRefPrivate)
-{
- d->buffer = 0;
- *this = ref;
-}
-
-QWaylandBufferRef::~QWaylandBufferRef()
-{
- if (d->buffer)
- d->buffer->deref();
- delete d;
-}
-
-QWaylandBufferRef &QWaylandBufferRef::operator=(const QWaylandBufferRef &ref)
-{
- if (d->buffer)
- d->buffer->deref();
-
- d->buffer = ref.d->buffer;
- if (d->buffer)
- d->buffer->ref();
-
- return *this;
-}
-
-QWaylandBufferRef::operator bool() const
-{
- return d->buffer && d->buffer->waylandBufferHandle();
-}
-
-bool QWaylandBufferRef::isShm() const
-{
- return d->buffer->isShmBuffer();
-}
-
-QImage QWaylandBufferRef::image() const
-{
- if (d->buffer->isShmBuffer())
- return d->buffer->image();
- return QImage();
-}
-
-#ifdef QT_COMPOSITOR_WAYLAND_GL
-
-GLuint QWaylandBufferRef::createTexture()
-{
- if (!d->buffer->isShmBuffer() && !d->buffer->textureCreated()) {
- d->buffer->createTexture();
- }
- return d->buffer->texture();
-}
-
-void QWaylandBufferRef::destroyTexture()
-{
- if (!d->buffer->isShmBuffer() && d->buffer->textureCreated()) {
- d->buffer->destroyTexture();
- }
-}
-#endif
-
-QT_END_NAMESPACE
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/compositor/compositor_api/qwaylandbufferref.h
^
|
@@ -1,89 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Jolla Ltd, author: <giulio.camuffo@jollamobile.com>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDBUFFERREF_H
-#define QWAYLANDBUFFERREF_H
-
-#include <QImage>
-
-#ifdef QT_COMPOSITOR_WAYLAND_GL
-#include <QtGui/qopengl.h>
-#endif
-
-#include <QtCompositor/qwaylandexport.h>
-
-QT_BEGIN_NAMESPACE
-
-namespace QtWayland
-{
- class SurfaceBuffer;
-}
-
-class Q_COMPOSITOR_EXPORT QWaylandBufferRef
-{
-public:
- QWaylandBufferRef();
- explicit QWaylandBufferRef(QtWayland::SurfaceBuffer *buffer);
- QWaylandBufferRef(const QWaylandBufferRef &ref);
- ~QWaylandBufferRef();
-
- QWaylandBufferRef &operator=(const QWaylandBufferRef &ref);
- operator bool() const;
- bool isShm() const;
-
- QImage image() const;
-#ifdef QT_COMPOSITOR_WAYLAND_GL
- /**
- * There must be a GL context bound when calling this function.
- * It is responsibility of the caller to call destroyTexture() later.
- */
- GLuint createTexture();
- void destroyTexture();
-#endif
-
-private:
- class QWaylandBufferRefPrivate *const d;
- friend class QWaylandBufferRefPrivate;
-};
-
-QT_END_NAMESPACE
-
-#endif
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/compositor_api/qwaylandcompositor.cpp
^
|
@@ -41,15 +41,12 @@
#include "qwaylandcompositor.h"
#include "qwaylandinput.h"
-#include "qwaylandglobalinterface.h"
-#include "qwaylandsurfaceview.h"
#include "wayland_wrapper/qwlcompositor_p.h"
#include "wayland_wrapper/qwldatadevice_p.h"
#include "wayland_wrapper/qwlsurface_p.h"
#include "wayland_wrapper/qwlinputdevice_p.h"
#include "wayland_wrapper/qwlinputpanel_p.h"
-#include "wayland_wrapper/qwlshellsurface_p.h"
#include <QtCore/QCoreApplication>
#include <QtCore/QStringList>
@@ -58,41 +55,40 @@
#include <QDebug>
+#ifdef QT_COMPOSITOR_QUICK
+#include "qwaylandsurfaceitem.h"
+#endif
+
QT_BEGIN_NAMESPACE
QWaylandCompositor::QWaylandCompositor(QWindow *window, const char *socketName, ExtensionFlags extensions)
- : m_compositor(new QtWayland::Compositor(this, extensions))
+ : m_compositor(0)
, m_toplevel_window(window)
+ , m_socket_name(socketName)
{
- m_compositor->m_socket_name = socketName;
- m_compositor->init();
-}
+ QStringList arguments = QCoreApplication::instance()->arguments();
-QWaylandCompositor::QWaylandCompositor(QWindow *window, const char *socketName, QtWayland::Compositor *dptr)
- : m_compositor(dptr)
- , m_toplevel_window(window)
-{
- m_compositor->m_socket_name = socketName;
- m_compositor->init();
+ int socketArg = arguments.indexOf(QLatin1String("--wayland-socket-name"));
+ if (socketArg != -1 && socketArg + 1 < arguments.size())
+ m_socket_name = arguments.at(socketArg + 1).toLocal8Bit();
+
+ m_compositor = new QtWayland::Compositor(this, extensions);
+#ifdef QT_COMPOSITOR_QUICK
+ qmlRegisterType<QWaylandSurfaceItem>("WaylandCompositor", 1, 0, "WaylandSurfaceItem");
+ qmlRegisterType<QWaylandSurface>("WaylandCompositor", 1, 0, "WaylandSurface");
+#else
+ qRegisterMetaType<QWaylandSurface*>("WaylandSurface*");
+#endif
+ m_compositor->initializeHardwareIntegration();
+ m_compositor->initializeExtensions();
+ m_compositor->initializeDefaultInputDevice();
}
QWaylandCompositor::~QWaylandCompositor()
{
- qDeleteAll(m_compositor->m_globals);
delete m_compositor;
}
-void QWaylandCompositor::addGlobalInterface(QWaylandGlobalInterface *interface)
-{
- wl_global_create(m_compositor->wl_display(), interface->interface(), interface->version(), interface, QtWayland::Compositor::bindGlobal);
- m_compositor->m_globals << interface;
-}
-
-void QWaylandCompositor::addDefaultShell()
-{
- addGlobalInterface(new QtWayland::Shell);
-}
-
struct wl_display *QWaylandCompositor::waylandDisplay() const
{
return m_compositor->wl_display();
@@ -160,18 +156,17 @@
Q_UNUSED(surface);
}
-QWaylandSurfaceView *QWaylandCompositor::pickView(const QPointF &globalPosition) const
+QWaylandSurface *QWaylandCompositor::pickSurface(const QPointF &globalPosition) const
{
Q_FOREACH (QtWayland::Surface *surface, m_compositor->surfaces()) {
- foreach (QWaylandSurfaceView *view, surface->waylandSurface()->views())
- if (QRectF(view->pos(), surface->size()).contains(globalPosition))
- return view;
+ if (QRectF(surface->pos(), surface->size()).contains(globalPosition))
+ return surface->waylandSurface();
}
return 0;
}
-QPointF QWaylandCompositor::mapToView(QWaylandSurfaceView *surface, const QPointF &globalPosition) const
+QPointF QWaylandCompositor::mapToSurface(QWaylandSurface *surface, const QPointF &globalPosition) const
{
return globalPosition - surface->pos();
}
@@ -181,10 +176,10 @@
The default implementation simply forwards the request to QDesktopServices::openUrl().
*/
-bool QWaylandCompositor::openUrl(WaylandClient *client, const QUrl &url)
+void QWaylandCompositor::openUrl(WaylandClient *client, const QUrl &url)
{
Q_UNUSED(client);
- return QDesktopServices::openUrl(url);
+ QDesktopServices::openUrl(url);
}
QtWayland::Compositor * QWaylandCompositor::handle() const
@@ -218,9 +213,9 @@
const char *QWaylandCompositor::socketName() const
{
- if (m_compositor->m_socket_name.isEmpty())
+ if (m_socket_name.isEmpty())
return 0;
- return m_compositor->m_socket_name.constData();
+ return m_socket_name.constData();
}
/*!
@@ -294,9 +289,4 @@
m_compositor->configureTouchExtension(flags);
}
-QWaylandSurfaceView *QWaylandCompositor::createView(QWaylandSurface *surface)
-{
- return new QWaylandSurfaceView(surface);
-}
-
QT_END_NAMESPACE
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/compositor_api/qwaylandcompositor.h
^
|
@@ -47,8 +47,6 @@
#include <QImage>
#include <QRect>
-struct wl_display;
-
QT_BEGIN_NAMESPACE
class QMimeData;
@@ -58,8 +56,6 @@
class QWaylandInputDevice;
class QWaylandInputPanel;
class QWaylandDrag;
-class QWaylandGlobalInterface;
-class QWaylandSurfaceView;
namespace QtWayland
{
@@ -86,9 +82,7 @@
QWaylandCompositor(QWindow *window = 0, const char *socketName = 0, ExtensionFlags extensions = DefaultExtensions);
virtual ~QWaylandCompositor();
- void addGlobalInterface(QWaylandGlobalInterface *interface);
- void addDefaultShell();
- ::wl_display *waylandDisplay() const;
+ struct wl_display *waylandDisplay() const;
void frameStarted();
void sendFrameCallbacks(QList<QWaylandSurface *> visibleSurfaces);
@@ -104,10 +98,10 @@
virtual void surfaceCreated(QWaylandSurface *surface) = 0;
virtual void surfaceAboutToBeDestroyed(QWaylandSurface *surface);
- virtual QWaylandSurfaceView *pickView(const QPointF &globalPosition) const;
- virtual QPointF mapToView(QWaylandSurfaceView *view, const QPointF &surfacePosition) const;
+ virtual QWaylandSurface *pickSurface(const QPointF &globalPosition) const;
+ virtual QPointF mapToSurface(QWaylandSurface *surface, const QPointF &surfacePosition) const;
- virtual bool openUrl(WaylandClient *client, const QUrl &url);
+ virtual void openUrl(WaylandClient *client, const QUrl &url);
QtWayland::Compositor *handle() const;
@@ -146,17 +140,14 @@
Q_DECLARE_FLAGS(TouchExtensionFlags, TouchExtensionFlag)
void configureTouchExtension(TouchExtensionFlags flags);
- virtual QWaylandSurfaceView *createView(QWaylandSurface *surface);
-
protected:
- QWaylandCompositor(QWindow *window, const char *socketName, QtWayland::Compositor *dptr);
virtual void retainedSelectionReceived(QMimeData *mimeData);
+private:
friend class QtWayland::Compositor;
QtWayland::Compositor *m_compositor;
-
-private:
QWindow *m_toplevel_window;
+ QByteArray m_socket_name;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QWaylandCompositor::ExtensionFlags)
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/compositor_api/qwaylanddrag.cpp
^
|
@@ -46,7 +46,6 @@
#include "qwlinputdevice_p.h"
#include "qwldatadevice_p.h"
#include "qwlsurface_p.h"
-#include "qwaylandsurfaceview.h"
QT_BEGIN_NAMESPACE
@@ -67,7 +66,7 @@
{
}
-QWaylandSurfaceView *QWaylandDrag::icon() const
+QWaylandSurface *QWaylandDrag::icon() const
{
Q_D(const QWaylandDrag);
@@ -75,7 +74,7 @@
if (!dataDevice)
return 0;
- return dataDevice->dragIcon();
+ return dataDevice->dragIcon() ? dataDevice->dragIcon()->waylandSurface() : 0;
}
bool QWaylandDrag::visible() const
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/compositor_api/qwaylanddrag.h
^
|
@@ -49,7 +49,6 @@
class QWaylandDragPrivate;
class QWaylandSurface;
-class QWaylandSurfaceView;
namespace QtWayland {
class InputDevice;
@@ -59,13 +58,13 @@
Q_OBJECT
Q_DECLARE_PRIVATE(QWaylandDrag)
- Q_PROPERTY(QWaylandSurfaceView* icon READ icon NOTIFY iconChanged)
+ Q_PROPERTY(QWaylandSurface* icon READ icon NOTIFY iconChanged)
Q_PROPERTY(bool visible READ visible NOTIFY iconChanged)
public:
explicit QWaylandDrag(QtWayland::InputDevice *inputDevice);
- QWaylandSurfaceView *icon() const;
+ QWaylandSurface *icon() const;
bool visible() const;
Q_SIGNALS:
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/compositor/compositor_api/qwaylandglobalinterface.cpp
^
|
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Jolla Ltd, author: <giulio.camuffo@jollamobile.com>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwaylandglobalinterface.h"
-
-#include <wayland-server.h>
-
-QT_BEGIN_NAMESPACE
-
-QWaylandGlobalInterface::QWaylandGlobalInterface()
-{
-
-}
-
-QWaylandGlobalInterface::~QWaylandGlobalInterface()
-{
-
-}
-
-quint32 QWaylandGlobalInterface::version() const
-{
- return interface()->version;
-}
-
-QT_END_NAMESPACE
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/compositor/compositor_api/qwaylandglobalinterface.h
^
|
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Jolla Ltd, author: <giulio.camuffo@jollamobile.com>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDGLOBALINTERFACE_H
-#define QWAYLANDGLOBALINTERFACE_H
-
-#include <QtCompositor/qwaylandexport.h>
-
-struct wl_interface;
-struct wl_client;
-
-QT_BEGIN_NAMESPACE
-
-namespace QtWayland {
-class Compositor;
-}
-
-class Q_COMPOSITOR_EXPORT QWaylandGlobalInterface
-{
-public:
- QWaylandGlobalInterface();
- virtual ~QWaylandGlobalInterface();
-
- virtual const wl_interface *interface() const = 0;
- virtual quint32 version() const;
-
-protected:
- virtual void bind(wl_client *client, quint32 version, quint32 id) = 0;
-
- friend class QtWayland::Compositor;
-};
-
-QT_END_NAMESPACE
-
-#endif
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/compositor_api/qwaylandinput.cpp
^
|
@@ -45,7 +45,6 @@
#include "qwaylandcompositor.h"
#include "qwlsurface_p.h"
#include "qwlcompositor_p.h"
-#include "qwaylandsurfaceview.h"
QT_BEGIN_NAMESPACE
@@ -60,8 +59,8 @@
-QWaylandInputDevice::QWaylandInputDevice(QWaylandCompositor *compositor, CapabilityFlags caps)
- : d(new QtWayland::InputDevice(this,compositor->handle(), caps))
+QWaylandInputDevice::QWaylandInputDevice(QWaylandCompositor *compositor)
+ : d(new QtWayland::InputDevice(this,compositor->handle()))
{
}
@@ -88,9 +87,10 @@
/** Convenience function that will set the mouse focus to the surface, then send the mouse move event.
* If the mouse focus is the same surface as the surface passed in, then only the move event is sent
**/
-void QWaylandInputDevice::sendMouseMoveEvent(QWaylandSurfaceView *surface, const QPointF &localPos, const QPointF &globalPos)
+void QWaylandInputDevice::sendMouseMoveEvent(QWaylandSurface *surface, const QPointF &localPos, const QPointF &globalPos)
{
- d->sendMouseMoveEvent(surface,localPos,globalPos);
+ QtWayland::Surface *wlsurface = surface? surface->handle():0;
+ d->sendMouseMoveEvent(wlsurface,localPos,globalPos);
}
void QWaylandInputDevice::sendMouseWheelEvent(Qt::Orientation orientation, int delta)
@@ -158,14 +158,18 @@
handle()->keyboardDevice()->setKeymap(keymap);
}
-QWaylandSurfaceView *QWaylandInputDevice::mouseFocus() const
+QWaylandSurface *QWaylandInputDevice::mouseFocus() const
{
- return d->mouseFocus();
+ QtWayland::Surface *wlsurface = d->mouseFocus();
+ if (wlsurface)
+ return wlsurface->waylandSurface();
+ return 0;
}
-void QWaylandInputDevice::setMouseFocus(QWaylandSurfaceView *surface, const QPointF &localPos, const QPointF &globalPos)
+void QWaylandInputDevice::setMouseFocus(QWaylandSurface *surface, const QPointF &localPos, const QPointF &globalPos)
{
- d->setMouseFocus(surface,localPos,globalPos);
+ QtWayland::Surface *wlsurface = surface?surface->handle():0;
+ d->setMouseFocus(wlsurface,localPos,globalPos);
}
QWaylandCompositor *QWaylandInputDevice::compositor() const
@@ -178,9 +182,4 @@
return d;
}
-QWaylandInputDevice::CapabilityFlags QWaylandInputDevice::capabilities()
-{
- return d->capabilities();
-}
-
QT_END_NAMESPACE
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/compositor_api/qwaylandinput.h
^
|
@@ -47,13 +47,12 @@
#include <QtCompositor/qwaylandexport.h>
-QT_BEGIN_NAMESPACE
-
class QWaylandCompositor;
class QWaylandSurface;
class QKeyEvent;
class QTouchEvent;
-class QWaylandSurfaceView;
+
+QT_BEGIN_NAMESPACE
namespace QtWayland {
class InputDevice;
@@ -82,23 +81,13 @@
class Q_COMPOSITOR_EXPORT QWaylandInputDevice
{
public:
- enum CapabilityFlag {
- // The order should match the enum WL_SEAT_CAPABILITY_*
- Pointer = 0x01,
- Keyboard = 0x02,
- Touch = 0x04,
-
- DefaultCapabilities = Pointer | Keyboard | Touch
- };
- Q_DECLARE_FLAGS(CapabilityFlags, CapabilityFlag)
-
- QWaylandInputDevice(QWaylandCompositor *compositor, CapabilityFlags caps = DefaultCapabilities);
+ QWaylandInputDevice(QWaylandCompositor *compositor);
~QWaylandInputDevice();
void sendMousePressEvent(Qt::MouseButton button, const QPointF &localPos, const QPointF &globalPos = QPointF());
void sendMouseReleaseEvent(Qt::MouseButton button, const QPointF &localPos, const QPointF &globalPos = QPointF());
void sendMouseMoveEvent(const QPointF &localPos, const QPointF &globalPos = QPointF());
- void sendMouseMoveEvent(QWaylandSurfaceView *surface , const QPointF &localPos, const QPointF &globalPos = QPointF());
+ void sendMouseMoveEvent(QWaylandSurface *surface , const QPointF &localPos, const QPointF &globalPos = QPointF());
void sendMouseWheelEvent(Qt::Orientation orientation, int delta);
void sendKeyPressEvent(uint code);
@@ -117,21 +106,17 @@
bool setKeyboardFocus(QWaylandSurface *surface);
void setKeymap(const QWaylandKeymap &keymap);
- QWaylandSurfaceView *mouseFocus() const;
- void setMouseFocus(QWaylandSurfaceView *surface, const QPointF &local_pos, const QPointF &global_pos = QPointF());
+ QWaylandSurface *mouseFocus() const;
+ void setMouseFocus(QWaylandSurface *surface, const QPointF &local_pos, const QPointF &global_pos = QPointF());
QWaylandCompositor *compositor() const;
QtWayland::InputDevice *handle() const;
- QWaylandInputDevice::CapabilityFlags capabilities();
-
private:
QtWayland::InputDevice *d;
Q_DISABLE_COPY(QWaylandInputDevice)
};
-Q_DECLARE_OPERATORS_FOR_FLAGS(QWaylandInputDevice::CapabilityFlags)
-
QT_END_NAMESPACE
#endif // QWAYLANDINPUT_H
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/compositor/compositor_api/qwaylandquickcompositor.cpp
^
|
@@ -1,107 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Jolla Ltd, author: <giulio.camuffo@jollamobile.com>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QQuickWindow>
-
-#include <QtCompositor/private/qwlcompositor_p.h>
-
-#include "qwaylandquickcompositor.h"
-#include "qwaylandquicksurface.h"
-#include "qwaylandsurfaceitem.h"
-
-QT_BEGIN_NAMESPACE
-
-class QWaylandQuickCompositorPrivate : public QtWayland::Compositor
-{
-public:
- QWaylandQuickCompositorPrivate(QWaylandQuickCompositor *compositor, QWaylandCompositor::ExtensionFlags extensions)
- : QtWayland::Compositor(compositor, extensions)
- , updateScheduled(false)
- {
- }
-
- void compositor_create_surface(Resource *resource, uint32_t id) Q_DECL_OVERRIDE
- {
- QWaylandQuickSurface *surface = new QWaylandQuickSurface(resource->client(), id, wl_resource_get_version(resource->handle), static_cast<QWaylandQuickCompositor *>(m_qt_compositor));
- m_surfaces << surface->handle();
- //BUG: This may not be an on-screen window surface though
- m_qt_compositor->surfaceCreated(surface);
- }
-
- void updateStarted()
- {
- updateScheduled = false;
- m_qt_compositor->frameStarted();
- m_qt_compositor->cleanupGraphicsResources();
- }
-
- bool updateScheduled;
-};
-
-
-QWaylandQuickCompositor::QWaylandQuickCompositor(QQuickWindow *window, const char *socketName, ExtensionFlags extensions)
- : QWaylandCompositor(window, socketName, new QWaylandQuickCompositorPrivate(this, extensions))
-{
- window->connect(window, &QQuickWindow::beforeSynchronizing, d_ptr(), &QWaylandQuickCompositorPrivate::updateStarted, Qt::DirectConnection);
-
- qmlRegisterUncreatableType<QWaylandSurfaceItem>("QtCompositor", 1, 0, "WaylandSurfaceItem", QObject::tr("Cannot create instance of WaylandSurfaceItem"));
- qmlRegisterUncreatableType<QWaylandQuickSurface>("QtCompositor", 1, 0, "WaylandQuickSurface", QObject::tr("Cannot create instance of WaylandQuickSurface"));
-}
-
-QWaylandQuickCompositorPrivate *QWaylandQuickCompositor::d_ptr()
-{
- return static_cast<QWaylandQuickCompositorPrivate *>(m_compositor);
-}
-
-void QWaylandQuickCompositor::update()
-{
- if (!d_ptr()->updateScheduled) {
- static_cast<QQuickWindow *>(window())->update();
- d_ptr()->updateScheduled = true;
- }
-}
-
-QWaylandSurfaceView *QWaylandQuickCompositor::createView(QWaylandSurface *surf)
-{
- return new QWaylandSurfaceItem(static_cast<QWaylandQuickSurface *>(surf));
-}
-
-QT_END_NAMESPACE
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/compositor/compositor_api/qwaylandquickcompositor.h
^
|
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Jolla Ltd, author: <giulio.camuffo@jollamobile.com>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDQUICKCOMPOSITOR_H
-#define QWAYLANDQUICKCOMPOSITOR_H
-
-#include <QtCompositor/qwaylandcompositor.h>
-
-QT_BEGIN_NAMESPACE
-
-class QQuickWindow;
-class QWaylandQuickCompositorPrivate;
-class QWaylandSurfaceView;
-
-class Q_COMPOSITOR_EXPORT QWaylandQuickCompositor : public QWaylandCompositor
-{
-public:
- QWaylandQuickCompositor(QQuickWindow *window = 0, const char *socketName = 0, QWaylandCompositor::ExtensionFlags extensions = DefaultExtensions);
-
- void update();
-
- QWaylandSurfaceView *createView(QWaylandSurface *surf) Q_DECL_OVERRIDE;
-
-private:
- friend class QWaylandQuickCompositorPrivate;
- QWaylandQuickCompositorPrivate *d_ptr();
-};
-
-QT_END_NAMESPACE
-
-#endif
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/compositor/compositor_api/qwaylandquicksurface.cpp
^
|
@@ -1,245 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Jolla Ltd, author: <giulio.camuffo@jollamobile.com>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QSGTexture>
-#include <QOpenGLTexture>
-#include <QQuickWindow>
-#include <QDebug>
-#include <QQmlPropertyMap>
-
-#include "qwaylandquicksurface.h"
-#include "qwaylandquickcompositor.h"
-#include "qwaylandsurfaceitem.h"
-#include <QtCompositor/qwaylandbufferref.h>
-#include <QtCompositor/private/qwaylandsurface_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class BufferAttacher : public QWaylandBufferAttacher
-{
-public:
- BufferAttacher()
- : surface(0)
- , texture(0)
- , update(false)
- {
-
- }
-
- ~BufferAttacher()
- {
- if (texture)
- texture->deleteLater();
- bufferRef = QWaylandBufferRef();
- nextBuffer = QWaylandBufferRef();
- }
-
- void attach(const QWaylandBufferRef &ref) Q_DECL_OVERRIDE
- {
- nextBuffer = ref;
- update = true;
- }
-
- void createTexture()
- {
- if (bufferRef)
- bufferRef.destroyTexture();
- bufferRef = nextBuffer;
-
- QQuickWindow *window = static_cast<QQuickWindow *>(surface->compositor()->window());
- // If the next buffer is NULL do not delete the current texture. If the client called
- // attach(0) the surface is going to be unmapped anyway, if instead the client attached
- // a valid buffer but died before we got here we want to keep the old buffer around
- // in case some destroy animation is run.
- if (bufferRef) {
- delete texture;
-
- if (bufferRef.isShm()) {
- texture = window->createTextureFromImage(bufferRef.image());
- } else {
- QQuickWindow::CreateTextureOptions opt = 0;
- if (surface->useTextureAlpha()) {
- opt |= QQuickWindow::TextureHasAlphaChannel;
- }
- texture = window->createTextureFromId(bufferRef.createTexture(), surface->size(), opt);
- }
- texture->bind();
- }
-
- update = false;
- }
-
- void invalidateTexture()
- {
- delete texture;
- texture = 0;
- }
-
- QWaylandQuickSurface *surface;
- QWaylandBufferRef bufferRef;
- QWaylandBufferRef nextBuffer;
- QSGTexture *texture;
- bool update;
-};
-
-
-class QWaylandQuickSurfacePrivate : public QWaylandSurfacePrivate
-{
-public:
- QWaylandQuickSurfacePrivate(wl_client *client, quint32 id, int version, QWaylandQuickCompositor *c, QWaylandQuickSurface *surf)
- : QWaylandSurfacePrivate(client, id, version, c, surf)
- , buffer(new BufferAttacher)
- , compositor(c)
- , useTextureAlpha(true)
- , windowPropertyMap(new QQmlPropertyMap)
- , clientRenderingEnabled(true)
- {
-
- }
-
- ~QWaylandQuickSurfacePrivate()
- {
- windowPropertyMap->deleteLater();
- // buffer is deleted automatically by ~Surface(), since it is the assigned attacher
- }
-
- void surface_commit(Resource *resource) Q_DECL_OVERRIDE
- {
- if (m_pending.newlyAttached) {
- buffer->update = true;
- }
- QWaylandSurfacePrivate::surface_commit(resource);
-
- compositor->update();
- }
-
- BufferAttacher *buffer;
- QWaylandQuickCompositor *compositor;
- bool useTextureAlpha;
- QQmlPropertyMap *windowPropertyMap;
- bool clientRenderingEnabled;
-};
-
-QWaylandQuickSurface::QWaylandQuickSurface(wl_client *client, quint32 id, int version, QWaylandQuickCompositor *compositor)
- : QWaylandSurface(new QWaylandQuickSurfacePrivate(client, id, version, compositor, this))
-{
- Q_D(QWaylandQuickSurface);
- d->buffer->surface = this;
- setBufferAttacher(d->buffer);
-
- QQuickWindow *window = static_cast<QQuickWindow *>(compositor->window());
- connect(window, &QQuickWindow::beforeSynchronizing, this, &QWaylandQuickSurface::updateTexture, Qt::DirectConnection);
- connect(window, &QQuickWindow::sceneGraphInvalidated, this, &QWaylandQuickSurface::invalidateTexture, Qt::DirectConnection);
- connect(this, &QWaylandSurface::windowPropertyChanged, d->windowPropertyMap, &QQmlPropertyMap::insert);
- connect(d->windowPropertyMap, &QQmlPropertyMap::valueChanged, this, &QWaylandSurface::setWindowProperty);
-
-}
-
-QWaylandQuickSurface::~QWaylandQuickSurface()
-{
-
-}
-
-QSGTexture *QWaylandQuickSurface::texture() const
-{
- Q_D(const QWaylandQuickSurface);
- return d->buffer->texture;
-}
-
-bool QWaylandQuickSurface::useTextureAlpha() const
-{
- Q_D(const QWaylandQuickSurface);
- return d->useTextureAlpha;
-}
-
-void QWaylandQuickSurface::setUseTextureAlpha(bool useTextureAlpha)
-{
- Q_D(QWaylandQuickSurface);
- if (d->useTextureAlpha != useTextureAlpha) {
- d->useTextureAlpha = useTextureAlpha;
- emit useTextureAlphaChanged();
- emit configure(d->buffer->bufferRef);
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/compositor/compositor_api/qwaylandquicksurface.h
^
|
@@ -1,90 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Jolla Ltd, author: <giulio.camuffo@jollamobile.com>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWAYLANDSURFACE_H
-#define QQUICKWAYLANDSURFACE_H
-
-#include <QtCompositor/qwaylandsurface.h>
-
-struct wl_client;
-
-QT_BEGIN_NAMESPACE
-
-class QSGTexture;
-
-class QWaylandSurfaceItem;
-class QWaylandQuickSurfacePrivate;
-class QWaylandQuickCompositor;
-
-class Q_COMPOSITOR_EXPORT QWaylandQuickSurface : public QWaylandSurface
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(QWaylandQuickSurface)
- Q_PROPERTY(bool useTextureAlpha READ useTextureAlpha WRITE setUseTextureAlpha NOTIFY useTextureAlphaChanged)
- Q_PROPERTY(bool clientRenderingEnabled READ clientRenderingEnabled WRITE setClientRenderingEnabled NOTIFY clientRenderingEnabledChanged)
- Q_PROPERTY(QObject *windowProperties READ windowPropertyMap CONSTANT)
-public:
- QWaylandQuickSurface(wl_client *client, quint32 id, int version, QWaylandQuickCompositor *compositor);
- ~QWaylandQuickSurface();
-
- QSGTexture *texture() const;
-
- bool useTextureAlpha() const;
- void setUseTextureAlpha(bool useTextureAlpha);
-
- bool clientRenderingEnabled() const;
- void setClientRenderingEnabled(bool enabled);
-
- QObject *windowPropertyMap() const;
-
-Q_SIGNALS:
- void useTextureAlphaChanged();
- void clientRenderingEnabledChanged();
-
-private:
- void updateTexture();
- void invalidateTexture();
-
-};
-
-QT_END_NAMESPACE
-
-#endif
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/compositor_api/qwaylandsurface.cpp
^
|
@@ -52,56 +52,75 @@
#include "wayland_wrapper/qwldatadevicemanager_p.h"
#include "qwaylandcompositor.h"
-#include "qwaylandsurface_p.h"
-#include "qwaylandbufferref.h"
-#include "qwaylandsurfaceinterface.h"
+#include "waylandwindowmanagerintegration.h"
#include <QtGui/QGuiApplication>
#include <QtGui/QScreen>
-QT_BEGIN_NAMESPACE
-
-QWaylandSurfacePrivate::QWaylandSurfacePrivate(wl_client *client, quint32 id, int version, QWaylandCompositor *compositor, QWaylandSurface *surface)
- : QtWayland::Surface(client, id, version, compositor, surface)
- , closing(false)
- , refCount(1)
- , windowType(QWaylandSurface::WindowType::None)
-{}
-
+#ifdef QT_COMPOSITOR_QUICK
+#include "qwaylandsurfaceitem.h"
+#include <QtQml/QQmlPropertyMap>
+#endif
+QT_BEGIN_NAMESPACE
-QWaylandSurface::QWaylandSurface(wl_client *client, quint32 id, int version, QWaylandCompositor *compositor)
- : QObject(*new QWaylandSurfacePrivate(client, id, version, compositor, this))
+class QWaylandSurfacePrivate : public QObjectPrivate
{
+public:
+ QWaylandSurfacePrivate(QtWayland::Surface *srfc)
+ : surface(srfc)
+#ifdef QT_COMPOSITOR_QUICK
+ , surface_item(0)
+ , windowPropertyMap(new QQmlPropertyMap)
+#endif
+ {}
+
+ ~QWaylandSurfacePrivate()
+ {
+#ifdef QT_COMPOSITOR_QUICK
+ if (surface_item)
+ surface_item->setSurface(0);
+ if (windowPropertyMap)
+ windowPropertyMap->deleteLater();
+#endif
+ }
-}
+ QtWayland::Surface *surface;
+#ifdef QT_COMPOSITOR_QUICK
+ QWaylandSurfaceItem *surface_item;
+ QQmlPropertyMap *windowPropertyMap;
+#endif
+};
-QWaylandSurface::QWaylandSurface(QWaylandSurfacePrivate *dptr)
- : QObject(*dptr)
+QWaylandSurface::QWaylandSurface(QtWayland::Surface *surface)
+ : QObject(*new QWaylandSurfacePrivate(surface))
{
-
+#ifdef QT_COMPOSITOR_QUICK
+ Q_D(QWaylandSurface);
+ connect(this, &QWaylandSurface::windowPropertyChanged,
+ d->windowPropertyMap, &QQmlPropertyMap::insert);
+ connect(d->windowPropertyMap, &QQmlPropertyMap::valueChanged,
+ this, &QWaylandSurface::setWindowProperty);
+#endif
}
-QWaylandSurface::~QWaylandSurface()
+void QWaylandSurface::swapBuffers()
{
- Q_D(QWaylandSurface);
- qDeleteAll(d->interfaces);
- delete d->m_attacher;
+ Q_D(const QWaylandSurface);
+ d->surface->swapBuffers();
}
WaylandClient *QWaylandSurface::client() const
{
Q_D(const QWaylandSurface);
- if (d->isDestroyed())
- return Q_NULLPTR;
- return d->resource()->client();
+ return d->surface->resource()->client();
}
QWaylandSurface *QWaylandSurface::parentSurface() const
{
Q_D(const QWaylandSurface);
- if (d->subSurface() && d->subSurface()->parent()) {
- return d->subSurface()->parent()->waylandSurface();
+ if (d->surface->subSurface() && d->surface->subSurface()->parent()) {
+ return d->surface->subSurface()->parent()->waylandSurface();
}
return 0;
}
@@ -109,34 +128,22 @@
QLinkedList<QWaylandSurface *> QWaylandSurface::subSurfaces() const
{
Q_D(const QWaylandSurface);
- if (d->subSurface()) {
- return d->subSurface()->subSurfaces();
+ if (d->surface->subSurface()) {
+ return d->surface->subSurface()->subSurfaces();
}
return QLinkedList<QWaylandSurface *>();
}
-void QWaylandSurface::addInterface(QWaylandSurfaceInterface *iface)
-{
- Q_D(QWaylandSurface);
- d->interfaces.prepend(iface);
-}
-
-void QWaylandSurface::removeInterface(QWaylandSurfaceInterface *iface)
-{
- Q_D(QWaylandSurface);
- d->interfaces.removeOne(iface);
-}
-
QWaylandSurface::Type QWaylandSurface::type() const
{
Q_D(const QWaylandSurface);
- return d->type();
+ return d->surface->type();
}
bool QWaylandSurface::isYInverted() const
{
Q_D(const QWaylandSurface);
- return d->isYInverted();
+ return d->surface->isYInverted();
}
bool QWaylandSurface::visible() const
@@ -147,75 +154,114 @@
bool QWaylandSurface::isMapped() const
{
Q_D(const QWaylandSurface);
- return d->mapped();
+ return d->surface->mapped();
+}
+
+QPointF QWaylandSurface::pos() const
+{
+ Q_D(const QWaylandSurface);
+ return d->surface->pos();
+}
+
+void QWaylandSurface::setPos(const QPointF &pos)
+{
+ Q_D(QWaylandSurface);
+ d->surface->setPos(pos);
}
QSize QWaylandSurface::size() const
{
Q_D(const QWaylandSurface);
- return d->size();
+ return d->surface->size();
}
void QWaylandSurface::requestSize(const QSize &size)
{
Q_D(QWaylandSurface);
- QWaylandSurfaceResizeOp op(size);
- if (!sendInterfaceOp(op)) {
- int id = wl_resource_get_id(d->resource()->handle);
- qWarning("No surface interface forwarded the resize request for this surface (wl_surface@%d).", id);
- }
+ if (d->surface->shellSurface())
+ d->surface->shellSurface()->sendConfigure(WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT, size.width(), size.height());
}
Qt::ScreenOrientations QWaylandSurface::orientationUpdateMask() const
{
Q_D(const QWaylandSurface);
- if (!d->extendedSurface())
- return Qt::PrimaryOrientation;
- return d->extendedSurface()->contentOrientationMask();
+ return d->surface->compositor()->orientationUpdateMaskForClient(static_cast<wl_client *>(client()));
}
Qt::ScreenOrientation QWaylandSurface::contentOrientation() const
{
Q_D(const QWaylandSurface);
- return d->contentOrientation();
+ if (!d->surface->extendedSurface())
+ return Qt::PrimaryOrientation;
+ return d->surface->extendedSurface()->contentOrientation();
}
QWaylandSurface::WindowFlags QWaylandSurface::windowFlags() const
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/compositor_api/qwaylandsurface.h
^
|
@@ -48,18 +48,19 @@
#include <QtGui/QWindow>
#include <QtCore/QVariantMap>
-struct wl_client;
-struct wl_resource;
+#ifdef QT_COMPOSITOR_WAYLAND_GL
+#include <QtGui/qopengl.h>
+#endif
QT_BEGIN_NAMESPACE
class QTouchEvent;
class QWaylandSurfacePrivate;
class QWaylandCompositor;
-class QWaylandBufferRef;
-class QWaylandSurfaceView;
-class QWaylandSurfaceInterface;
-class QWaylandSurfaceOp;
+
+#ifdef QT_COMPOSITOR_QUICK
+class QWaylandSurfaceItem;
+#endif
namespace QtWayland {
class Surface;
@@ -67,22 +68,12 @@
class ExtendedSurface;
}
-class Q_COMPOSITOR_EXPORT QWaylandBufferAttacher
-{
-public:
- virtual ~QWaylandBufferAttacher() {}
-
-protected:
- virtual void attach(const QWaylandBufferRef &ref) = 0;
-
- friend class QtWayland::Surface;
-};
-
class Q_COMPOSITOR_EXPORT QWaylandSurface : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(QWaylandSurface)
Q_PROPERTY(QSize size READ size NOTIFY sizeChanged)
+ Q_PROPERTY(QPointF pos READ pos WRITE setPos NOTIFY posChanged)
Q_PROPERTY(QWaylandSurface::WindowFlags windowFlags READ windowFlags NOTIFY windowFlagsChanged)
Q_PROPERTY(QWaylandSurface::WindowType windowType READ windowType NOTIFY windowTypeChanged)
Q_PROPERTY(Qt::ScreenOrientation contentOrientation READ contentOrientation NOTIFY contentOrientationChanged)
@@ -90,8 +81,9 @@
Q_PROPERTY(QString title READ title NOTIFY titleChanged)
Q_PROPERTY(Qt::ScreenOrientations orientationUpdateMask READ orientationUpdateMask NOTIFY orientationUpdateMaskChanged)
Q_PROPERTY(QWindow::Visibility visibility READ visibility WRITE setVisibility NOTIFY visibilityChanged)
- Q_PROPERTY(QWaylandSurface *transientParent READ transientParent)
- Q_PROPERTY(QPointF transientOffset READ transientOffset)
+#ifdef QT_COMPOSITOR_QUICK
+ Q_PROPERTY(QObject * windowProperties READ windowPropertyMap CONSTANT)
+#endif
Q_ENUMS(WindowFlag WindowType)
Q_FLAGS(WindowFlag WindowFlags)
@@ -117,15 +109,12 @@
Texture
};
- QWaylandSurface(wl_client *client, quint32 id, int version, QWaylandCompositor *compositor);
- virtual ~QWaylandSurface();
+ QWaylandSurface(QtWayland::Surface *surface = 0);
WaylandClient *client() const;
QWaylandSurface *parentSurface() const;
QLinkedList<QWaylandSurface *> subSurfaces() const;
- void addInterface(QWaylandSurfaceInterface *interface);
- void removeInterface(QWaylandSurfaceInterface *interface);
Type type() const;
bool isYInverted() const;
@@ -133,6 +122,8 @@
bool visible() const;
bool isMapped() const;
+ QPointF pos() const;
+ void setPos(const QPointF &pos);
QSize size() const;
Q_INVOKABLE void requestSize(const QSize &size);
@@ -143,61 +134,64 @@
WindowType windowType() const;
+ QImage image() const;
+#ifdef QT_COMPOSITOR_WAYLAND_GL
+ GLuint texture() const;
+#else
+ uint texture() const;
+#endif
+
QWindow::Visibility visibility() const;
void setVisibility(QWindow::Visibility visibility);
Q_INVOKABLE void sendOnScreenVisibilityChange(bool visible); // Compat
QWaylandSurface *transientParent() const;
- QPointF transientOffset() const;
+ QtWayland::Surface *handle() const;
+
+#ifdef QT_COMPOSITOR_QUICK
+ QWaylandSurfaceItem *surfaceItem() const;
+ void setSurfaceItem(QWaylandSurfaceItem *surfaceItem);
- QtWayland::Surface *handle();
+ QObject *windowPropertyMap() const;
+#endif
qint64 processId() const;
QByteArray authenticationToken() const;
QVariantMap windowProperties() const;
void setWindowProperty(const QString &name, const QVariant &value);
+ QPointF mapToParent(const QPointF &) const;
+ QPointF mapTo(QWaylandSurface *, const QPointF &) const;
+
QWaylandCompositor *compositor() const;
QString className() const;
QString title() const;
+ bool hasShellSurface() const;
bool hasInputPanelSurface() const;
bool transientInactive() const;
- Q_INVOKABLE void destroy();
Q_INVOKABLE void destroySurface();
Q_INVOKABLE void destroySurfaceByForce();
Q_INVOKABLE void ping();
- void ref();
- void setMapped(bool mapped);
-
- void setBufferAttacher(QWaylandBufferAttacher *attacher);
- QWaylandBufferAttacher *bufferAttacher() const;
-
- QList<QWaylandSurfaceView *> views() const;
- QList<QWaylandSurfaceInterface *> interfaces() const;
-
- bool sendInterfaceOp(QWaylandSurfaceOp &op);
-
- static QWaylandSurface *fromResource(::wl_resource *resource);
+ void swapBuffers();
public slots:
void updateSelection();
-protected:
- QWaylandSurface(QWaylandSurfacePrivate *dptr);
-
-Q_SIGNALS:
+signals:
void mapped();
void unmapped();
void damaged(const QRegion &rect);
+ void committed();
void parentChanged(QWaylandSurface *newParent, QWaylandSurface *oldParent);
void sizeChanged();
+ void posChanged();
void windowPropertyChanged(const QString &name, const QVariant &value);
void windowFlagsChanged(WindowFlags flags);
void windowTypeChanged(WindowType type);
@@ -210,13 +204,6 @@
void lowerRequested();
void visibilityChanged();
void pong();
- void surfaceDestroyed();
-
- void configure(bool hasBuffer);
- void redraw();
-
- friend class QWaylandSurfaceView;
- friend class QWaylandSurfaceInterface;
};
QT_END_NAMESPACE
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/compositor/compositor_api/qwaylandsurface_p.h
^
|
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Jolla Ltd, author: <giulio.camuffo@jollamobile.com>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDSURFACE_P_H
-#define QWAYLANDSURFACE_P_H
-
-#include <QtCompositor/qwaylandexport.h>
-#include <private/qobject_p.h>
-
-#include <QtCompositor/private/qwlsurface_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class QWaylandCompositor;
-class QWaylandSurface;
-class QWaylandSurfaceView;
-class QWaylandSurfaceInterface;
-
-class Q_COMPOSITOR_EXPORT QWaylandSurfacePrivate : public QObjectPrivate, public QtWayland::Surface
-{
- Q_DECLARE_PUBLIC(QWaylandSurface)
-public:
- QWaylandSurfacePrivate(wl_client *client, quint32 id, int version, QWaylandCompositor *compositor, QWaylandSurface *surface);
- void setType(QWaylandSurface::WindowType type);
- void setTitle(const QString &title);
- void setClassName(const QString &className);
-
- bool closing;
- int refCount;
- QWaylandSurface::WindowType windowType;
- QList<QWaylandSurfaceView *> views;
- QList<QWaylandSurfaceInterface *> interfaces;
-};
-
-QT_END_NAMESPACE
-
-#endif
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/compositor/compositor_api/qwaylandsurfaceinterface.cpp
^
|
@@ -1,137 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Jolla Ltd, author: <giulio.camuffo@jollamobile.com>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the Qt Compositor.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <wayland-server.h>
-
-#include "qwaylandsurfaceinterface.h"
-#include "qwaylandsurface.h"
-#include "qwaylandsurface_p.h"
-
-class QWaylandSurfaceInterface::Private
-{
-public:
- QWaylandSurface *surface;
-};
-
-QWaylandSurfaceInterface::QWaylandSurfaceInterface(QWaylandSurface *surface)
- : d(new Private)
-{
- d->surface = surface;
- surface->addInterface(this);
-}
-
-QWaylandSurfaceInterface::~QWaylandSurfaceInterface()
-{
- d->surface->removeInterface(this);
-}
-
-QWaylandSurface *QWaylandSurfaceInterface::surface() const
-{
- return d->surface;
-}
-
-void QWaylandSurfaceInterface::setSurfaceType(QWaylandSurface::WindowType type)
-{
- surface()->d_func()->setType(type);
-}
-
-void QWaylandSurfaceInterface::setSurfaceClassName(const QString &name)
-{
- surface()->d_func()->setClassName(name);
-}
-
-void QWaylandSurfaceInterface::setSurfaceTitle(const QString &title)
-{
- surface()->d_func()->setTitle(title);
-}
-
-
-
-class QWaylandSurfaceOp::Private
-{
-public:
- int type;
-};
-
-QWaylandSurfaceOp::QWaylandSurfaceOp(int t)
- : d(new Private)
-{
- d->type = t;
-}
-
-int QWaylandSurfaceOp::type() const
-{
- return d->type;
-}
-
-
-
-QWaylandSurfaceSetVisibilityOp::QWaylandSurfaceSetVisibilityOp(QWindow::Visibility visibility)
- : QWaylandSurfaceOp(Type::SetVisibility)
- , m_visibility(visibility)
-{
-}
-
-QWindow::Visibility QWaylandSurfaceSetVisibilityOp::visibility() const
-{
- return m_visibility;
-}
-
-QWaylandSurfaceResizeOp::QWaylandSurfaceResizeOp(const QSize &size)
- : QWaylandSurfaceOp(Type::Resize)
- , m_size(size)
-{
-}
-
-QSize QWaylandSurfaceResizeOp::size() const
-{
- return m_size;
-}
-
-QWaylandSurfacePingOp::QWaylandSurfacePingOp(uint32_t serial)
- : QWaylandSurfaceOp(Type::Ping)
- , m_serial(serial)
-{
-}
-
-uint32_t QWaylandSurfacePingOp::serial() const
-{
- return m_serial;
-}
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/compositor/compositor_api/qwaylandsurfaceinterface.h
^
|
@@ -1,125 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Jolla Ltd, author: <giulio.camuffo@jollamobile.com>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the Qt Compositor.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDSURFACEINTERFACE_H
-#define QWAYLANDSURFACEINTERFACE_H
-
-#include <QWindow>
-
-#include <QtCompositor/qwaylandsurface.h>
-#include <QtCompositor/qwaylandexport.h>
-
-QT_BEGIN_NAMESPACE
-
-class QWaylandSurface;
-
-class Q_COMPOSITOR_EXPORT QWaylandSurfaceOp
-{
-public:
- enum Type {
- Close,
- SetVisibility,
- Resize,
- Ping,
- UserType = 1000
- };
-
- QWaylandSurfaceOp(int t);
- int type() const;
-
-private:
- class Private;
- Private *const d;
-};
-
-class Q_COMPOSITOR_EXPORT QWaylandSurfaceSetVisibilityOp : public QWaylandSurfaceOp
-{
-public:
- QWaylandSurfaceSetVisibilityOp(QWindow::Visibility visibility);
- QWindow::Visibility visibility() const;
-
-private:
- QWindow::Visibility m_visibility;
-};
-
-class Q_COMPOSITOR_EXPORT QWaylandSurfaceResizeOp : public QWaylandSurfaceOp
-{
-public:
- QWaylandSurfaceResizeOp(const QSize &size);
- QSize size() const;
-
-private:
- QSize m_size;
-};
-
-class Q_COMPOSITOR_EXPORT QWaylandSurfacePingOp : public QWaylandSurfaceOp
-{
-public:
- QWaylandSurfacePingOp(quint32 serial);
- quint32 serial() const;
-
-private:
- quint32 m_serial;
-};
-
-class Q_COMPOSITOR_EXPORT QWaylandSurfaceInterface
-{
-public:
- QWaylandSurfaceInterface(QWaylandSurface *surf);
- virtual ~QWaylandSurfaceInterface();
-
- QWaylandSurface *surface() const;
-
-protected:
- virtual bool runOperation(QWaylandSurfaceOp *op) = 0;
-
- void setSurfaceType(QWaylandSurface::WindowType type);
- void setSurfaceClassName(const QString &name);
- void setSurfaceTitle(const QString &title);
-
-private:
- class Private;
- Private *const d;
- friend class QWaylandSurface;
-};
-
-QT_END_NAMESPACE
-
-#endif
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/compositor_api/qwaylandsurfaceitem.cpp
^
|
@@ -39,9 +39,12 @@
****************************************************************************/
#include "qwaylandsurfaceitem.h"
-#include "qwaylandquicksurface.h"
-#include <QtCompositor/qwaylandcompositor.h>
-#include <QtCompositor/qwaylandinput.h>
+#include "qwaylandsurface.h"
+#include "qwaylandcompositor.h"
+#include "qwaylandinput.h"
+
+#include "qwlsurface_p.h"
+#include "qwlextendedsurface_p.h"
#include <QtGui/QKeyEvent>
#include <QtGui/QGuiApplication>
@@ -55,15 +58,15 @@
QT_BEGIN_NAMESPACE
-QMutex *QWaylandSurfaceItem::mutex = 0;
-
class QWaylandSurfaceTextureProvider : public QSGTextureProvider
{
+ Q_OBJECT
+
public:
QWaylandSurfaceTextureProvider() : t(0) { }
+ ~QWaylandSurfaceTextureProvider() { delete t; }
- QSGTexture *texture() const Q_DECL_OVERRIDE
- {
+ QSGTexture *texture() const {
if (t)
t->setFiltering(smooth ? QSGTexture::Linear : QSGTexture::Nearest);
return t;
@@ -71,160 +74,186 @@
bool smooth;
QSGTexture *t;
+
+public slots:
+ void invalidate()
+ {
+ delete t;
+ t = 0;
+ }
};
-QWaylandSurfaceItem::QWaylandSurfaceItem(QWaylandQuickSurface *surface, QQuickItem *parent)
+QMutex *QWaylandSurfaceItem::mutex = 0;
+
+QWaylandSurfaceItem::QWaylandSurfaceItem(QQuickItem *parent)
: QQuickItem(parent)
- , QWaylandSurfaceView(surface)
+ , m_surface(0)
, m_provider(0)
, m_paintEnabled(true)
+ , m_useTextureAlpha(false)
+ , m_clientRenderingEnabled(true)
, m_touchEventsEnabled(false)
, m_resizeSurfaceToItem(false)
- , m_newTexture(false)
-
{
if (!mutex)
mutex = new QMutex;
+}
- setFlag(ItemHasContents);
+QWaylandSurfaceItem::QWaylandSurfaceItem(QWaylandSurface *surface, QQuickItem *parent)
+ : QQuickItem(parent)
+ , m_surface(0)
+ , m_provider(0)
+ , m_paintEnabled(true)
+ , m_useTextureAlpha(false)
+ , m_clientRenderingEnabled(true)
+ , m_touchEventsEnabled(false)
+ , m_resizeSurfaceToItem(false)
+{
+ init(surface);
+}
- update();
+void QWaylandSurfaceItem::init(QWaylandSurface *surface)
+{
+ if (!surface)
+ return;
+
+ if (m_surface) {
+ m_surface->setSurfaceItem(0);
+ }
- if (surface) {
+ m_surface = surface;
+ m_surface->setSurfaceItem(this);
+
+ if (m_resizeSurfaceToItem) {
+ updateSurfaceSize();
+ } else {
setWidth(surface->size().width());
setHeight(surface->size().height());
}
- setSmooth(true);
+ updatePosition();
+ setSmooth(true);
+ setFlag(ItemHasContents);
setAcceptedMouseButtons(Qt::LeftButton | Qt::MiddleButton | Qt::RightButton |
Qt::ExtraButton1 | Qt::ExtraButton2 | Qt::ExtraButton3 | Qt::ExtraButton4 |
Qt::ExtraButton5 | Qt::ExtraButton6 | Qt::ExtraButton7 | Qt::ExtraButton8 |
Qt::ExtraButton9 | Qt::ExtraButton10 | Qt::ExtraButton11 |
Qt::ExtraButton12 | Qt::ExtraButton13);
setAcceptHoverEvents(true);
- if (surface) {
- connect(surface, &QWaylandSurface::mapped, this, &QWaylandSurfaceItem::surfaceMapped);
- connect(surface, &QWaylandSurface::unmapped, this, &QWaylandSurfaceItem::surfaceUnmapped);
- connect(surface, &QWaylandSurface::surfaceDestroyed, this, &QWaylandSurfaceItem::surfaceDestroyed);
- connect(surface, &QWaylandSurface::parentChanged, this, &QWaylandSurfaceItem::parentChanged);
- connect(surface, &QWaylandSurface::sizeChanged, this, &QWaylandSurfaceItem::updateSize);
- connect(surface, &QWaylandSurface::configure, this, &QWaylandSurfaceItem::updateBuffer);
- connect(surface, &QWaylandSurface::redraw, this, &QQuickItem::update);
- }
+ connect(surface, &QWaylandSurface::mapped, this, &QWaylandSurfaceItem::surfaceMapped);
+ connect(surface, &QWaylandSurface::unmapped, this, &QWaylandSurfaceItem::surfaceUnmapped);
+ connect(surface, &QWaylandSurface::destroyed, this, &QWaylandSurfaceItem::surfaceDestroyed);
+ connect(surface, &QWaylandSurface::damaged, this, &QWaylandSurfaceItem::surfaceDamaged);
+ connect(surface, &QWaylandSurface::committed, this, &QQuickItem::update);
+ connect(surface, &QWaylandSurface::parentChanged, this, &QWaylandSurfaceItem::parentChanged);
+ connect(surface, &QWaylandSurface::sizeChanged, this, &QWaylandSurfaceItem::updateSize);
+ connect(surface, &QWaylandSurface::posChanged, this, &QWaylandSurfaceItem::updatePosition);
connect(this, &QWaylandSurfaceItem::widthChanged, this, &QWaylandSurfaceItem::updateSurfaceSize);
connect(this, &QWaylandSurfaceItem::heightChanged, this, &QWaylandSurfaceItem::updateSurfaceSize);
-
+ m_damaged = false;
m_yInverted = surface ? surface->isYInverted() : true;
- emit yInvertedChanged();
}
QWaylandSurfaceItem::~QWaylandSurfaceItem()
{
QMutexLocker locker(mutex);
+ if (m_surface)
+ m_surface->setSurfaceItem(0);
if (m_provider)
m_provider->deleteLater();
}
-bool QWaylandSurfaceItem::isYInverted() const
+void QWaylandSurfaceItem::setSurface(QWaylandSurface *surface)
{
- return m_yInverted;
-}
+ if (surface == m_surface)
+ return;
-QSGTextureProvider *QWaylandSurfaceItem::textureProvider() const
-{
- if (!m_provider)
- m_provider = new QWaylandSurfaceTextureProvider();
- return m_provider;
+ init(surface);
+ emit surfaceChanged();
}
-void QWaylandSurfaceItem::mousePressEvent(QMouseEvent *event)
+bool QWaylandSurfaceItem::isYInverted() const
{
- if (!surface())
- return;
-
- QWaylandInputDevice *inputDevice = compositor()->defaultInputDevice();
- if (inputDevice->mouseFocus() != this)
- inputDevice->setMouseFocus(this, event->localPos(), event->windowPos());
- inputDevice->sendMousePressEvent(event->button(), event->localPos(), event->windowPos());
+ return m_yInverted;
}
-void QWaylandSurfaceItem::mouseMoveEvent(QMouseEvent *event)
+QSGTextureProvider *QWaylandSurfaceItem::textureProvider() const
{
- if (surface()) {
- QWaylandInputDevice *inputDevice = compositor()->defaultInputDevice();
- inputDevice->sendMouseMoveEvent(this, event->localPos(), event->windowPos());
- }
+ const_cast<QWaylandSurfaceItem *>(this)->ensureProvider();
+ return m_provider;
}
-void QWaylandSurfaceItem::mouseReleaseEvent(QMouseEvent *event)
+void QWaylandSurfaceItem::ensureProvider()
{
- if (surface()) {
- QWaylandInputDevice *inputDevice = compositor()->defaultInputDevice();
- inputDevice->sendMouseReleaseEvent(event->button(), event->localPos(), event->windowPos());
+ if (!m_provider) {
+ m_provider = new QWaylandSurfaceTextureProvider();
+ connect(window(), &QQuickWindow::sceneGraphInvalidated, m_provider, &QWaylandSurfaceTextureProvider::invalidate, Qt::DirectConnection);
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/compositor_api/qwaylandsurfaceitem.h
^
|
@@ -42,58 +42,61 @@
#define QWAYLANDSURFACEITEM_H
#include <QtCompositor/qwaylandexport.h>
+#include <QtCompositor/qwaylandsurface.h>
#include <QtQuick/QQuickItem>
#include <QtQuick/qsgtexture.h>
#include <QtQuick/qsgtextureprovider.h>
-#include <QtCompositor/qwaylandsurfaceview.h>
-#include <QtCompositor/qwaylandquicksurface.h>
-
-Q_DECLARE_METATYPE(QWaylandQuickSurface*)
-
QT_BEGIN_NAMESPACE
class QWaylandSurfaceTextureProvider;
class QMutex;
-class Q_COMPOSITOR_EXPORT QWaylandSurfaceItem : public QQuickItem, public QWaylandSurfaceView
+Q_DECLARE_METATYPE(QWaylandSurface*)
+
+class Q_COMPOSITOR_EXPORT QWaylandSurfaceItem : public QQuickItem
{
Q_OBJECT
- Q_PROPERTY(QWaylandSurface* surface READ surface CONSTANT)
+ Q_PROPERTY(QWaylandSurface* surface READ surface WRITE setSurface NOTIFY surfaceChanged)
Q_PROPERTY(bool paintEnabled READ paintEnabled WRITE setPaintEnabled)
+ Q_PROPERTY(bool useTextureAlpha READ useTextureAlpha WRITE setUseTextureAlpha NOTIFY useTextureAlphaChanged)
+ Q_PROPERTY(bool clientRenderingEnabled READ clientRenderingEnabled WRITE setClientRenderingEnabled NOTIFY clientRenderingEnabledChanged)
Q_PROPERTY(bool touchEventsEnabled READ touchEventsEnabled WRITE setTouchEventsEnabled NOTIFY touchEventsEnabledChanged)
Q_PROPERTY(bool isYInverted READ isYInverted NOTIFY yInvertedChanged)
Q_PROPERTY(bool resizeSurfaceToItem READ resizeSurfaceToItem WRITE setResizeSurfaceToItem NOTIFY resizeSurfaceToItemChanged)
public:
- QWaylandSurfaceItem(QWaylandQuickSurface *surface, QQuickItem *parent = 0);
+ QWaylandSurfaceItem(QQuickItem *parent = 0);
+ QWaylandSurfaceItem(QWaylandSurface *surface, QQuickItem *parent = 0);
~QWaylandSurfaceItem();
+ void setSurface(QWaylandSurface *surface);
+ QWaylandSurface *surface() const {return m_surface; }
+
Q_INVOKABLE bool isYInverted() const;
bool isTextureProvider() const { return true; }
QSGTextureProvider *textureProvider() const;
bool paintEnabled() const;
+ bool useTextureAlpha() const { return m_useTextureAlpha; }
+ bool clientRenderingEnabled() const { return m_clientRenderingEnabled; }
bool touchEventsEnabled() const { return m_touchEventsEnabled; }
bool resizeSurfaceToItem() const { return m_resizeSurfaceToItem; }
- void updateTexture();
+ void setUseTextureAlpha(bool useTextureAlpha);
+ void setClientRenderingEnabled(bool enabled);
void setTouchEventsEnabled(bool enabled);
void setResizeSurfaceToItem(bool enabled);
- void setPos(const QPointF &pos) Q_DECL_OVERRIDE;
- QPointF pos() const Q_DECL_OVERRIDE;
+ void setDamagedFlag(bool on);
protected:
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
- void hoverEnterEvent(QHoverEvent *event);
- void hoverMoveEvent(QHoverEvent *event);
- void hoverLeaveEvent(QHoverEvent *event);
void wheelEvent(QWheelEvent *event);
void keyPressEvent(QKeyEvent *event);
@@ -108,32 +111,42 @@
private slots:
void surfaceMapped();
void surfaceUnmapped();
+ void surfaceDestroyed(QObject *object);
+ void surfaceDamaged(const QRegion &);
void parentChanged(QWaylandSurface *newParent, QWaylandSurface *oldParent);
void updateSize();
void updateSurfaceSize();
- void updateBuffer(bool hasBuffer);
+ void updatePosition();
-Q_SIGNALS:
+signals:
+ void textureChanged();
+ void useTextureAlphaChanged();
+ void clientRenderingEnabledChanged();
void touchEventsEnabledChanged();
void yInvertedChanged();
+ void surfaceChanged();
void resizeSurfaceToItemChanged();
- void surfaceDestroyed();
protected:
QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *);
private:
friend class QWaylandSurfaceNode;
- void init(QWaylandQuickSurface *);
+ void updateTexture();
+ void init(QWaylandSurface *);
+ void ensureProvider();
static QMutex *mutex;
- mutable QWaylandSurfaceTextureProvider *m_provider;
+ QWaylandSurface *m_surface;
+ QWaylandSurfaceTextureProvider *m_provider;
bool m_paintEnabled;
+ bool m_useTextureAlpha;
+ bool m_clientRenderingEnabled;
bool m_touchEventsEnabled;
+ bool m_damaged;
bool m_yInverted;
bool m_resizeSurfaceToItem;
- bool m_newTexture;
};
QT_END_NAMESPACE
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/compositor/compositor_api/qwaylandsurfaceview.cpp
^
|
@@ -1,94 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Jolla Ltd, author: <giulio.camuffo@jollamobile.com>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwaylandsurfaceview.h"
-#include "qwaylandsurface.h"
-#include "qwaylandsurface_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QWaylandSurfaceViewPrivate
-{
-public:
- QWaylandSurface *surface;
- QPointF pos;
-};
-
-QWaylandSurfaceView::QWaylandSurfaceView(QWaylandSurface *surf)
- : d(new QWaylandSurfaceViewPrivate)
-{
- d->surface = surf;
- if (surf) {
- surf->d_func()->views << this;
- surf->ref();
- }
-}
-
-QWaylandSurfaceView::~QWaylandSurfaceView()
-{
- if (d->surface) {
- d->surface->destroy();
- d->surface->d_func()->views.removeOne(this);
- }
- delete d;
-}
-
-QWaylandSurface *QWaylandSurfaceView::surface() const
-{
- return d->surface;
-}
-
-QWaylandCompositor *QWaylandSurfaceView::compositor() const
-{
- return d->surface ? d->surface->compositor() : 0;
-}
-
-void QWaylandSurfaceView::setPos(const QPointF &pos)
-{
- d->pos = pos;
-}
-
-QPointF QWaylandSurfaceView::pos() const
-{
- return d->pos;
-}
-
-QT_END_NAMESPACE
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/compositor/compositor_api/qwaylandsurfaceview.h
^
|
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Jolla Ltd, author: <giulio.camuffo@jollamobile.com>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDSURFACEVIEW_H
-#define QWAYLANDSURFACEVIEW_H
-
-#include <QPointF>
-
-#include <QtCompositor/qwaylandexport.h>
-
-QT_BEGIN_NAMESPACE
-
-class QWaylandSurface;
-class QWaylandCompositor;
-
-class Q_COMPOSITOR_EXPORT QWaylandSurfaceView
-{
-public:
- QWaylandSurfaceView(QWaylandSurface *surface);
- virtual ~QWaylandSurfaceView();
-
- QWaylandCompositor *compositor() const;
- QWaylandSurface *surface() const;
-
- virtual void setPos(const QPointF &pos);
- virtual QPointF pos() const;
-
-private:
- class QWaylandSurfaceViewPrivate *const d;
- friend class QWaylandSurfaceViewPrivate;
-};
-
-QT_END_NAMESPACE
-
-#endif
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/global/global.pri
^
|
@@ -1,5 +1,9 @@
INCLUDEPATH += global/
HEADERS += \
- global/qwaylandexport.h
+ global/qwaylandexport.h \
+ global/qwaylandresourcecollection.h
+
+SOURCES += \
+ global/qwaylandresourcecollection.cpp
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/global/qwaylandexport.h
^
|
@@ -46,10 +46,8 @@
QT_BEGIN_NAMESPACE
#if !defined(Q_COMPOSITOR_EXPORT)
-# if defined(QT_SHARED) && defined(QT_BUILD_COMPOSITOR_LIB)
+# if defined(QT_SHARED)
# define Q_COMPOSITOR_EXPORT Q_DECL_EXPORT
-# elif defined(QT_SHARED)
-# define Q_COMPOSITOR_EXPORT Q_DECL_IMPORT
# else
# define Q_COMPOSITOR_EXPORT
# endif
|
[-]
[+]
|
Added |
qtwayland.tar.bz2/src/compositor/global/qwaylandresourcecollection.cpp
^
|
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Compositor.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qwaylandresourcecollection.h"
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace QtWayland {
+
+struct wl_resource *resourceForClient(const struct wl_list *list, struct wl_client *client)
+{
+ struct wl_resource *resource;
+ wl_list_for_each(resource, list, link) {
+ if (resource->client == client) {
+ return resource;
+ }
+ }
+ return 0;
+}
+
+ResourceCollection::ResourceCollection()
+{
+ wl_list_init(&client_resources);
+}
+
+ResourceCollection::~ResourceCollection()
+{
+
+}
+
+void ResourceCollection::registerResource(struct wl_resource *resource)
+{
+ wl_list_insert(&client_resources,&resource->link);
+ struct wl_listener *listener = new struct wl_listener;
+ listener->notify = ResourceCollection::destroy_listener_notify;
+ wl_signal_add(&resource->destroy_signal, listener);
+}
+
+struct wl_resource *ResourceCollection::resourceForClient(wl_client *client) const
+{
+ return QtWayland::resourceForClient(&client_resources, client);
+}
+
+bool ResourceCollection::resourceListIsEmpty() const
+{
+ return wl_list_empty(const_cast<struct wl_list *>(&client_resources));
+}
+
+void ResourceCollection::destroy_listener_notify(struct wl_listener *listener, void *data)
+{
+ struct wl_resource *resource = reinterpret_cast<struct wl_resource *>(data);
+ wl_list_remove(&resource->link);
+ delete listener;
+}
+
+}
+
+QT_END_NAMESPACE
|
[-]
[+]
|
Added |
qtwayland.tar.bz2/src/compositor/global/qwaylandresourcecollection.h
^
|
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Compositor.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef WAYLAND_RESOURCE_OBJECT_H
+#define WAYLAND_RESOURCE_OBJECT_H
+
+#include <wayland-server.h>
+
+#include <QtCompositor/qwaylandexport.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace QtWayland {
+
+struct wl_resource *resourceForClient(const struct wl_list *list, struct wl_client *client);
+
+class ResourceCollection
+{
+public:
+ ResourceCollection();
+ virtual ~ResourceCollection();
+ void registerResource(struct wl_resource *resource);
+ struct wl_resource *resourceForClient(struct wl_client *client) const;
+ bool resourceListIsEmpty() const;
+
+protected:
+ struct wl_list client_resources;
+private:
+ static void destroy_listener_notify(struct wl_listener *listener, void *data);
+};
+
+}
+
+QT_END_NAMESPACE
+
+#endif //WAYLAND_RESOURCE_OBJECT_H
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/hardware_integration/qwlclientbufferintegration_p.h
^
|
@@ -74,8 +74,8 @@
virtual bool isYInverted(struct ::wl_resource *) const { return true; }
- virtual void *lockNativeBuffer(struct ::wl_resource *) const { return 0; }
- virtual void unlockNativeBuffer(void *) const { return; }
+ virtual void *lockNativeBuffer(struct ::wl_resource *, QOpenGLContext *) const { return 0; }
+ virtual void unlockNativeBuffer(void *, QOpenGLContext *) const { return; }
virtual QSize bufferSize(struct ::wl_resource *) const { return QSize(); }
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/hardware_integration/qwlclientbufferintegrationfactory.cpp
^
|
@@ -52,7 +52,7 @@
#ifndef QT_NO_LIBRARY
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
- (QtWaylandClientBufferIntegrationFactoryInterface_iid, QLatin1String("/wayland-graphics-integration-server"), Qt::CaseInsensitive))
+ (QtWaylandClientBufferIntegrationFactoryInterface_iid, QLatin1String("/wayland-graphics-integration/server"), Qt::CaseInsensitive))
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
(QtWaylandClientBufferIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive))
#endif
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/hardware_integration/qwlhwintegration.cpp
^
|
@@ -47,7 +47,7 @@
namespace QtWayland {
HardwareIntegration::HardwareIntegration(Compositor *compositor)
- : qt_hardware_integration(compositor->wl_display(), 1)
+ : qt_hardware_integration(compositor->wl_display())
{
}
void HardwareIntegration::setClientBufferIntegration(const QString &name)
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/hardware_integration/qwlserverbufferintegration_p.h
^
|
@@ -47,13 +47,12 @@
#include <QtCompositor/qwaylandexport.h>
-struct wl_client;
-struct wl_resource;
-
QT_BEGIN_NAMESPACE
class QWaylandCompositor;
class QOpenGLContext;
+struct wl_client;
+struct wl_resource;
namespace QtWayland {
class Display;
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/hardware_integration/qwlserverbufferintegrationfactory.cpp
^
|
@@ -52,7 +52,7 @@
#ifndef QT_NO_LIBRARY
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
- (QtWaylandServerBufferIntegrationFactoryInterface_iid, QLatin1String("/wayland-graphics-integration-server"), Qt::CaseInsensitive))
+ (QtWaylandServerBufferIntegrationFactoryInterface_iid, QLatin1String("/wayland-graphics-integration/server"), Qt::CaseInsensitive))
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
(QtWaylandServerBufferIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive))
#endif
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlcompositor.cpp
^
|
@@ -58,8 +58,6 @@
#include "qwlregion_p.h"
#include "qwlpointer_p.h"
#include "qwltextinputmanager_p.h"
-#include "qwaylandglobalinterface.h"
-#include "qwaylandsurfaceview.h"
#include <QWindow>
#include <QSocketNotifier>
@@ -71,6 +69,10 @@
#include <QtCore/QAbstractEventDispatcher>
#include <QtGui/private/qguiapplication_p.h>
+#ifdef QT_COMPOSITOR_QUICK
+#include <QtQuick/QQuickWindow>
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -88,7 +90,7 @@
#include "hardware_integration/qwlhwintegration_p.h"
#include "hardware_integration/qwlclientbufferintegration_p.h"
#include "hardware_integration/qwlserverbufferintegration_p.h"
-#include "windowmanagerprotocol/waylandwindowmanagerintegration_p.h"
+#include "waylandwindowmanagerintegration.h"
#include "hardware_integration/qwlclientbufferintegrationfactory_p.h"
#include "hardware_integration/qwlserverbufferintegrationfactory_p.h"
@@ -129,17 +131,8 @@
{
m_timer.start();
compositor = this;
-}
-void Compositor::init()
-{
- QStringList arguments = QCoreApplication::instance()->arguments();
-
- int socketArg = arguments.indexOf(QLatin1String("--wayland-socket-name"));
- if (socketArg != -1 && socketArg + 1 < arguments.size())
- m_socket_name = arguments.at(socketArg + 1).toLocal8Bit();
-
- wl_compositor::init(m_display->handle(), 3);
+ wl_compositor::init(m_display->handle());
m_data_device_manager = new DataDeviceManager(this);
@@ -147,7 +140,14 @@
m_output_global = new OutputGlobal(m_display->handle());
- if (wl_display_add_socket(m_display->handle(), m_qt_compositor->socketName())) {
+ m_shell = new Shell();
+ wl_global_create(m_display->handle(),
+ &wl_shell_interface,
+ wl_shell_interface.version,
+ m_shell,
+ Shell::bind_func);
+
+ if (wl_display_add_socket(m_display->handle(), qt_compositor->socketName())) {
fprintf(stderr, "Fatal: Failed to open server socket\n");
exit(EXIT_FAILURE);
}
@@ -163,20 +163,23 @@
connect(dispatcher, SIGNAL(aboutToBlock()), this, SLOT(processWaylandEvents()));
qRegisterMetaType<SurfaceBuffer*>("SurfaceBuffer*");
- qRegisterMetaType<QWaylandSurface*>("WaylandSurface*");
- qRegisterMetaType<QWaylandSurfaceView*>("WaylandSurfaceView*");
//initialize distancefieldglyphcache here
- initializeHardwareIntegration();
- initializeExtensions();
- initializeDefaultInputDevice();
+#ifdef QT_COMPOSITOR_QUICK
+ if (QQuickWindow *w = qobject_cast<QQuickWindow *>(qt_compositor->window())) {
+ connect(w, SIGNAL(beforeSynchronizing()), this, SLOT(cleanupGraphicsResources()), Qt::DirectConnection);
+ } else
+#endif
+ {
+#if !defined(QT_NO_DEBUG) && !defined(QT_WAYLAND_NO_CLEANUP_WARNING)
+ qWarning("QWaylandCompositor::cleanupGraphicsResources() must be called manually");
+#endif
+ }
}
Compositor::~Compositor()
{
- if (!m_destroyed_surfaces.isEmpty())
- qWarning("QWaylandCompositor::cleanupGraphicsResources() must be called manually");
-
+ delete m_shell;
delete m_outputExtension;
delete m_surfaceExtension;
delete m_subSurfaceExtension;
@@ -218,21 +221,25 @@
waylandCompositor()->surfaceAboutToBeDestroyed(surface->waylandSurface());
surface->releaseSurfaces();
- m_destroyed_surfaces << surface->waylandSurface();
+ m_destroyed_surfaces << surface;
}
void Compositor::cleanupGraphicsResources()
{
+ foreach (SurfaceBuffer *s, m_destroyed_buffers)
+ s->bufferWasDestroyed();
+ m_destroyed_buffers.clear();
+
qDeleteAll(m_destroyed_surfaces);
m_destroyed_surfaces.clear();
}
void Compositor::compositor_create_surface(Resource *resource, uint32_t id)
{
- QWaylandSurface *surface = new QWaylandSurface(resource->client(), id, resource->version(), m_qt_compositor);
- m_surfaces << surface->handle();
+ Surface *surface = new Surface(resource->client(), id, this);
+ m_surfaces << surface;
//BUG: This may not be an on-screen window surface though
- m_qt_compositor->surfaceCreated(surface);
+ m_qt_compositor->surfaceCreated(surface->waylandSurface());
}
void Compositor::compositor_create_region(Resource *resource, uint32_t id)
@@ -333,10 +340,26 @@
return list;
}
+Qt::ScreenOrientations Compositor::orientationUpdateMaskForClient(wl_client *client)
+{
+ Output *output = m_output_global->outputForClient(client);
+ Q_ASSERT(output);
+ if (output->extendedOutput)
+ return output->extendedOutput->orientationUpdateMask;
+ return 0;
+}
+
void Compositor::setScreenOrientation(Qt::ScreenOrientation orientation)
{
m_orientation = orientation;
- m_output_global->sendOutputOrientation(orientation);
+
+ QList<struct wl_client*> clientList = clients();
+ for (int i = 0; i < clientList.length(); ++i) {
+ struct wl_client *client = clientList.at(i);
+ Output *output = m_output_global->outputForClient(client);
+ if (output && output->extendedOutput)
+ output->extendedOutput->sendOutputOrientation(orientation);
+ }
}
Qt::ScreenOrientation Compositor::screenOrientation() const
@@ -398,6 +421,17 @@
return ret;
}
+Surface *Compositor::pickSurface(const QPointF &globalPosition)
+{
+ QWaylandSurface *surface = m_qt_compositor->pickSurface(globalPosition);
+ return surface ? surface->handle() : 0;
+}
+
+QPointF Compositor::mapToSurface(Surface *surface, const QPointF &globalPosition)
+{
+ return m_qt_compositor->mapToSurface(surface->waylandSurface(), globalPosition);
+}
+
void Compositor::configureTouchExtension(int flags)
{
if (m_touchExtension)
@@ -454,12 +488,6 @@
// Drag::instance()->dragEnd();
}
-void Compositor::bindGlobal(wl_client *client, void *data, uint32_t version, uint32_t id)
-{
- QWaylandGlobalInterface *iface = static_cast<QWaylandGlobalInterface *>(data);
- iface->bind(client, qMin(iface->version(), version), id);
-};
-
void Compositor::loadClientBufferIntegration()
{
QStringList keys = ClientBufferIntegrationFactory::keys();
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlcompositor_p.h
^
|
@@ -73,6 +73,7 @@
class OutputExtensionGlobal;
class SurfaceExtensionGlobal;
class SubSurfaceExtensionGlobal;
+class Shell;
class TouchExtensionGlobal;
class QtKeyExtensionGlobal;
class TextInputManager;
@@ -89,9 +90,7 @@
Compositor(QWaylandCompositor *qt_compositor, QWaylandCompositor::ExtensionFlags extensions);
~Compositor();
- void init();
void sendFrameCallbacks(QList<QWaylandSurface *> visibleSurfaces);
- void frameFinished(Surface *surface = 0);
InputDevice *defaultInputDevice(); //we just have 1 default device for now (since QPA doesn't give us anything else)
@@ -114,6 +113,9 @@
QList<Surface*> surfacesForClient(wl_client* client);
QWaylandCompositor *waylandCompositor() const { return m_qt_compositor; }
+ Surface *pickSurface(const QPointF &globalPosition);
+ QPointF mapToSurface(Surface *surface, const QPointF &globalPosition);
+
struct wl_display *wl_display() const { return m_display->handle(); }
Display *display() const { return m_display; }
@@ -130,6 +132,8 @@
void setOutputRefreshRate(int rate);
int outputRefreshRate() const;
+ Qt::ScreenOrientations orientationUpdateMaskForClient(wl_client *client);
+
void setClientFullScreenHint(bool value);
QWaylandCompositor::ExtensionFlags extensions() const;
@@ -152,7 +156,7 @@
void overrideSelection(const QMimeData *data);
void feedRetainedSelectionData(QMimeData *data);
- static void bindGlobal(wl_client *client, void *data, uint32_t version, uint32_t id);
+ void bufferWasDestroyed(SurfaceBuffer *buffer) { m_destroyed_buffers << buffer; }
public slots:
void cleanupGraphicsResources();
@@ -162,14 +166,13 @@
private slots:
void processWaylandEvents();
-protected:
+private:
void loadClientBufferIntegration();
void loadServerBufferIntegration();
QWaylandCompositor::ExtensionFlags m_extensions;
Display *m_display;
- QByteArray m_socket_name;
/* Input */
QWaylandInputDevice *m_default_wayland_input_device;
@@ -183,7 +186,8 @@
QElapsedTimer m_timer;
QList<Surface *> m_surfaces;
- QSet<QWaylandSurface *> m_destroyed_surfaces;
+ QSet<Surface *> m_destroyed_surfaces;
+ QSet<SurfaceBuffer *> m_destroyed_buffers;
/* Render state */
uint32_t m_current_frame;
@@ -203,6 +207,7 @@
//extensions
WindowManagerServerIntegration *m_windowManagerIntegration;
+ Shell *m_shell;
OutputExtensionGlobal *m_outputExtension;
SurfaceExtensionGlobal *m_surfaceExtension;
SubSurfaceExtensionGlobal *m_subSurfaceExtension;
@@ -210,14 +215,11 @@
QtKeyExtensionGlobal *m_qtkeyExtension;
QScopedPointer<TextInputManager> m_textInputManager;
QScopedPointer<InputPanel> m_inputPanel;
- QList<QWaylandGlobalInterface *> m_globals;
static void bind_func(struct wl_client *client, void *data,
uint32_t version, uint32_t id);
bool m_retainSelection;
-
- friend class QT_PREPEND_NAMESPACE(QWaylandCompositor);
};
}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwldatadevice.cpp
^
|
@@ -51,7 +51,6 @@
#include "qwldatadevicemanager_p.h"
#include "qwaylanddrag.h"
-#include "qwaylandsurfaceview.h"
#include <QDebug>
@@ -88,7 +87,7 @@
}
}
-void DataDevice::setDragFocus(QWaylandSurfaceView *focus, const QPointF &localPosition)
+void DataDevice::setDragFocus(Surface *focus, const QPointF &localPosition)
{
if (m_dragFocusResource) {
send_leave(m_dragFocusResource->handle);
@@ -99,10 +98,10 @@
if (!focus)
return;
- if (!m_dragDataSource && m_dragClient != focus->surface()->handle()->resource()->client())
+ if (!m_dragDataSource && m_dragClient != focus->resource()->client())
return;
- Resource *resource = resourceMap().value(focus->surface()->handle()->resource()->client());
+ Resource *resource = resourceMap().value(focus->resource()->client());
if (!resource)
return;
@@ -114,7 +113,7 @@
if (m_dragDataSource && !offer)
return;
- send_enter(resource->handle, serial, focus->surface()->handle()->resource()->handle,
+ send_enter(resource->handle, serial, focus->resource()->handle,
wl_fixed_from_double(localPosition.x()), wl_fixed_from_double(localPosition.y()),
offer->resource()->handle);
@@ -122,7 +121,7 @@
m_dragFocusResource = resource;
}
-QWaylandSurfaceView *DataDevice::dragIcon() const
+Surface *DataDevice::dragIcon() const
{
return m_dragIcon;
}
@@ -135,10 +134,10 @@
void DataDevice::focus()
{
- QWaylandSurfaceView *focus = m_compositor->waylandCompositor()->pickView(m_pointer->currentPosition());
+ Surface *focus = m_compositor->pickSurface(m_pointer->currentPosition());
if (focus != m_dragFocus)
- setDragFocus(focus, m_compositor->waylandCompositor()->mapToView(focus, m_pointer->currentPosition()));
+ setDragFocus(focus, m_compositor->mapToSurface(focus, m_pointer->currentPosition()));
}
void DataDevice::motion(uint32_t time)
@@ -148,7 +147,7 @@
}
if (m_dragFocusResource && m_dragFocus) {
- const QPointF &surfacePoint = m_compositor->waylandCompositor()->mapToView(m_dragFocus, m_pointer->currentPosition());
+ const QPointF &surfacePoint = m_compositor->mapToSurface(m_dragFocus, m_pointer->currentPosition());
qDebug() << Q_FUNC_INFO << m_pointer->currentPosition() << surfacePoint;
send_motion(m_dragFocusResource->handle, time,
wl_fixed_from_double(surfacePoint.x()), wl_fixed_from_double(surfacePoint.y()));
@@ -181,12 +180,12 @@
{
if (m_inputDevice->pointerDevice()->grabSerial() == serial) {
if (!m_inputDevice->pointerDevice()->buttonPressed() ||
- m_inputDevice->pointerDevice()->focusSurface()->surface()->handle() != Surface::fromResource(origin))
+ m_inputDevice->pointerDevice()->focusSurface() != Surface::fromResource(origin))
return;
m_dragClient = resource->client();
m_dragDataSource = source != 0 ? DataSource::fromResource(source) : 0;
- m_dragIcon = icon != 0 ? m_compositor->waylandCompositor()->createView(Surface::fromResource(icon)->waylandSurface()) : 0;
+ m_dragIcon = icon != 0 ? Surface::fromResource(icon) : 0;
Q_EMIT m_inputDevice->dragHandle()->iconChanged();
m_inputDevice->pointerDevice()->setFocus(0, QPointF());
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwldatadevice_p.h
^
|
@@ -46,8 +46,6 @@
QT_BEGIN_NAMESPACE
-class QWaylandSurfaceView;
-
namespace QtWayland {
class Compositor;
@@ -62,9 +60,9 @@
void setFocus(QtWaylandServer::wl_keyboard::Resource *focusResource);
- void setDragFocus(QWaylandSurfaceView *focus, const QPointF &localPosition);
+ void setDragFocus(Surface *focus, const QPointF &localPosition);
- QWaylandSurfaceView *dragIcon() const;
+ Surface *dragIcon() const;
void sourceDestroyed(DataSource *source);
@@ -84,10 +82,10 @@
struct ::wl_client *m_dragClient;
DataSource *m_dragDataSource;
- QWaylandSurfaceView *m_dragFocus;
+ Surface *m_dragFocus;
Resource *m_dragFocusResource;
- QWaylandSurfaceView *m_dragIcon;
+ Surface *m_dragIcon;
};
}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp
^
|
@@ -60,7 +60,7 @@
DataDeviceManager::DataDeviceManager(Compositor *compositor)
: QObject(0)
- , wl_data_device_manager(compositor->wl_display(), 1)
+ , wl_data_device_manager(compositor->wl_display())
, m_compositor(compositor)
, m_current_selection_source(0)
, m_retainedReadNotifier(0)
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwldataoffer.cpp
^
|
@@ -51,11 +51,11 @@
{
DataOffer::DataOffer(DataSource *dataSource, QtWaylandServer::wl_data_device::Resource *target)
- : QtWaylandServer::wl_data_offer(target->client(), 0, 1)
+ : QtWaylandServer::wl_data_offer(target->client(), 0)
, m_dataSource(dataSource)
{
// FIXME: connect to dataSource and reset m_dataSource on destroy
- target->data_device_object->send_data_offer(target->handle, resource()->handle);
+ target->data_device->send_data_offer(target->handle, resource()->handle);
Q_FOREACH (const QString &mimeType, dataSource->mimeTypes()) {
send_offer(mimeType);
}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwldataoffer_p.h
^
|
@@ -41,7 +41,6 @@
#ifndef WLDATAOFFER_H
#define WLDATAOFFER_H
-#include <QPointer>
#include <QtCompositor/private/qwayland-server-wayland.h>
QT_BEGIN_NAMESPACE
@@ -64,7 +63,7 @@
void data_offer_destroy_resource(Resource *resource) Q_DECL_OVERRIDE;
private:
- QPointer<DataSource> m_dataSource;
+ DataSource *m_dataSource;
};
}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwldatasource.cpp
^
|
@@ -52,7 +52,7 @@
namespace QtWayland {
DataSource::DataSource(struct wl_client *client, uint32_t id, uint32_t time)
- : QtWaylandServer::wl_data_source(client, id, 1)
+ : QtWaylandServer::wl_data_source(client, id)
, m_time(time)
, m_device(0)
, m_manager(0)
@@ -105,7 +105,7 @@
DataSource *DataSource::fromResource(struct ::wl_resource *resource)
{
- return static_cast<DataSource *>(Resource::fromResource(resource)->data_source_object);
+ return static_cast<DataSource *>(Resource::fromResource(resource)->data_source);
}
void DataSource::data_source_offer(Resource *, const QString &mime_type)
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwldatasource_p.h
^
|
@@ -42,7 +42,7 @@
#define WLDATASOURCE_H
#include <QtCompositor/private/qwayland-server-wayland.h>
-#include <QObject>
+
#include <QtCore/QList>
QT_BEGIN_NAMESPACE
@@ -53,7 +53,7 @@
class DataDevice;
class DataDeviceManager;
-class DataSource : public QObject, public QtWaylandServer::wl_data_source
+class DataSource : public QtWaylandServer::wl_data_source
{
public:
DataSource(struct wl_client *client, uint32_t id, uint32_t time);
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlextendedoutput.cpp
^
|
@@ -49,7 +49,7 @@
namespace QtWayland {
OutputExtensionGlobal::OutputExtensionGlobal(Compositor *compositor)
- : QtWaylandServer::qt_output_extension(compositor->wl_display(), 1)
+ : QtWaylandServer::qt_output_extension(compositor->wl_display())
, m_compositor(compositor)
{
}
@@ -59,11 +59,63 @@
Output *output = static_cast<Output *>(OutputGlobal::Resource::fromResource(output_resource));
Q_ASSERT(output->extendedOutput == 0);
- ExtendedOutput *extendedOutput = static_cast<ExtendedOutput *>(qt_extended_output::add(resource->client(), id, resource->version()));
+ ExtendedOutput *extendedOutput = static_cast<ExtendedOutput *>(qt_extended_output::add(resource->client(), id));
Q_ASSERT(!output->extendedOutput);
output->extendedOutput = extendedOutput;
extendedOutput->output = output;
+
+ extendedOutput->sendOutputOrientation(m_compositor->screenOrientation());
+}
+
+void OutputExtensionGlobal::extended_output_set_orientation_update_mask(qt_extended_output::Resource *resource,
+ int32_t orientation_update_mask)
+{
+ ExtendedOutput *output = static_cast<ExtendedOutput *>(resource);
+
+ Qt::ScreenOrientations mask = 0;
+ if (orientation_update_mask & QT_EXTENDED_OUTPUT_ROTATION_PORTRAITORIENTATION)
+ mask |= Qt::PortraitOrientation;
+ if (orientation_update_mask & QT_EXTENDED_OUTPUT_ROTATION_LANDSCAPEORIENTATION)
+ mask |= Qt::LandscapeOrientation;
+ if (orientation_update_mask & QT_EXTENDED_OUTPUT_ROTATION_INVERTEDPORTRAITORIENTATION)
+ mask |= Qt::InvertedPortraitOrientation;
+ if (orientation_update_mask & QT_EXTENDED_OUTPUT_ROTATION_INVERTEDLANDSCAPEORIENTATION)
+ mask |= Qt::InvertedLandscapeOrientation;
+
+ Qt::ScreenOrientations oldMask = output->orientationUpdateMask;
+ output->orientationUpdateMask = mask;
+
+ if (mask != oldMask) {
+ QList<Surface*> surfaces = m_compositor->surfacesForClient(resource->client());
+ foreach (Surface *surface, surfaces) {
+ if (surface->waylandSurface())
+ emit surface->waylandSurface()->orientationUpdateMaskChanged();
+ }
+ }
+}
+
+void ExtendedOutput::sendOutputOrientation(Qt::ScreenOrientation orientation)
+{
+ int sendOperation;
+ switch (orientation) {
+ case Qt::PortraitOrientation:
+ sendOperation = QT_EXTENDED_OUTPUT_ROTATION_PORTRAITORIENTATION;
+ break;
+ case Qt::LandscapeOrientation:
+ sendOperation = QT_EXTENDED_OUTPUT_ROTATION_LANDSCAPEORIENTATION;
+ break;
+ case Qt::InvertedPortraitOrientation:
+ sendOperation = QT_EXTENDED_OUTPUT_ROTATION_INVERTEDPORTRAITORIENTATION;
+ break;
+ case Qt::InvertedLandscapeOrientation:
+ sendOperation = QT_EXTENDED_OUTPUT_ROTATION_INVERTEDLANDSCAPEORIENTATION;
+ break;
+ default:
+ sendOperation = QT_EXTENDED_OUTPUT_ROTATION_PORTRAITORIENTATION;
+ }
+
+ extended_output->send_set_screen_rotation(handle, sendOperation);
}
}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlextendedoutput_p.h
^
|
@@ -61,7 +61,10 @@
public:
ExtendedOutput() : output(0) {}
+ void sendOutputOrientation(Qt::ScreenOrientation orientation);
+
Output *output;
+ Qt::ScreenOrientations orientationUpdateMask;
};
class OutputExtensionGlobal : public QtWaylandServer::qt_output_extension, public QtWaylandServer::qt_extended_output
@@ -74,6 +77,9 @@
qt_extended_output::Resource *extended_output_allocate() Q_DECL_OVERRIDE { return new ExtendedOutput; }
+ void extended_output_set_orientation_update_mask(qt_extended_output::Resource *resource,
+ int32_t orientation_update_mask) Q_DECL_OVERRIDE;
+
void output_extension_get_extended_output(qt_output_extension::Resource *resource,
uint32_t id,
struct wl_resource *output_resource) Q_DECL_OVERRIDE;
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlextendedsurface.cpp
^
|
@@ -48,7 +48,7 @@
namespace QtWayland {
SurfaceExtensionGlobal::SurfaceExtensionGlobal(Compositor *compositor)
- : QtWaylandServer::qt_surface_extension(compositor->wl_display(), 2)
+ : QtWaylandServer::qt_surface_extension(compositor->wl_display())
{
}
@@ -57,14 +57,15 @@
struct wl_resource *surface_resource)
{
Surface *surface = Surface::fromResource(surface_resource);
- new ExtendedSurface(resource->client(),id, wl_resource_get_version(resource->handle), surface);
+ new ExtendedSurface(resource->client(),id,surface);
}
-ExtendedSurface::ExtendedSurface(struct wl_client *client, uint32_t id, int version, Surface *surface)
- : QWaylandSurfaceInterface(surface->waylandSurface())
- , QtWaylandServer::qt_extended_surface(client, id, version)
+ExtendedSurface::ExtendedSurface(struct wl_client *client, uint32_t id, Surface *surface)
+ : QtWaylandServer::qt_extended_surface(client,id)
, m_surface(surface)
+ , m_contentOrientation(Qt::PrimaryOrientation)
, m_windowFlags(0)
+ , m_visibility(QWindow::Hidden)
{
Q_ASSERT(surface->extendedSurface() == 0);
surface->setExtendedSurface(this);
@@ -86,24 +87,15 @@
void ExtendedSurface::setVisibility(QWindow::Visibility visibility, bool updateClient)
{
+ if (visibility == m_visibility)
+ return;
+
+ m_visibility = visibility;
+ emit m_surface->waylandSurface()->visibilityChanged();
+
// If this change came from the client, we shouldn't update it
if (updateClient)
- send_onscreen_visibility(visibility);
-}
-
-bool ExtendedSurface::runOperation(QWaylandSurfaceOp *op)
-{
- switch (op->type()) {
- case QWaylandSurfaceOp::Close:
- send_close();
- return true;
- case QWaylandSurfaceOp::SetVisibility:
- setVisibility(static_cast<QWaylandSurfaceSetVisibilityOp *>(op)->visibility());
- return true;
- default:
- break;
- }
- return false;
+ send_onscreen_visibility(m_visibility);
}
void ExtendedSurface::extended_surface_update_generic_property(Resource *resource,
@@ -129,42 +121,20 @@
}
}
-Qt::ScreenOrientations ExtendedSurface::contentOrientationMask() const
+Qt::ScreenOrientation ExtendedSurface::contentOrientation() const
{
- return m_contentOrientationMask;
+ return m_contentOrientation;
}
void ExtendedSurface::extended_surface_set_content_orientation(Resource *resource, int32_t orientation)
{
Q_UNUSED(resource);
- Qt::ScreenOrientation oldOrientation = m_surface->m_contentOrientation;
- m_surface->m_contentOrientation = screenOrientationFromWaylandOrientation(orientation);
- if (m_surface->m_contentOrientation != oldOrientation)
+ Qt::ScreenOrientation oldOrientation = m_contentOrientation;
+ m_contentOrientation = screenOrientationFromWaylandOrientation(orientation);
+ if (m_contentOrientation != oldOrientation)
emit m_surface->waylandSurface()->contentOrientationChanged();
}
-void ExtendedSurface::extended_surface_set_content_orientation_mask(Resource *resource, int32_t orientation)
-{
- Q_UNUSED(resource);
- Qt::ScreenOrientations mask = 0;
- if (orientation & QT_EXTENDED_SURFACE_ORIENTATION_PORTRAITORIENTATION)
- mask |= Qt::PortraitOrientation;
- if (orientation & QT_EXTENDED_SURFACE_ORIENTATION_LANDSCAPEORIENTATION)
- mask |= Qt::LandscapeOrientation;
- if (orientation & QT_EXTENDED_SURFACE_ORIENTATION_INVERTEDPORTRAITORIENTATION)
- mask |= Qt::InvertedPortraitOrientation;
- if (orientation & QT_EXTENDED_SURFACE_ORIENTATION_INVERTEDLANDSCAPEORIENTATION)
- mask |= Qt::InvertedLandscapeOrientation;
- if (orientation & QT_EXTENDED_SURFACE_ORIENTATION_PRIMARYORIENTATION)
- mask |= Qt::PrimaryOrientation;
-
- Qt::ScreenOrientations oldMask = m_contentOrientationMask;
- m_contentOrientationMask = mask;
-
- if (mask != oldMask)
- emit m_surface->waylandSurface()->orientationUpdateMaskChanged();
-}
-
QVariantMap ExtendedSurface::windowProperties() const
{
return m_windowProperties;
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlextendedsurface_p.h
^
|
@@ -46,7 +46,6 @@
#include <QtCompositor/private/qwayland-server-surface-extension.h>
#include <private/qwlsurface_p.h>
#include <QtCompositor/qwaylandsurface.h>
-#include <QtCompositor/qwaylandsurfaceinterface.h>
#include <QtCore/QVariant>
#include <QtCore/QLinkedList>
@@ -72,14 +71,15 @@
};
-class ExtendedSurface : public QWaylandSurfaceInterface, public QtWaylandServer::qt_extended_surface
+class ExtendedSurface : public QtWaylandServer::qt_extended_surface
{
public:
- ExtendedSurface(struct wl_client *client, uint32_t id, int version, Surface *surface);
+ ExtendedSurface(struct wl_client *client, uint32_t id, Surface *surface);
~ExtendedSurface();
void sendGenericProperty(const QString &name, const QVariant &variant);
+ QWindow::Visibility visibility() const { return m_visibility; }
void setVisibility(QWindow::Visibility visibility, bool updateClient = true);
void setSubSurface(ExtendedSurface *subSurface,int x, int y);
@@ -88,7 +88,7 @@
void setParent(ExtendedSurface *parent);
QLinkedList<QWaylandSurface *> subSurfaces() const;
- Qt::ScreenOrientations contentOrientationMask() const;
+ Qt::ScreenOrientation contentOrientation() const;
QWaylandSurface::WindowFlags windowFlags() const { return m_windowFlags; }
@@ -96,15 +96,13 @@
QVariant windowProperty(const QString &propertyName) const;
void setWindowProperty(const QString &name, const QVariant &value, bool writeUpdateToClient = true);
-protected:
- bool runOperation(QWaylandSurfaceOp *op) Q_DECL_OVERRIDE;
-
private:
Surface *m_surface;
- Qt::ScreenOrientations m_contentOrientationMask;
+ Qt::ScreenOrientation m_contentOrientation;
QWaylandSurface::WindowFlags m_windowFlags;
+ QWindow::Visibility m_visibility;
QByteArray m_authenticationToken;
QVariantMap m_windowProperties;
@@ -112,10 +110,9 @@
void extended_surface_update_generic_property(Resource *resource,
const QString &name,
struct wl_array *value) Q_DECL_OVERRIDE;
+
void extended_surface_set_content_orientation(Resource *resource,
int32_t orientation) Q_DECL_OVERRIDE;
- void extended_surface_set_content_orientation_mask(Resource *resource,
- int32_t orientation) Q_DECL_OVERRIDE;
void extended_surface_set_window_flags(Resource *resource,
int32_t flags) Q_DECL_OVERRIDE;
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlinputdevice.cpp
^
|
@@ -51,7 +51,6 @@
#include "qwlpointer_p.h"
#include "qwlkeyboard_p.h"
#include "qwltouch_p.h"
-#include "qwaylandsurfaceview.h"
#include <QtGui/QTouchEvent>
@@ -59,15 +58,14 @@
namespace QtWayland {
-InputDevice::InputDevice(QWaylandInputDevice *handle, Compositor *compositor, QWaylandInputDevice::CapabilityFlags caps)
- : QtWaylandServer::wl_seat(compositor->wl_display(), 2)
+InputDevice::InputDevice(QWaylandInputDevice *handle, Compositor *compositor)
+ : QtWaylandServer::wl_seat(compositor->wl_display())
, m_handle(handle)
, m_dragHandle(new QWaylandDrag(this))
, m_compositor(compositor)
- , m_capabilities(caps)
- , m_pointer(m_capabilities & QWaylandInputDevice::Pointer ? new Pointer(m_compositor, this) : 0)
- , m_keyboard(m_capabilities & QWaylandInputDevice::Keyboard ? new Keyboard(m_compositor, this) : 0)
- , m_touch(m_capabilities & QWaylandInputDevice::Touch ? new Touch(m_compositor) : 0)
+ , m_pointer(new Pointer(m_compositor, this))
+ , m_keyboard(new Keyboard(m_compositor, this))
+ , m_touch(new Touch(m_compositor))
, m_inputMethod(m_compositor->extensions() & QWaylandCompositor::TextInputExtension ? new InputMethod(m_compositor, this) : 0)
, m_data_device()
{
@@ -119,54 +117,26 @@
void InputDevice::seat_bind_resource(wl_seat::Resource *resource)
{
- // The order of m_capabilities matches the order defined in the wayland protocol
- wl_seat::send_capabilities(resource->handle, (uint32_t)m_capabilities);
-}
-
-void InputDevice::setCapabilities(QWaylandInputDevice::CapabilityFlags caps)
-{
- if (m_capabilities != caps) {
- QWaylandInputDevice::CapabilityFlags changed = caps ^ m_capabilities;
-
- if (changed & QWaylandInputDevice::Pointer) {
- m_pointer.reset(m_pointer.isNull() ? new Pointer(m_compositor, this) : 0);
- }
-
- if (changed & QWaylandInputDevice::Keyboard) {
- m_keyboard.reset(m_keyboard.isNull() ? new Keyboard(m_compositor, this) : 0);
- }
+ uint32_t caps = WL_SEAT_CAPABILITY_POINTER | WL_SEAT_CAPABILITY_KEYBOARD;
+ if (!QTouchDevice::devices().isEmpty())
+ caps |= WL_SEAT_CAPABILITY_TOUCH;
- if (changed & QWaylandInputDevice::Touch) {
- m_touch.reset(m_touch.isNull() ? new Touch(m_compositor) : 0);
- }
-
- m_capabilities = caps;
- QList<Resource *> resources = resourceMap().values();
- for (int i = 0; i < resources.size(); i++) {
- wl_seat::send_capabilities(resources.at(i)->handle, (uint32_t)m_capabilities);
- }
- }
+ wl_seat::send_capabilities(resource->handle, caps);
}
void InputDevice::seat_get_pointer(wl_seat::Resource *resource, uint32_t id)
{
- if (!m_pointer.isNull()) {
- m_pointer->add(resource->client(), id, resource->version());
- }
+ m_pointer->add(resource->client(), id);
}
void InputDevice::seat_get_keyboard(wl_seat::Resource *resource, uint32_t id)
{
- if (!m_keyboard.isNull()) {
- m_keyboard->add(resource->client(), id, resource->version());
- }
+ m_keyboard->add(resource->client(), id);
}
void InputDevice::seat_get_touch(wl_seat::Resource *resource, uint32_t id)
{
- if (!m_touch.isNull()) {
- m_touch->add(resource->client(), id, resource->version());
- }
+ m_touch->add(resource->client(), id);
}
void InputDevice::sendMousePressEvent(Qt::MouseButton button, const QPointF &localPos, const QPointF &globalPos)
@@ -184,7 +154,7 @@
pointerDevice()->sendMouseMoveEvent(localPos, globalPos);
}
-void InputDevice::sendMouseMoveEvent(QWaylandSurfaceView *surface, const QPointF &localPos, const QPointF &globalPos)
+void InputDevice::sendMouseMoveEvent(Surface *surface, const QPointF &localPos, const QPointF &globalPos)
{
setMouseFocus(surface,localPos,globalPos);
sendMouseMoveEvent(localPos,globalPos);
@@ -197,10 +167,6 @@
void InputDevice::sendTouchPointEvent(int id, double x, double y, Qt::TouchPointState state)
{
- if (m_touch.isNull()) {
- return;
- }
-
switch (state) {
case Qt::TouchPointPressed:
m_touch->sendDown(id, QPointF(x, y));
@@ -221,16 +187,12 @@
void InputDevice::sendTouchFrameEvent()
{
- if (!m_touch.isNull()) {
- m_touch->sendFrame();
- }
+ m_touch->sendFrame();
}
void InputDevice::sendTouchCancelEvent()
{
- if (!m_touch.isNull()) {
- m_touch->sendCancel();
- }
+ m_touch->sendCancel();
}
void InputDevice::sendFullKeyEvent(QKeyEvent *event)
@@ -244,12 +206,10 @@
if (ext && ext->postQtKeyEvent(event, keyboardFocus()))
return;
- if (!m_keyboard.isNull() && !event->isAutoRepeat()) {
- if (event->type() == QEvent::KeyPress)
- m_keyboard->sendKeyPressEvent(event->nativeScanCode());
- else if (event->type() == QEvent::KeyRelease)
- m_keyboard->sendKeyReleaseEvent(event->nativeScanCode());
- }
+ if (event->type() == QEvent::KeyPress)
+ m_keyboard->sendKeyPressEvent(event->nativeScanCode());
+ else if (event->type() == QEvent::KeyRelease)
+ m_keyboard->sendKeyReleaseEvent(event->nativeScanCode());
}
void InputDevice::sendFullKeyEvent(Surface *surface, QKeyEvent *event)
@@ -292,7 +252,7 @@
Surface *InputDevice::keyboardFocus() const
{
- return m_keyboard.isNull() ? 0 : m_keyboard->focus();
+ return m_keyboard->focus();
}
/*!
@@ -303,41 +263,34 @@
if (surface && (surface->transientInactive() || surface->isDestroyed()))
return false;
- if (!m_keyboard.isNull()) {
- m_keyboard->setFocus(surface);
- if (m_data_device)
- m_data_device->setFocus(m_keyboard->focusResource());
- return true;
- }
- return false;
+ m_keyboard->setFocus(surface);
+ if (m_data_device)
+ m_data_device->setFocus(m_keyboard->focusResource());
+ return true;
}
-QWaylandSurfaceView *InputDevice::mouseFocus() const
+Surface *InputDevice::mouseFocus() const
{
- return m_pointer.isNull() ? 0 : m_pointer->focusSurface();
+ return m_pointer->focusSurface();
}
-void InputDevice::setMouseFocus(QWaylandSurfaceView *view, const QPointF &localPos, const QPointF &globalPos)
+void InputDevice::setMouseFocus(Surface *surface, const QPointF &localPos, const QPointF &globalPos)
{
- if (view && view->surface()->handle()->isDestroyed())
+ if (surface && surface->isDestroyed())
return;
- if (!m_pointer.isNull()) {
- m_pointer->setMouseFocus(view, localPos, globalPos);
- }
+ m_pointer->setMouseFocus(surface, localPos, globalPos);
- if (!m_touch.isNull()) {
- // We have no separate touch focus management so make it match the pointer focus always.
- // No wl_touch_set_focus() is available so set it manually.
- m_touch->setFocus(view);
- }
+ // We have no separate touch focus management so make it match the pointer focus always.
+ // No wl_touch_set_focus() is available so set it manually.
+ m_touch->setFocus(surface);
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlinputdevice_p.h
^
|
@@ -44,7 +44,6 @@
#include <stdint.h>
#include <QtCompositor/qwaylandexport.h>
-#include <QtCompositor/qwaylandinput.h>
#include <QtCore/QList>
#include <QtCore/QPoint>
@@ -62,7 +61,6 @@
class QTouchEvent;
class QWaylandInputDevice;
class QWaylandDrag;
-class QWaylandSurfaceView;
namespace QtWayland {
@@ -78,13 +76,13 @@
class Q_COMPOSITOR_EXPORT InputDevice : public QtWaylandServer::wl_seat
{
public:
- InputDevice(QWaylandInputDevice *handle, Compositor *compositor, QWaylandInputDevice::CapabilityFlags caps);
+ InputDevice(QWaylandInputDevice *handle, Compositor *compositor);
~InputDevice();
void sendMousePressEvent(Qt::MouseButton button, const QPointF &localPos, const QPointF &globalPos = QPointF());
void sendMouseReleaseEvent(Qt::MouseButton button, const QPointF &localPos, const QPointF &globalPos = QPointF());
void sendMouseMoveEvent(const QPointF &localPos, const QPointF &globalPos = QPointF());
- void sendMouseMoveEvent(QWaylandSurfaceView *surface, const QPointF &localPos, const QPointF &globalPos = QPointF());
+ void sendMouseMoveEvent(Surface *surface, const QPointF &localPos, const QPointF &globalPos = QPointF());
void sendMouseWheelEvent(Qt::Orientation orientation, int delta);
void sendTouchPointEvent(int id, double x, double y, Qt::TouchPointState state);
@@ -99,8 +97,8 @@
Surface *keyboardFocus() const;
bool setKeyboardFocus(Surface *surface);
- QWaylandSurfaceView *mouseFocus() const;
- void setMouseFocus(QWaylandSurfaceView *surface, const QPointF &localPos, const QPointF &globalPos);
+ Surface *mouseFocus() const;
+ void setMouseFocus(Surface *surface, const QPointF &localPos, const QPointF &globalPos);
void clientRequestedDataDevice(DataDeviceManager *dndSelection, struct wl_client *client, uint32_t id);
const DataDevice *dataDevice() const;
@@ -120,17 +118,13 @@
static InputDevice *fromSeatResource(struct ::wl_resource *resource)
{
- return static_cast<InputDevice *>(wl_seat::Resource::fromResource(resource)->seat_object);
+ return static_cast<InputDevice *>(wl_seat::Resource::fromResource(resource)->seat);
}
- QWaylandInputDevice::CapabilityFlags capabilities() { return m_capabilities; }
- void setCapabilities(QWaylandInputDevice::CapabilityFlags caps);
-
private:
QWaylandInputDevice *m_handle;
QWaylandDrag *m_dragHandle;
Compositor *m_compositor;
- QWaylandInputDevice::CapabilityFlags m_capabilities;
QScopedPointer<Pointer> m_pointer;
QScopedPointer<Keyboard> m_keyboard;
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlinputmethod.cpp
^
|
@@ -40,6 +40,8 @@
#include "qwlinputmethod_p.h"
+#include <QDebug>
+
#include "qwlcompositor_p.h"
#include "qwlinputdevice_p.h"
#include "qwlinputmethodcontext_p.h"
@@ -52,7 +54,7 @@
namespace QtWayland {
InputMethod::InputMethod(Compositor *compositor, InputDevice *seat)
- : QtWaylandServer::wl_input_method(seat->compositor()->wl_display(), 1)
+ : QtWaylandServer::wl_input_method(seat->compositor()->wl_display())
, m_compositor(compositor)
, m_seat(seat)
, m_resource(0)
@@ -69,7 +71,7 @@
void InputMethod::activate(TextInput *textInput)
{
if (!m_resource) {
- qDebug("Cannot activate (no input method running).");
+ qDebug() << "Cannout activate no input method running.";
return;
}
@@ -90,7 +92,7 @@
void InputMethod::deactivate()
{
if (!m_resource) {
- qDebug("Cannot deactivate (no input method running).");
+ qDebug() << "Cannout deactivate no input method running.";
return;
}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlinputmethodcontext.cpp
^
|
@@ -47,7 +47,7 @@
namespace QtWayland {
InputMethodContext::InputMethodContext(wl_client *client, TextInput *textInput)
- : QtWaylandServer::wl_input_method_context(client, 0, 1)
+ : QtWaylandServer::wl_input_method_context(client, 0)
, m_textInput(textInput)
{
}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlinputpanel.cpp
^
|
@@ -54,7 +54,7 @@
namespace QtWayland {
InputPanel::InputPanel(Compositor *compositor)
- : QtWaylandServer::wl_input_panel(compositor->wl_display(), 1)
+ : QtWaylandServer::wl_input_panel(compositor->wl_display())
, m_compositor(compositor)
, m_handle(new QWaylandInputPanel(this))
, m_focus()
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlinputpanelsurface.cpp
^
|
@@ -48,7 +48,7 @@
namespace QtWayland {
InputPanelSurface::InputPanelSurface(wl_client *client, int id, Surface *surface)
- : QtWaylandServer::wl_input_panel_surface(client, id, 1)
+ : QtWaylandServer::wl_input_panel_surface(client, id)
, m_surface(surface)
, m_type(Invalid)
, m_output(0)
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlkeyboard.cpp
^
|
@@ -54,15 +54,12 @@
#include <sys/types.h>
#endif
-QT_BEGIN_NAMESPACE
-
namespace QtWayland {
Keyboard::Keyboard(Compositor *compositor, InputDevice *seat)
: QtWaylandServer::wl_keyboard()
, m_compositor(compositor)
, m_seat(seat)
- , m_grab(this)
, m_focus()
, m_focusResource()
, m_keys()
@@ -78,7 +75,9 @@
#ifndef QT_NO_WAYLAND_XKB
initXKB();
#endif
- connect(&m_focusDestroyListener, &WlListener::fired, this, &Keyboard::focusDestroyed);
+ m_focusDestroyListener.parent = this;
+ m_focusDestroyListener.listener.notify = focusDestroyed;
+ wl_list_init(&m_focusDestroyListener.listener.link);
}
Keyboard::~Keyboard()
@@ -92,33 +91,13 @@
#endif
}
-KeyboardGrabber::~KeyboardGrabber()
-{
-}
-
-void Keyboard::startGrab(KeyboardGrabber *grab)
-{
- m_grab = grab;
- m_grab->m_keyboard = this;
- m_grab->focused(m_focus);
-}
-
-void Keyboard::endGrab()
-{
- m_grab = this;
-}
-
-KeyboardGrabber *Keyboard::currentGrab() const
-{
- return m_grab;
-}
-
-void Keyboard::focused(Surface *surface)
+void Keyboard::setFocus(Surface *surface)
{
if (m_focusResource && m_focus != surface) {
uint32_t serial = wl_display_next_serial(m_compositor->wl_display());
send_leave(m_focusResource->handle, serial, m_focus->resource()->handle);
- m_focusDestroyListener.reset();
+ wl_list_remove(&m_focusDestroyListener.listener.link);
+ wl_list_init(&m_focusDestroyListener.listener.link);
}
Resource *resource = surface ? resourceMap().value(surface->resource()->client()) : 0;
@@ -127,7 +106,7 @@
uint32_t serial = wl_display_next_serial(m_compositor->wl_display());
send_modifiers(resource->handle, serial, m_modsDepressed, m_modsLatched, m_modsLocked, m_group);
send_enter(resource->handle, serial, surface->resource()->handle, QByteArray::fromRawData((char *)m_keys.data(), m_keys.size() * sizeof(uint32_t)));
- m_focusDestroyListener.listenForDestruction(surface->resource()->handle);
+ wl_signal_add(&surface->resource()->handle->destroy_signal, &m_focusDestroyListener.listener);
}
m_focusResource = resource;
@@ -135,24 +114,21 @@
Q_EMIT focusChanged(m_focus);
}
-void Keyboard::setFocus(Surface* surface)
-{
- m_grab->focused(surface);
-}
-
void Keyboard::setKeymap(const QWaylandKeymap &keymap)
{
m_keymap = keymap;
m_pendingKeymap = true;
}
-void Keyboard::focusDestroyed(void *data)
+void Keyboard::focusDestroyed(wl_listener *listener, void *data)
{
Q_UNUSED(data)
- m_focusDestroyListener.reset();
+ Keyboard *keyb = reinterpret_cast<Listener *>(listener)->parent;
+ wl_list_remove(&keyb->m_focusDestroyListener.listener.link);
+ wl_list_init(&keyb->m_focusDestroyListener.listener.link);
- m_focus = 0;
- m_focusResource = 0;
+ keyb->m_focus = 0;
+ keyb->m_focusResource = 0;
}
void Keyboard::sendKeyModifiers(wl_keyboard::Resource *resource, uint32_t serial)
@@ -199,44 +175,30 @@
m_focusResource = 0;
}
-void Keyboard::key(uint32_t serial, uint32_t time, uint32_t key, uint32_t state)
-{
- if (m_focusResource) {
- send_key(m_focusResource->handle, serial, time, key, state);
- }
-}
-
void Keyboard::sendKeyEvent(uint code, uint32_t state)
{
// There must be no keys pressed when changing the keymap,
// see http://lists.freedesktop.org/archives/wayland-devel/2013-October/011395.html
if (m_pendingKeymap && m_keys.isEmpty())
updateKeymap();
-
- uint32_t time = m_compositor->currentTimeMsecs();
- uint32_t serial = wl_display_next_serial(m_compositor->wl_display());
- uint key = code - 8;
- m_grab->key(serial, time, key, state);
- if (state == WL_KEYBOARD_KEY_STATE_PRESSED) {
- m_keys << key;
- } else {
- for (int i = 0; i < m_keys.size(); ++i) {
- if (m_keys.at(i) == key) {
- m_keys.remove(i);
+ if (m_focusResource) {
+ uint32_t time = m_compositor->currentTimeMsecs();
+ uint32_t serial = wl_display_next_serial(m_compositor->wl_display());
+ uint key = code - 8;
+ send_key(m_focusResource->handle, serial, time, key, state);
+ if (state == WL_KEYBOARD_KEY_STATE_PRESSED) {
+ m_keys << key;
+ } else {
+ for (int i = 0; i < m_keys.size(); ++i) {
+ if (m_keys.at(i) == key) {
+ m_keys.remove(i);
+ }
}
}
}
updateModifierState(code, state);
}
-void Keyboard::modifiers(uint32_t serial, uint32_t mods_depressed,
- uint32_t mods_latched, uint32_t mods_locked, uint32_t group)
-{
- if (m_focusResource) {
- send_modifiers(m_focusResource->handle, serial, mods_depressed, mods_latched, mods_locked, group);
- }
-}
-
void Keyboard::updateModifierState(uint code, uint32_t state)
{
#ifndef QT_NO_WAYLAND_XKB
@@ -258,7 +220,8 @@
m_modsLocked = modsLocked;
m_group = group;
- m_grab->modifiers(wl_display_next_serial(m_compositor->wl_display()), m_modsDepressed, m_modsLatched, m_modsLocked, m_group);
+ if (m_focusResource)
+ sendKeyModifiers(m_focusResource, wl_display_next_serial(m_compositor->wl_display()));
#else
Q_UNUSED(code);
Q_UNUSED(state);
@@ -357,5 +320,3 @@
#endif
} // namespace QtWayland
-
-QT_END_NAMESPACE
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlkeyboard_p.h
^
|
@@ -54,8 +54,6 @@
#include <xkbcommon/xkbcommon.h>
#endif
-#include "qwllistener_p.h"
-
QT_BEGIN_NAMESPACE
namespace QtWayland {
@@ -63,20 +61,8 @@
class Compositor;
class InputDevice;
class Surface;
-class Keyboard;
-
-class Q_COMPOSITOR_EXPORT KeyboardGrabber {
- public:
- virtual ~KeyboardGrabber();
- virtual void focused(Surface *surface) = 0;
- virtual void key(uint32_t serial, uint32_t time, uint32_t key, uint32_t state) = 0;
- virtual void modifiers(uint32_t serial, uint32_t mods_depressed,
- uint32_t mods_latched, uint32_t mods_locked, uint32_t group) = 0;
-
- Keyboard *m_keyboard;
-};
-class Q_COMPOSITOR_EXPORT Keyboard : public QObject, public QtWaylandServer::wl_keyboard, public KeyboardGrabber
+class Q_COMPOSITOR_EXPORT Keyboard : public QObject, public QtWaylandServer::wl_keyboard
{
Q_OBJECT
@@ -94,16 +80,6 @@
Surface *focus() const;
Resource *focusResource() const;
- void focused(Surface* surface);
- void key(uint32_t serial, uint32_t time, uint32_t key, uint32_t state);
- void modifiers(uint32_t serial, uint32_t mods_depressed,
- uint32_t mods_latched, uint32_t mods_locked, uint32_t group);
-
- void startGrab(KeyboardGrabber *grab);
- void endGrab();
- KeyboardGrabber *currentGrab() const;
-
-
Q_SIGNALS:
void focusChanged(Surface *surface);
@@ -115,7 +91,7 @@
void sendKeyEvent(uint code, uint32_t state);
void updateModifierState(uint code, uint32_t state);
void updateKeymap();
- void focusDestroyed(void *data);
+ static void focusDestroyed(wl_listener *listener, void *data);
#ifndef QT_NO_WAYLAND_XKB
void initXKB();
@@ -125,10 +101,14 @@
Compositor *m_compositor;
InputDevice *m_seat;
- KeyboardGrabber* m_grab;
Surface *m_focus;
Resource *m_focusResource;
- WlListener m_focusDestroyListener;
+ struct Listener
+ {
+ wl_listener listener;
+ Keyboard *parent;
+ };
+ Listener m_focusDestroyListener;
QVector<uint32_t> m_keys;
uint32_t m_modsDepressed;
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwllistener.cpp
^
|
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Jolla Ltd, author: <giulio.camuffo@jollamobile.com>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwllistener_p.h"
-
-QT_BEGIN_NAMESPACE
-
-WlListener::WlListener()
-{
- m_listener.parent = this;
- m_listener.listener.notify = handler;
- wl_list_init(&m_listener.listener.link);
-}
-
-void WlListener::listenForDestruction(::wl_resource *resource)
-{
- wl_resource_add_destroy_listener(resource, &m_listener.listener);
-}
-
-void WlListener::reset()
-{
- wl_list_remove(&m_listener.listener.link);
- wl_list_init(&m_listener.listener.link);
-}
-
-void WlListener::handler(wl_listener *listener, void *data)
-{
- WlListener *that = reinterpret_cast<Listener *>(listener)->parent;
- emit that->fired(data);
-}
-
-QT_END_NAMESPACE
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwllistener_p.h
^
|
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Jolla Ltd, author: <giulio.camuffo@jollamobile.com>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QTWAYLAND_QWLLISTENER_H
-#define QTWAYLAND_QWLLISTENER_H
-
-#include <QObject>
-
-#include <wayland-server.h>
-
-QT_BEGIN_NAMESPACE
-
-class WlListener : public QObject
-{
- Q_OBJECT
-public:
- WlListener();
-
- void listenForDestruction(::wl_resource *resource);
- void reset();
-
-signals:
- void fired(void *data);
-
-private:
- static void handler(wl_listener *listener, void *data);
-
- struct Listener {
- wl_listener listener;
- WlListener *parent;
- };
- Listener m_listener;
-};
-
-QT_END_NAMESPACE
-
-#endif
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwloutput.cpp
^
|
@@ -49,10 +49,9 @@
namespace QtWayland {
OutputGlobal::OutputGlobal(struct ::wl_display *display)
- : QtWaylandServer::wl_output(display, 2)
+ : QtWaylandServer::wl_output(display)
, m_displayId(-1)
, m_numQueued(0)
- , m_transform(WL_OUTPUT_TRANSFORM_NORMAL)
{
QScreen *screen = QGuiApplication::primaryScreen();
m_geometry = QRect(QPoint(0, 0), screen->availableGeometry().size());
@@ -66,28 +65,10 @@
void OutputGlobal::output_bind_resource(Resource *resource)
{
wl_output_send_geometry(resource->handle, 0, 0,
- m_physicalSize.width(), m_physicalSize.height(), 0, "", "", m_transform);
+ size().width(), size().height(), 0, "", "", 0);
wl_output_send_mode(resource->handle, WL_OUTPUT_MODE_CURRENT|WL_OUTPUT_MODE_PREFERRED,
size().width(), size().height(), refreshRate());
-
- if (resource->version() >= 2)
- wl_output_send_done(resource->handle);
-}
-
-void OutputGlobal::setPhysicalSize(const QSize &size)
-{
- if (m_physicalSize != size) {
- m_physicalSize = size;
-
- foreach (Resource *res, resourceMap()) {
- wl_output_send_geometry(res->handle, 0, 0,
- m_physicalSize.width(), m_physicalSize.height(), 0, "", "", m_transform);
-
- if (res->version() >= 2)
- wl_output_send_done(res->handle);
- }
- }
}
void OutputGlobal::setGeometry(const QRect &geometry)
@@ -100,36 +81,6 @@
m_refreshRate = rate;
}
-void OutputGlobal::sendOutputOrientation(Qt::ScreenOrientation orientation)
-{
- QScreen *screen = QGuiApplication::primaryScreen();
- bool isPortrait = screen->primaryOrientation() == Qt::PortraitOrientation;
- switch (orientation) {
- case Qt::PrimaryOrientation:
- m_transform = WL_OUTPUT_TRANSFORM_NORMAL;
- break;
- case Qt::PortraitOrientation:
- m_transform = isPortrait ? WL_OUTPUT_TRANSFORM_NORMAL : WL_OUTPUT_TRANSFORM_90;
- break;
- case Qt::LandscapeOrientation:
- m_transform = isPortrait ? WL_OUTPUT_TRANSFORM_270 : WL_OUTPUT_TRANSFORM_NORMAL;
- break;
- case Qt::InvertedPortraitOrientation:
- m_transform = isPortrait ? WL_OUTPUT_TRANSFORM_180 : WL_OUTPUT_TRANSFORM_270;
- break;
- case Qt::InvertedLandscapeOrientation:
- m_transform = isPortrait ? WL_OUTPUT_TRANSFORM_90 : WL_OUTPUT_TRANSFORM_180;
- break;
- }
-
- foreach (Resource *res, resourceMap()) {
- wl_output_send_geometry(res->handle, 0, 0,
- m_physicalSize.width(), m_physicalSize.height(), 0, "", "", m_transform);
- if (res->version() >= 2)
- wl_output_send_done(res->handle);
- }
-}
-
Output *OutputGlobal::outputForClient(wl_client *client) const
{
return static_cast<Output *>(resourceMap().value(client));
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwloutput_p.h
^
|
@@ -71,10 +71,8 @@
int y() const { return m_geometry.y(); }
QSize size() const { return m_geometry.size(); }
- void setPhysicalSize(const QSize &size);
void setRefreshRate(int rate);
int refreshRate() const { return m_refreshRate; }
- void sendOutputOrientation(Qt::ScreenOrientation orientation);
Output *outputForClient(struct wl_client *client) const;
@@ -83,11 +81,9 @@
private:
QRect m_geometry;
- QSize m_physicalSize;
int m_refreshRate;
int m_displayId;
int m_numQueued;
- wl_output_transform m_transform;
};
#if 0
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlpointer.cpp
^
|
@@ -46,9 +46,6 @@
#include "qwlkeyboard_p.h"
#include "qwlsurface_p.h"
#include "qwaylandcompositor.h"
-#include "qwaylandsurfaceview.h"
-
-QT_BEGIN_NAMESPACE
namespace QtWayland {
@@ -99,45 +96,50 @@
, m_currentPoint()
, m_buttonCount()
{
- connect(&m_focusDestroyListener, &WlListener::fired, this, &Pointer::focusDestroyed);
+ m_focusDestroyListener.parent = this;
+ m_focusDestroyListener.listener.notify = focusDestroyed;
+ wl_list_init(&m_focusDestroyListener.listener.link);
}
-void Pointer::setFocus(QWaylandSurfaceView *surface, const QPointF &position)
+void Pointer::setFocus(Surface *surface, const QPointF &position)
{
if (m_focusResource && m_focus != surface) {
uint32_t serial = wl_display_next_serial(m_compositor->wl_display());
- send_leave(m_focusResource->handle, serial, m_focus->surface()->handle()->resource()->handle);
- m_focusDestroyListener.reset();
+ send_leave(m_focusResource->handle, serial, m_focus->resource()->handle);
+ wl_list_remove(&m_focusDestroyListener.listener.link);
+ wl_list_init(&m_focusDestroyListener.listener.link);
}
- Resource *resource = surface ? resourceMap().value(surface->surface()->handle()->resource()->client()) : 0;
+ Resource *resource = surface ? resourceMap().value(surface->resource()->client()) : 0;
if (resource && (m_focus != surface || resource != m_focusResource)) {
uint32_t serial = wl_display_next_serial(m_compositor->wl_display());
Keyboard *keyboard = m_seat->keyboardDevice();
if (keyboard) {
- wl_keyboard::Resource *kr = keyboard->resourceMap().value(surface->surface()->handle()->resource()->client());
+ wl_keyboard::Resource *kr = keyboard->resourceMap().value(surface->resource()->client());
if (kr)
keyboard->sendKeyModifiers(kr, serial);
}
- send_enter(resource->handle, serial, surface->surface()->handle()->resource()->handle,
+ send_enter(resource->handle, serial, surface->resource()->handle,
wl_fixed_from_double(position.x()), wl_fixed_from_double(position.y()));
- m_focusDestroyListener.listenForDestruction(surface->surface()->handle()->resource()->handle);
+ wl_signal_add(&surface->resource()->handle->destroy_signal, &m_focusDestroyListener.listener);
}
m_focusResource = resource;
m_focus = surface;
}
-void Pointer::focusDestroyed(void *data)
+void Pointer::focusDestroyed(wl_listener *listener, void *data)
{
Q_UNUSED(data)
- m_focusDestroyListener.reset();
-
- m_focus = 0;
- m_focusResource = 0;
- setMouseFocus(0, QPointF(), QPointF());
+ Pointer *pointer = reinterpret_cast<Listener *>(listener)->parent;
+ wl_list_remove(&pointer->m_focusDestroyListener.listener.link);
+ wl_list_init(&pointer->m_focusDestroyListener.listener.link);
+
+ pointer->m_focus = 0;
+ pointer->m_focusResource = 0;
+ pointer->setMouseFocus(0, QPointF(), QPointF());
}
void Pointer::startGrab(PointerGrabber *grab)
@@ -155,7 +157,7 @@
m_grab->focus();
}
-void Pointer::setCurrent(QWaylandSurfaceView *surface, const QPointF &point)
+void Pointer::setCurrent(Surface *surface, const QPointF &point)
{
m_current = surface;
m_currentPoint = point;
@@ -186,12 +188,12 @@
return m_grabSerial;
}
-QWaylandSurfaceView *Pointer::focusSurface() const
+Surface *Pointer::focusSurface() const
{
return m_focus;
}
-QWaylandSurfaceView *Pointer::current() const
+Surface *Pointer::current() const
{
return m_current;
}
@@ -217,7 +219,7 @@
m_focusResource = 0;
}
-void Pointer::setMouseFocus(QWaylandSurfaceView *surface, const QPointF &localPos, const QPointF &globalPos)
+void Pointer::setMouseFocus(Surface *surface, const QPointF &localPos, const QPointF &globalPos)
{
m_position = globalPos;
@@ -327,5 +329,3 @@
}
} // namespace QtWayland
-
-QT_END_NAMESPACE
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlpointer_p.h
^
|
@@ -46,17 +46,14 @@
#include <QtCore/QList>
#include <QtCore/QPoint>
-#include <QtCore/QObject>
#include <QtCompositor/private/qwayland-server-wayland.h>
#include <stdint.h>
-#include "qwllistener_p.h"
-
QT_BEGIN_NAMESPACE
-class QWaylandSurfaceView;
+struct wl_listener;
namespace QtWayland {
@@ -76,12 +73,12 @@
Pointer *m_pointer;
};
-class Q_COMPOSITOR_EXPORT Pointer : public QObject, public QtWaylandServer::wl_pointer, public PointerGrabber
+class Q_COMPOSITOR_EXPORT Pointer : public QtWaylandServer::wl_pointer, public PointerGrabber
{
public:
Pointer(Compositor *compositor, InputDevice *seat);
- void setFocus(QWaylandSurfaceView *surface, const QPointF &position);
+ void setFocus(Surface *surface, const QPointF &position);
void startGrab(PointerGrabber *currentGrab);
void endGrab();
@@ -90,8 +87,8 @@
uint32_t grabTime() const;
uint32_t grabSerial() const;
- void setCurrent(QWaylandSurfaceView *surface, const QPointF &point);
- void setMouseFocus(QWaylandSurfaceView *surface, const QPointF &localPos, const QPointF &globalPos);
+ void setCurrent(Surface *surface, const QPointF &point);
+ void setMouseFocus(Surface *surface, const QPointF &localPos, const QPointF &globalPos);
void sendButton(uint32_t time, Qt::MouseButton button, uint32_t state);
@@ -100,8 +97,8 @@
void sendMouseMoveEvent(const QPointF &localPos, const QPointF &globalPos);
void sendMouseWheelEvent(Qt::Orientation orientation, int delta);
- QWaylandSurfaceView *focusSurface() const;
- QWaylandSurfaceView *current() const;
+ Surface *focusSurface() const;
+ Surface *current() const;
QPointF position() const;
QPointF currentPosition() const;
Resource *focusResource() const;
@@ -117,7 +114,7 @@
void pointer_destroy_resource(Resource *resource) Q_DECL_OVERRIDE;
private:
- void focusDestroyed(void *data);
+ static void focusDestroyed(wl_listener *listener, void *data);
Compositor *m_compositor;
InputDevice *m_seat;
@@ -129,15 +126,20 @@
QPointF m_position;
- QWaylandSurfaceView *m_focus;
+ Surface *m_focus;
Resource *m_focusResource;
- QWaylandSurfaceView *m_current;
+ Surface *m_current;
QPointF m_currentPoint;
int m_buttonCount;
- WlListener m_focusDestroyListener;
+ struct Listener
+ {
+ wl_listener listener;
+ Pointer *parent;
+ };
+ Listener m_focusDestroyListener;
};
} // namespace QtWayland
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlqtkey.cpp
^
|
@@ -43,12 +43,14 @@
#include <QKeyEvent>
#include <QWindow>
+#include "qwaylandresourcecollection.h"
+
QT_BEGIN_NAMESPACE
namespace QtWayland {
QtKeyExtensionGlobal::QtKeyExtensionGlobal(Compositor *compositor)
- : QtWaylandServer::qt_key_extension(compositor->wl_display(), 2)
+ : QtWaylandServer::qt_key_extension(compositor->wl_display())
, m_compositor(compositor)
{
}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlqttouch.cpp
^
|
@@ -40,7 +40,6 @@
#include "qwlqttouch_p.h"
#include "qwlsurface_p.h"
-#include "qwaylandsurfaceview.h"
#include <QTouchEvent>
#include <QWindow>
@@ -51,7 +50,7 @@
static const int maxRawPos = 24;
TouchExtensionGlobal::TouchExtensionGlobal(Compositor *compositor)
- : QtWaylandServer::qt_touch_extension(compositor->wl_display(), 1)
+ : QtWaylandServer::qt_touch_extension(compositor->wl_display())
, m_compositor(compositor)
, m_flags(0)
, m_resources()
@@ -68,15 +67,15 @@
return int(f * 10000);
}
-bool TouchExtensionGlobal::postTouchEvent(QTouchEvent *event, QWaylandSurfaceView *view)
+bool TouchExtensionGlobal::postTouchEvent(QTouchEvent *event, Surface *surface)
{
const QList<QTouchEvent::TouchPoint> points = event->touchPoints();
const int pointCount = points.count();
if (!pointCount)
return false;
- QPointF surfacePos = view->pos();
- wl_client *surfaceClient = view->surface()->handle()->resource()->client();
+ QPointF surfacePos = surface->pos();
+ wl_client *surfaceClient = surface->resource()->client();
uint32_t time = m_compositor->currentTimeMsecs();
const int rescount = m_resources.count();
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlqttouch_p.h
^
|
@@ -50,7 +50,6 @@
class Compositor;
class Surface;
class QTouchEvent;
-class QWaylandSurfaceView;
namespace QtWayland {
@@ -60,7 +59,7 @@
TouchExtensionGlobal(Compositor *compositor);
~TouchExtensionGlobal();
- bool postTouchEvent(QTouchEvent *event, QWaylandSurfaceView *view);
+ bool postTouchEvent(QTouchEvent *event, Surface *surface);
void setFlags(int flags) { m_flags = flags; }
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlregion.cpp
^
|
@@ -47,7 +47,7 @@
namespace QtWayland {
Region::Region(struct wl_client *client, uint32_t id)
- : QtWaylandServer::wl_region(client, id, 1)
+ : QtWaylandServer::wl_region(client, id)
{
}
@@ -57,7 +57,7 @@
Region *Region::fromResource(struct ::wl_resource *resource)
{
- return static_cast<Region *>(Resource::fromResource(resource)->region_object);
+ return static_cast<Region *>(Resource::fromResource(resource)->region);
}
void Region::region_destroy_resource(Resource *)
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlshellsurface.cpp
^
|
@@ -47,8 +47,6 @@
#include "qwlpointer_p.h"
#include "qwlextendedsurface_p.h"
-#include "qwaylandsurfaceview.h"
-
#include <QtCore/qglobal.h>
#include <QtCore/QDebug>
@@ -60,14 +58,12 @@
{
}
-const wl_interface *Shell::interface() const
-{
- return &wl_shell_interface;
-}
-
-void Shell::bind(struct wl_client *client, uint32_t version, uint32_t id)
+void Shell::bind_func(struct wl_client *client, void *data,
+ uint32_t version, uint32_t id)
{
- add(client, id, version);
+ Q_UNUSED(version);
+ struct wl_resource *resource = wl_resource_create(client, &wl_shell_interface, version, id);
+ wl_resource_set_implementation(resource, &shell_interface, data, 0);
}
ShellSurfacePopupGrabber *Shell::getPopupGrabber(InputDevice *input)
@@ -78,39 +74,43 @@
return m_popupGrabber.value(input);
}
-void Shell::shell_get_shell_surface(Resource *resource, uint32_t id, struct ::wl_resource *surface_res)
-{
- Surface *surface = Surface::fromResource(surface_res);
- new ShellSurface(this, resource->client(), id, surface);
+void Shell::get_shell_surface(struct wl_client *client,
+ struct wl_resource *shell_resource,
+ uint32_t id,
+ struct wl_resource *surface_super)
+{
+ Shell *shell = static_cast<Shell*>(shell_resource->data);
+ Surface *surface = Surface::fromResource(surface_super);
+ new ShellSurface(shell, client, id, surface);
}
-
+const struct wl_shell_interface Shell::shell_interface = {
+ Shell::get_shell_surface
+};
ShellSurface::ShellSurface(Shell *shell, wl_client *client, uint32_t id, Surface *surface)
- : QWaylandSurfaceInterface(surface->waylandSurface())
- , wl_shell_surface(client, id, 1)
+ : wl_shell_surface(client, id)
, m_shell(shell)
, m_surface(surface)
- , m_deleting(false)
, m_resizeGrabber(0)
, m_moveGrabber(0)
, m_popupGrabber(0)
+ , m_transientParent(0)
+ , m_xOffset(0)
+ , m_yOffset(0)
+ , m_windowType(QWaylandSurface::None)
+ , m_popupLocation()
, m_popupSerial()
{
- m_view = surface->compositor()->waylandCompositor()->createView(surface->waylandSurface());
- connect(surface->waylandSurface(), &QWaylandSurface::configure, this, &ShellSurface::configure);
- connect(surface->waylandSurface(), &QWaylandSurface::mapped, this, &ShellSurface::mapped);
+ surface->setShellSurface(this);
+ connect(surface->waylandSurface(), &QObject::destroyed, this, &ShellSurface::surfaceDestroyed);
}
-ShellSurface::~ShellSurface()
-{
- // We must destroy the wl_resource here, but be careful not to do it
- // if we're here from shell_surface_destroy_resource(), i.e. if the
- // wl_resource was destroyed already
- if (!m_deleting) {
- m_deleting = true;
- wl_resource_destroy(resource()->handle);
- }
+void ShellSurface::surfaceDestroyed()
+{
+ m_surface = Q_NULLPTR;
+ // The spec says wl_shell_surface is destroyed when the wl_surface goes away. so do it
+ wl_resource_destroy(resource()->handle);
}
void ShellSurface::sendConfigure(uint32_t edges, int32_t width, int32_t height)
@@ -118,29 +118,44 @@
send_configure(edges, width, height);
}
-void ShellSurface::ping(uint32_t serial)
+void ShellSurface::ping()
{
+ uint32_t serial = wl_display_next_serial(m_surface->compositor()->wl_display());
m_pings.insert(serial);
send_ping(serial);
}
+Surface *ShellSurface::surface() const
+{
+ return m_surface;
+}
+
void ShellSurface::adjustPosInResize()
{
- if (m_surface->transientParent())
+ if (m_transientParent)
return;
if (!m_resizeGrabber || !(m_resizeGrabber->resize_edges & WL_SHELL_SURFACE_RESIZE_TOP_LEFT))
return;
int bottomLeftX = m_resizeGrabber->point.x() + m_resizeGrabber->width;
int bottomLeftY = m_resizeGrabber->point.y() + m_resizeGrabber->height;
- qreal x = m_view->pos().x();
- qreal y = m_view->pos().y();
+ qreal x = surface()->pos().x();
+ qreal y = surface()->pos().y();
if (m_resizeGrabber->resize_edges & WL_SHELL_SURFACE_RESIZE_TOP)
- y = bottomLeftY - m_view->surface()->size().height();
+ y = bottomLeftY - surface()->size().height();
if (m_resizeGrabber->resize_edges & WL_SHELL_SURFACE_RESIZE_LEFT)
- x = bottomLeftX - m_view->surface()->size().width();
+ x = bottomLeftX - surface()->size().width();
QPointF newPos(x,y);
- m_view->setPos(newPos);
+ surface()->setPos(newPos);
+}
+
+QPointF ShellSurface::adjustedPosToTransientParent() const
+{
+ if (!m_transientParent ||
+ (m_surface->subSurface() && m_surface->subSurface()->parent()))
+ return m_surface->nonAdjustedPos();
+
+ return m_transientParent->surface()->pos() + QPoint(m_xOffset,m_yOffset);
}
void ShellSurface::resetResizeGrabber()
@@ -153,58 +168,38 @@
m_moveGrabber = 0;
}
-void ShellSurface::setOffset(const QPointF &offset)
+ShellSurface *ShellSurface::transientParent() const
{
- m_surface->setTransientOffset(offset.x(), offset.y());
+ return m_transientParent;
}
-void ShellSurface::configure(bool hasBuffer)
+void ShellSurface::setOffset(const QPointF &offset)
{
- m_surface->setMapped(hasBuffer);
+ m_xOffset = offset.x();
+ m_yOffset = offset.y();
}
-bool ShellSurface::runOperation(QWaylandSurfaceOp *op)
+QWaylandSurface::WindowType ShellSurface::windowType() const
{
- switch (op->type()) {
- case QWaylandSurfaceOp::Ping:
- ping(static_cast<QWaylandSurfacePingOp *>(op)->serial());
- return true;
- case QWaylandSurfaceOp::Resize:
- requestSize(static_cast<QWaylandSurfaceResizeOp *>(op)->size());
- return true;
- default:
- break;
- }
- return false;
+ return m_windowType;
}
-void ShellSurface::mapped()
+void ShellSurface::mapPopup()
{
- if (m_surface->waylandSurface()->windowType() == QWaylandSurface::Popup) {
- if (m_surface->mapped() && m_popupGrabber->grabSerial() == m_popupSerial) {
- m_popupGrabber->addPopup(this);
- } else {
- send_popup_done();
- m_popupGrabber->setClient(0);
- }
+ if (m_popupGrabber->grabSerial() == m_popupSerial) {
+ m_popupGrabber->addPopup(this);
+ } else {
+ send_popup_done();
+ m_popupGrabber->setClient(0);
}
}
-void ShellSurface::requestSize(const QSize &size)
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlshellsurface_p.h
^
|
@@ -43,8 +43,6 @@
#include <QtCompositor/qwaylandexport.h>
#include <QtCompositor/qwaylandsurface.h>
-#include <QtCompositor/qwaylandglobalinterface.h>
-#include <QtCompositor/qwaylandsurfaceinterface.h>
#include <wayland-server.h>
#include <QHash>
@@ -56,8 +54,6 @@
QT_BEGIN_NAMESPACE
-class QWaylandSurfaceView;
-
namespace QtWayland {
class Compositor;
@@ -67,57 +63,64 @@
class ShellSurfaceMoveGrabber;
class ShellSurfacePopupGrabber;
-class Shell : public QWaylandGlobalInterface, public QtWaylandServer::wl_shell
+class Shell
{
public:
Shell();
- const wl_interface *interface() const Q_DECL_OVERRIDE;
-
- void bind(struct wl_client *client, uint32_t version, uint32_t id) Q_DECL_OVERRIDE;
+ static void bind_func(struct wl_client *client, void *data,
+ uint32_t version, uint32_t id);
ShellSurfacePopupGrabber* getPopupGrabber(InputDevice *input);
-
private:
- void shell_get_shell_surface(Resource *resource, uint32_t id, struct ::wl_resource *surface) Q_DECL_OVERRIDE;
+ static void get_shell_surface(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ struct wl_resource *surface);
+ static const struct wl_shell_interface shell_interface;
QHash<InputDevice*, ShellSurfacePopupGrabber*> m_popupGrabber;
};
-class Q_COMPOSITOR_EXPORT ShellSurface : public QObject, public QWaylandSurfaceInterface, public QtWaylandServer::wl_shell_surface
+class Q_COMPOSITOR_EXPORT ShellSurface : public QObject, public QtWaylandServer::wl_shell_surface
{
public:
ShellSurface(Shell *shell, struct wl_client *client, uint32_t id, Surface *surface);
- ~ShellSurface();
void sendConfigure(uint32_t edges, int32_t width, int32_t height);
+ void ping();
+
+ Surface *surface() const;
void adjustPosInResize();
+ QPointF adjustedPosToTransientParent() const;
void resetResizeGrabber();
void resetMoveGrabber();
+ ShellSurface *transientParent() const;
void setOffset(const QPointF &offset);
- void configure(bool hasBuffer);
-
- void requestSize(const QSize &size);
- void ping(uint32_t serial);
-
-protected:
- bool runOperation(QWaylandSurfaceOp *op) Q_DECL_OVERRIDE;
+ QWaylandSurface::WindowType windowType() const;
-private Q_SLOTS:
- void mapped();
+ void mapPopup();
private:
+ void surfaceDestroyed();
+
Shell *m_shell;
Surface *m_surface;
- QWaylandSurfaceView *m_view;
- bool m_deleting;
ShellSurfaceResizeGrabber *m_resizeGrabber;
ShellSurfaceMoveGrabber *m_moveGrabber;
ShellSurfacePopupGrabber *m_popupGrabber;
+ ShellSurface *m_transientParent;
+
+ int32_t m_xOffset;
+ int32_t m_yOffset;
+
+ QWaylandSurface::WindowType m_windowType;
+
+ QPointF m_popupLocation;
uint32_t m_popupSerial;
QSet<uint32_t> m_pings;
@@ -156,8 +159,6 @@
const QString &title) Q_DECL_OVERRIDE;
void shell_surface_set_class(Resource *resource,
const QString &class_) Q_DECL_OVERRIDE;
-
- friend class ShellSurfaceMoveGrabber;
};
class ShellSurfaceGrabber : public PointerGrabber
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlsubsurface.cpp
^
|
@@ -42,7 +42,6 @@
#include "qwlcompositor_p.h"
#include "qwaylandsurface.h"
-#include "qwaylandsurfaceview.h"
QT_BEGIN_NAMESPACE
@@ -102,8 +101,7 @@
m_sub_surfaces.append(subSurface->m_surface->waylandSurface());
subSurface->setParent(this);
}
- foreach (QWaylandSurfaceView *view, subSurface->m_surface->waylandSurface()->views())
- view->setPos(QPointF(x,y));
+ subSurface->m_surface->setPos(QPointF(x,y));
}
void SubSurface::removeSubSurface(SubSurface *subSurfaces)
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlsurface.cpp
^
|
@@ -41,25 +41,38 @@
#include "qwlsurface_p.h"
#include "qwaylandsurface.h"
+#ifdef QT_COMPOSITOR_QUICK
+#include "qwaylandsurfaceitem.h"
+#endif
+
#include "qwlcompositor_p.h"
#include "qwlinputdevice_p.h"
#include "qwlextendedsurface_p.h"
#include "qwlregion_p.h"
#include "qwlsubsurface_p.h"
#include "qwlsurfacebuffer_p.h"
-#include "qwaylandsurfaceview.h"
+#include "qwlshellsurface_p.h"
#include <QtCore/QDebug>
#include <QTouchEvent>
-#include <QGuiApplication>
-#include <QScreen>
#include <wayland-server.h>
+#ifdef QT_COMPOSITOR_WAYLAND_GL
+#include "hardware_integration/qwlclientbufferintegration_p.h"
+#include <qpa/qplatformopenglcontext.h>
+#endif
+
+#ifdef QT_WAYLAND_WINDOWMANAGER_SUPPORT
+#include "waylandwindowmanagerintegration.h"
+#endif
+
QT_BEGIN_NAMESPACE
namespace QtWayland {
+static bool QT_WAYLAND_PRINT_BUFFERING_WARNINGS = qEnvironmentVariableIsSet("QT_WAYLAND_PRINT_BUFFERING_WARNINGS");
+
class FrameCallback {
public:
FrameCallback(Surface *surf, wl_resource *res)
@@ -104,23 +117,20 @@
bool canSend;
};
-Surface::Surface(struct wl_client *client, uint32_t id, int version, QWaylandCompositor *compositor, QWaylandSurface *surface)
- : QtWaylandServer::wl_surface(client, id, version)
- , m_compositor(compositor->handle())
- , m_waylandSurface(surface)
- , m_buffer(0)
+Surface::Surface(struct wl_client *client, uint32_t id, Compositor *compositor)
+ : QtWaylandServer::wl_surface(client, id)
+ , m_compositor(compositor)
+ , m_waylandSurface(new QWaylandSurface(this))
+ , m_backBuffer(0)
+ , m_frontBuffer(0)
, m_surfaceMapped(false)
- , m_attacher(0)
, m_extendedSurface(0)
, m_subSurface(0)
+ , m_shellSurface(0)
, m_inputPanelSurface(0)
- , m_transientParent(0)
, m_transientInactive(false)
- , m_transientOffset(QPointF(0, 0))
, m_isCursorSurface(false)
, m_destroyed(false)
- , m_contentOrientation(Qt::PrimaryOrientation)
- , m_visibility(QWindow::Hidden)
{
m_pending.buffer = 0;
m_pending.newlyAttached = false;
@@ -128,12 +138,11 @@
Surface::~Surface()
{
+ delete m_waylandSurface;
delete m_subSurface;
- m_bufferRef = QWaylandBufferRef();
-
for (int i = 0; i < m_bufferPool.size(); i++)
- m_bufferPool[i]->setDestroyIfUnused(true);
+ delete m_bufferPool[i];
foreach (FrameCallback *c, m_pendingFrameCallbacks)
c->destroy();
@@ -141,26 +150,24 @@
c->destroy();
}
-void Surface::setTransientOffset(qreal x, qreal y)
-{
- m_transientOffset.setX(x);
- m_transientOffset.setY(y);
-}
-
void Surface::releaseSurfaces()
{
-
+ delete m_waylandSurface;
+ m_waylandSurface = 0;
+ delete m_subSurface;
+ m_subSurface = 0;
}
Surface *Surface::fromResource(struct ::wl_resource *resource)
{
- return static_cast<Surface *>(Resource::fromResource(resource)->surface_object);
+ return static_cast<Surface *>(Resource::fromResource(resource)->surface);
}
QWaylandSurface::Type Surface::type() const
{
- if (m_buffer && m_buffer->waylandBufferHandle()) {
- if (m_buffer->isShmBuffer()) {
+ SurfaceBuffer *surfaceBuffer = currentSurfaceBuffer();
+ if (surfaceBuffer && surfaceBuffer->waylandBufferHandle()) {
+ if (surfaceBuffer->isShmBuffer()) {
return QWaylandSurface::Shm;
} else {
return QWaylandSurface::Texture;
@@ -171,14 +178,45 @@
bool Surface::isYInverted() const
{
- if (m_buffer)
- return m_buffer->isYInverted();
- return false;
+ bool ret = false;
+ static bool negateReturn = qgetenv("QT_COMPOSITOR_NEGATE_INVERTED_Y").toInt();
+ ClientBufferIntegration *clientBufferIntegration = m_compositor->clientBufferIntegration();
+
+#ifdef QT_COMPOSITOR_WAYLAND_GL
+ SurfaceBuffer *surfacebuffer = currentSurfaceBuffer();
+ if (!surfacebuffer) {
+ ret = false;
+ } else if (clientBufferIntegration && surfacebuffer->waylandBufferHandle() && type() != QWaylandSurface::Shm) {
+ ret = clientBufferIntegration->isYInverted(surfacebuffer->waylandBufferHandle());
+ } else
+#endif
+ ret = true;
+
+ return ret != negateReturn;
}
bool Surface::mapped() const
{
- return m_buffer ? bool(m_buffer->waylandBufferHandle()) : false;
+ SurfaceBuffer *surfacebuffer = currentSurfaceBuffer();
+ return surfacebuffer ? bool(surfacebuffer->waylandBufferHandle()) : false;
+}
+
+QPointF Surface::pos() const
+{
+ return m_shellSurface ? m_shellSurface->adjustedPosToTransientParent() : m_position;
+}
+
+QPointF Surface::nonAdjustedPos() const
+{
+ return m_position;
+}
+
+void Surface::setPos(const QPointF &pos)
+{
+ bool emitChange = pos != m_position;
+ m_position = pos;
+ if (emitChange)
+ m_waylandSurface->posChanged();
}
QSize Surface::size() const
@@ -192,6 +230,9 @@
m_opaqueRegion = QRegion();
m_inputRegion = QRegion(QRect(QPoint(), size));
m_size = size;
+ if (m_shellSurface) {
+ m_shellSurface->adjustPosInResize();
+ }
m_waylandSurface->sizeChanged();
}
}
@@ -206,6 +247,28 @@
return m_opaqueRegion;
}
+QImage Surface::image() const
+{
+ SurfaceBuffer *surfacebuffer = currentSurfaceBuffer();
+ if (surfacebuffer && !surfacebuffer->isDestroyed() && type() == QWaylandSurface::Shm) {
+ return surfacebuffer->image();
+ }
+ return QImage();
+}
+
+#ifdef QT_COMPOSITOR_WAYLAND_GL
+GLuint Surface::textureId() const
+{
+ const SurfaceBuffer *surfacebuffer = m_frontBuffer;
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlsurface_p.h
^
|
@@ -45,17 +45,19 @@
#include <private/qwlsurfacebuffer_p.h>
#include <QtCompositor/qwaylandsurface.h>
-#include <QtCompositor/qwaylandbufferref.h>
#include <QtCore/QVector>
#include <QtCore/QRect>
#include <QtGui/QRegion>
#include <QtGui/QImage>
-#include <QtGui/QWindow>
#include <QtCore/QTextStream>
#include <QtCore/QMetaType>
+#ifdef QT_COMPOSITOR_WAYLAND_GL
+#include <QtGui/qopengl.h>
+#endif
+
#include <wayland-util.h>
#include <QtCompositor/private/qwayland-server-wayland.h>
@@ -71,12 +73,13 @@
class ExtendedSurface;
class InputPanelSurface;
class SubSurface;
+class ShellSurface;
class FrameCallback;
class Q_COMPOSITOR_EXPORT Surface : public QtWaylandServer::wl_surface
{
public:
- Surface(struct wl_client *client, uint32_t id, int version, QWaylandCompositor *compositor, QWaylandSurface *surface);
+ Surface(struct wl_client *client, uint32_t id, Compositor *compositor);
~Surface();
static Surface *fromResource(struct ::wl_resource *resource);
@@ -88,12 +91,22 @@
using QtWaylandServer::wl_surface::resource;
+ QPointF pos() const;
+ QPointF nonAdjustedPos() const;
+ void setPos(const QPointF &pos);
+
QSize size() const;
void setSize(const QSize &size);
QRegion inputRegion() const;
QRegion opaqueRegion() const;
+ QImage image() const;
+
+#ifdef QT_COMPOSITOR_WAYLAND_GL
+ GLuint textureId() const;
+#endif
+
void sendFrameCallback();
void removeFrameCallback(FrameCallback *callback);
@@ -107,6 +120,9 @@
void setSubSurface(SubSurface *subSurface);
SubSurface *subSurface() const;
+ void setShellSurface(ShellSurface *shellSurface);
+ ShellSurface *shellSurface() const;
+
void setInputPanelSurface(InputPanelSurface *inputPanelSurface);
InputPanelSurface *inputPanelSurface() const;
@@ -118,53 +134,29 @@
QString title() const { return m_title; }
void setTitle(const QString &title);
- Surface *transientParent() const { return m_transientParent; }
- void setTransientParent(Surface *parent) { m_transientParent = parent; }
-
bool transientInactive() const { return m_transientInactive; }
void setTransientInactive(bool v) { m_transientInactive = v; }
- void setTransientOffset(qreal x, qreal y);
-
bool isCursorSurface() const { return m_isCursorSurface; }
void setCursorSurface(bool isCursor) { m_isCursorSurface = isCursor; }
+ void swapBuffers();
void releaseSurfaces();
void frameStarted();
-
- void setMapped(bool mapped);
-
inline bool isDestroyed() const { return m_destroyed; }
- Qt::ScreenOrientation contentOrientation() const;
-
-protected:
- void surface_destroy_resource(Resource *resource) Q_DECL_OVERRIDE;
-
- void surface_destroy(Resource *resource) Q_DECL_OVERRIDE;
- void surface_attach(Resource *resource,
- struct wl_resource *buffer, int x, int y) Q_DECL_OVERRIDE;
- void surface_damage(Resource *resource,
- int32_t x, int32_t y, int32_t width, int32_t height) Q_DECL_OVERRIDE;
- void surface_frame(Resource *resource,
- uint32_t callback) Q_DECL_OVERRIDE;
- void surface_set_opaque_region(Resource *resource,
- struct wl_resource *region) Q_DECL_OVERRIDE;
- void surface_set_input_region(Resource *resource,
- struct wl_resource *region) Q_DECL_OVERRIDE;
- void surface_commit(Resource *resource) Q_DECL_OVERRIDE;
- void surface_set_buffer_transform(Resource *resource, int32_t transform) Q_DECL_OVERRIDE;
+ void setCompositorVisible(bool visible);
+private:
Q_DISABLE_COPY(Surface)
Compositor *m_compositor;
QWaylandSurface *m_waylandSurface;
+ SurfaceBuffer *m_backBuffer;
QRegion m_damage;
- SurfaceBuffer *m_buffer;
- QWaylandBufferRef m_bufferRef;
+ SurfaceBuffer *m_frontBuffer;
bool m_surfaceMapped;
- QWaylandBufferAttacher *m_attacher;
struct {
SurfaceBuffer *buffer;
@@ -181,6 +173,7 @@
ExtendedSurface *m_extendedSurface;
SubSurface *m_subSurface;
+ ShellSurface *m_shellSurface;
InputPanelSurface *m_inputPanelSurface;
QRegion m_inputRegion;
@@ -188,24 +181,40 @@
QVector<SurfaceBuffer *> m_bufferPool;
+ QPointF m_position;
QSize m_size;
QString m_className;
QString m_title;
- Surface *m_transientParent;
bool m_transientInactive;
- QPointF m_transientOffset;
bool m_isCursorSurface;
+
+ inline SurfaceBuffer *currentSurfaceBuffer() const;
bool m_destroyed;
- Qt::ScreenOrientation m_contentOrientation;
- QWindow::Visibility m_visibility;
void setBackBuffer(SurfaceBuffer *buffer);
SurfaceBuffer *createSurfaceBuffer(struct ::wl_resource *buffer);
- friend class QWaylandSurface;
- friend class ExtendedSurface;
+ void surface_destroy_resource(Resource *resource) Q_DECL_OVERRIDE;
+
+ void surface_destroy(Resource *resource) Q_DECL_OVERRIDE;
+ void surface_attach(Resource *resource,
+ struct wl_resource *buffer, int x, int y) Q_DECL_OVERRIDE;
+ void surface_damage(Resource *resource,
+ int32_t x, int32_t y, int32_t width, int32_t height) Q_DECL_OVERRIDE;
+ void surface_frame(Resource *resource,
+ uint32_t callback) Q_DECL_OVERRIDE;
+ void surface_set_opaque_region(Resource *resource,
+ struct wl_resource *region) Q_DECL_OVERRIDE;
+ void surface_set_input_region(Resource *resource,
+ struct wl_resource *region) Q_DECL_OVERRIDE;
+ void surface_commit(Resource *resource) Q_DECL_OVERRIDE;
+
};
+inline SurfaceBuffer *Surface::currentSurfaceBuffer() const {
+ return m_backBuffer? m_backBuffer : m_frontBuffer;
+}
+
}
QT_END_NAMESPACE
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp
^
|
@@ -68,8 +68,6 @@
, m_shmBuffer(0)
, m_isSizeResolved(false)
, m_size()
- , m_used(false)
- , m_destroyIfUnused(false)
, m_image(0)
{
}
@@ -103,6 +101,7 @@
void SurfaceBuffer::destructBufferState()
{
destroyTexture();
+
if (m_buffer) {
sendRelease();
@@ -112,7 +111,7 @@
#ifdef QT_COMPOSITOR_WAYLAND_GL
} else {
ClientBufferIntegration *hwIntegration = m_compositor->clientBufferIntegration();
- hwIntegration->unlockNativeBuffer(m_handle);
+ hwIntegration->unlockNativeBuffer(m_handle, 0);
#endif
}
}
@@ -166,7 +165,6 @@
{
m_surface_has_buffer = false;
destructBufferState();
- destroyIfUnused();
}
void SurfaceBuffer::setDisplayed()
@@ -216,7 +214,7 @@
#ifdef QT_COMPOSITOR_WAYLAND_GL
} else {
ClientBufferIntegration *clientBufferIntegration = m_compositor->clientBufferIntegration();
- that->m_handle = clientBufferIntegration->lockNativeBuffer(m_buffer);
+ that->m_handle = clientBufferIntegration->lockNativeBuffer(m_buffer, 0);
#endif
}
}
@@ -241,6 +239,11 @@
return m_image;
}
+void SurfaceBuffer::bufferWasDestroyed()
+{
+ destroyTexture();
+}
+
void SurfaceBuffer::destroy_listener_callback(wl_listener *listener, void *data)
{
Q_UNUSED(data);
@@ -250,14 +253,16 @@
// Mark the buffer as destroyed and clear m_buffer right away to avoid
// touching it before it is properly cleaned up.
+ // Then, if it has a texture, schedule the texture to be released on the
+ // render thread later on.
d->m_destroyed = true;
d->m_buffer = 0;
+ if (d->m_texture)
+ d->m_compositor->bufferWasDestroyed(d);
}
void SurfaceBuffer::createTexture()
{
- destroyTexture();
-
ClientBufferIntegration *hwIntegration = m_compositor->clientBufferIntegration();
#ifdef QT_COMPOSITOR_WAYLAND_GL
if (!m_texture)
@@ -268,49 +273,10 @@
hwIntegration->bindTextureToBuffer(m_buffer);
#else
Q_UNUSED(hwIntegration);
+ Q_UNUSED(context);
#endif
}
-bool SurfaceBuffer::isYInverted() const
-{
- bool ret = false;
- static bool negateReturn = qgetenv("QT_COMPOSITOR_NEGATE_INVERTED_Y").toInt();
- ClientBufferIntegration *clientBufferIntegration = m_compositor->clientBufferIntegration();
-
-#ifdef QT_COMPOSITOR_WAYLAND_GL
- if (clientBufferIntegration && waylandBufferHandle() && !isShmBuffer()) {
- ret = clientBufferIntegration->isYInverted(waylandBufferHandle());
- } else
-#endif
- ret = true;
-
- return ret != negateReturn;
-}
-
-void SurfaceBuffer::ref()
-{
- m_used = m_refCount.ref();
-}
-
-void SurfaceBuffer::deref()
-{
- m_used = m_refCount.deref();
- if (!m_used)
- disown();
-}
-
-void SurfaceBuffer::setDestroyIfUnused(bool destroy)
-{
- m_destroyIfUnused = destroy;
- destroyIfUnused();
-}
-
-void SurfaceBuffer::destroyIfUnused()
-{
- if (!m_used && m_destroyIfUnused)
- delete this;
-}
-
}
QT_END_NAMESPACE
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h
^
|
@@ -44,14 +44,12 @@
#include <QtCore/QRect>
#include <QtGui/qopengl.h>
#include <QImage>
-#include <QAtomicInt>
#include <wayland-server.h>
QT_BEGIN_NAMESPACE
class QWaylandClientBufferIntegration;
-class QWaylandBufferRef;
namespace QtWayland {
@@ -77,7 +75,6 @@
QSize size() const;
bool isShmBuffer() const;
- bool isYInverted() const;
inline bool isRegisteredWithBuffer() const { return m_is_registered_for_buffer; }
@@ -104,15 +101,10 @@
void handleDisplayed();
void bufferWasDestroyed();
- void setDestroyIfUnused(bool destroy);
void *handle() const;
QImage image();
private:
- void ref();
- void deref();
- void destroyIfUnused();
-
Surface *m_surface;
Compositor *m_compositor;
struct ::wl_resource *m_buffer;
@@ -139,15 +131,10 @@
mutable bool m_isSizeResolved;
mutable QSize m_size;
- QAtomicInt m_refCount;
- bool m_used;
- bool m_destroyIfUnused;
QImage m_image;
static void destroy_listener_callback(wl_listener *listener, void *data);
-
- friend class ::QWaylandBufferRef;
};
GLuint SurfaceBuffer::texture() const
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwltextinput.cpp
^
|
@@ -54,7 +54,7 @@
namespace QtWayland {
TextInput::TextInput(Compositor *compositor, struct ::wl_client *client, int id)
- : wl_text_input(client, id, 1)
+ : wl_text_input(client, id)
, m_compositor(compositor)
, m_focus()
, m_inputPanelVisible()
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwltextinputmanager.cpp
^
|
@@ -48,7 +48,7 @@
namespace QtWayland {
TextInputManager::TextInputManager(Compositor *compositor)
- : QtWaylandServer::wl_text_input_manager(compositor->wl_display(), 1)
+ : QtWaylandServer::wl_text_input_manager(compositor->wl_display())
, m_compositor(compositor)
{
}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwltouch.cpp
^
|
@@ -43,9 +43,6 @@
#include "qwlcompositor_p.h"
#include "qwlsurface_p.h"
-#include "qwaylandsurfaceview.h"
-
-QT_BEGIN_NAMESPACE
namespace QtWayland {
@@ -57,17 +54,20 @@
, m_grab(this)
{
m_grab->setTouch(this);
- connect(&m_focusDestroyListener, &WlListener::fired, this, &Touch::focusDestroyed);
+ m_focusDestroyListener.parent = this;
+ m_focusDestroyListener.listener.notify = focusDestroyed;
+ wl_list_init(&m_focusDestroyListener.listener.link);
}
-void Touch::setFocus(QWaylandSurfaceView *surface)
+void Touch::setFocus(Surface *surface)
{
- m_focusDestroyListener.reset();
+ wl_list_remove(&m_focusDestroyListener.listener.link);
+ wl_list_init(&m_focusDestroyListener.listener.link);
if (surface)
- m_focusDestroyListener.listenForDestruction(surface->surface()->handle()->resource()->handle);
+ wl_signal_add(&surface->resource()->handle->destroy_signal, &m_focusDestroyListener.listener);
m_focus = surface;
- m_focusResource = surface ? resourceMap().value(surface->surface()->handle()->resource()->client()) : 0;
+ m_focusResource = surface ? resourceMap().value(surface->resource()->client()) : 0;
}
void Touch::startGrab(TouchGrabber *grab)
@@ -81,13 +81,15 @@
m_grab = this;
}
-void Touch::focusDestroyed(void *data)
+void Touch::focusDestroyed(wl_listener *listener, void *data)
{
Q_UNUSED(data)
- m_focusDestroyListener.reset();
+ Touch *touch = reinterpret_cast<Listener *>(listener)->parent;
+ wl_list_remove(&touch->m_focusDestroyListener.listener.link);
+ wl_list_init(&touch->m_focusDestroyListener.listener.link);
- m_focus = 0;
- m_focusResource = 0;
+ touch->m_focus = 0;
+ touch->m_focusResource = 0;
}
void Touch::sendCancel()
@@ -124,7 +126,7 @@
uint32_t serial = wl_display_next_serial(m_compositor->wl_display());
- send_down(m_focusResource->handle, serial, time, m_focus->surface()->handle()->resource()->handle, touch_id,
+ send_down(m_focusResource->handle, serial, time, m_focus->resource()->handle, touch_id,
wl_fixed_from_double(position.x()), wl_fixed_from_double(position.y()));
}
@@ -172,5 +174,3 @@
}
} // namespace QtWayland
-
-QT_END_NAMESPACE
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/qwltouch_p.h
^
|
@@ -45,16 +45,11 @@
#include <QtCompositor/qwaylandexport.h>
#include <QtCore/QPoint>
-#include <QtCore/QObject>
#include <QtCompositor/private/qwayland-server-wayland.h>
-#include "qwllistener_p.h"
-
QT_BEGIN_NAMESPACE
-class QWaylandSurfaceView;
-
namespace QtWayland {
class Compositor;
@@ -78,12 +73,12 @@
Touch *m_touch;
};
-class Q_COMPOSITOR_EXPORT Touch : public QObject, public QtWaylandServer::wl_touch, public TouchGrabber
+class Q_COMPOSITOR_EXPORT Touch : public QtWaylandServer::wl_touch, public TouchGrabber
{
public:
explicit Touch(Compositor *compositor);
- void setFocus(QWaylandSurfaceView *surface);
+ void setFocus(Surface *surface);
void startGrab(TouchGrabber *grab);
void endGrab();
@@ -100,13 +95,18 @@
void motion(uint32_t time, int touch_id, const QPointF &position);
private:
- void focusDestroyed(void *data);
+ static void focusDestroyed(wl_listener *listener, void *data);
Compositor *m_compositor;
- QWaylandSurfaceView *m_focus;
+ Surface *m_focus;
Resource *m_focusResource;
- WlListener m_focusDestroyListener;
+ struct Listener
+ {
+ wl_listener listener;
+ Touch *parent;
+ };
+ Listener m_focusDestroyListener;
TouchGrabber *m_grab;
};
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/wayland_wrapper/wayland_wrapper.pri
^
|
@@ -37,7 +37,6 @@
wayland_wrapper/qwltextinput_p.h \
wayland_wrapper/qwltextinputmanager_p.h \
wayland_wrapper/qwltouch_p.h \
- wayland_wrapper/qwllistener_p.h \
SOURCES += \
wayland_wrapper/qwlcompositor.cpp \
@@ -66,7 +65,6 @@
wayland_wrapper/qwltextinput.cpp \
wayland_wrapper/qwltextinputmanager.cpp \
wayland_wrapper/qwltouch.cpp \
- wayland_wrapper/qwllistener.cpp \
INCLUDEPATH += wayland_wrapper
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/windowmanagerprotocol/waylandwindowmanagerintegration.cpp
^
|
@@ -38,7 +38,7 @@
**
****************************************************************************/
-#include <windowmanagerprotocol/waylandwindowmanagerintegration_p.h>
+#include "waylandwindowmanagerintegration.h"
#include <wayland_wrapper/qwldisplay_p.h>
#include <wayland_wrapper/qwlcompositor_p.h>
@@ -65,7 +65,7 @@
void WindowManagerServerIntegration::initialize(QtWayland::Display *waylandDisplay)
{
- init(waylandDisplay->handle(), 1);
+ init(waylandDisplay->handle());
}
void WindowManagerServerIntegration::setShowIsFullScreen(bool value)
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/windowmanagerprotocol/waylandwindowmanagerintegration.h
^
|
(renamed from src/compositor/windowmanagerprotocol/waylandwindowmanagerintegration_p.h)
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/compositor/windowmanagerprotocol/windowmanagerprotocol.pri
^
|
@@ -1,7 +1,7 @@
INCLUDEPATH += $$PWD
HEADERS += \
- windowmanagerprotocol/waylandwindowmanagerintegration_p.h
+ windowmanagerprotocol/waylandwindowmanagerintegration.h
SOURCES += \
windowmanagerprotocol/waylandwindowmanagerintegration.cpp
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/extensions/output-extension.xml
^
|
@@ -46,6 +46,19 @@
</interface>
<interface name="qt_extended_output" version="1">
+ <enum name="rotation">
+ <entry name="PortraitOrientation" value="1"/>
+ <entry name="LandscapeOrientation" value="2"/>
+ <entry name="InvertedPortraitOrientation" value="4"/>
+ <entry name="InvertedLandscapeOrientation" value="8"/>
+ </enum>
+ <event name="set_screen_rotation">
+ <arg name="rotation" type="int"/>
+ </event>
+
+ <request name="set_orientation_update_mask">
+ <arg name="orientation" type="int"/>
+ </request>
</interface>
</protocol>
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/extensions/surface-extension.xml
^
|
@@ -38,14 +38,14 @@
$QT_END_LICENSE$
</copyright>
- <interface name="qt_surface_extension" version="2">
+ <interface name="qt_surface_extension" version="1">
<request name="get_extended_surface">
<arg name="id" type="new_id" interface="qt_extended_surface"/>
<arg name="surface" type="object" interface="wl_surface"/>
</request>
</interface>
- <interface name="qt_extended_surface" version="2">
+ <interface name="qt_extended_surface" version="1">
<event name="onscreen_visibility">
<arg name="visible" type="int"/>
</event>
@@ -91,9 +91,5 @@
<request name="lower">
</request>
- <request name="set_content_orientation_mask" since="2">
- <arg name="orientation" type="int"/>
- </request>
-
</interface>
</protocol>
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h
^
|
@@ -68,7 +68,6 @@
void initialize(QWaylandDisplay *waylandDisplay);
bool supportsThreadedOpenGL() const { return true; }
- bool supportsWindowDecoration() const { return false; }
QWaylandWindow *createEglWindow(QWindow *window);
QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const;
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp
^
|
@@ -150,7 +150,7 @@
Q_UNUSED(version);
if (interface == QStringLiteral("qt_drm_egl_server_buffer")) {
struct ::wl_registry *registry = QtWayland::wl_registry::object();
- QtWayland::qt_drm_egl_server_buffer::init(registry, name, 1);
+ QtWayland::qt_drm_egl_server_buffer::init(registry, name);
}
}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.cpp
^
|
@@ -159,7 +159,7 @@
Q_UNUSED(version);
if (interface == QStringLiteral("qt_libhybris_egl_server_buffer")) {
struct ::wl_registry *registry = QtWayland::wl_registry::object();
- QtWayland::qt_libhybris_egl_server_buffer::init(registry, name, 1);
+ QtWayland::qt_libhybris_egl_server_buffer::init(registry, name);
}
}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp
^
|
@@ -56,7 +56,7 @@
};
QWaylandEglClientBufferIntegration::QWaylandEglClientBufferIntegration()
- : m_display(0)
+ : m_waylandDisplay(0)
, m_supportsThreading(false)
{
qDebug() << "Using Wayland-EGL";
@@ -75,10 +75,10 @@
setenv("EGL_PLATFORM","wayland",true);
}
- m_display = display;
+ m_waylandDisplay = display->wl_display();
EGLint major,minor;
- m_eglDisplay = eglGetDisplay((EGLNativeDisplayType) display->wl_display());
+ m_eglDisplay = eglGetDisplay((EGLNativeDisplayType) m_waylandDisplay);
if (m_eglDisplay == NULL) {
qWarning("EGL not available");
} else {
@@ -106,11 +106,6 @@
return m_supportsThreading;
}
-bool QWaylandEglClientBufferIntegration::supportsWindowDecoration() const
-{
- return true;
-}
-
QWaylandWindow *QWaylandEglClientBufferIntegration::createEglWindow(QWindow *window)
{
return new QWaylandEglWindow(window);
@@ -118,7 +113,7 @@
QPlatformOpenGLContext *QWaylandEglClientBufferIntegration::createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const
{
- return new QWaylandGLContext(m_eglDisplay, m_display, glFormat, share);
+ return new QWaylandGLContext(m_eglDisplay, glFormat, share);
}
EGLDisplay QWaylandEglClientBufferIntegration::eglDisplay() const
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.h
^
|
@@ -59,7 +59,6 @@
void initialize(QWaylandDisplay *display) Q_DECL_OVERRIDE;
bool supportsThreadedOpenGL() const Q_DECL_OVERRIDE;
- bool supportsWindowDecoration() const Q_DECL_OVERRIDE;
QWaylandWindow *createEglWindow(QWindow *window) Q_DECL_OVERRIDE;
QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const Q_DECL_OVERRIDE;
@@ -67,7 +66,7 @@
EGLDisplay eglDisplay() const;
private:
- QWaylandDisplay *m_display;
+ struct wl_display *m_waylandDisplay;
EGLDisplay m_eglDisplay;
bool m_supportsThreading;
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
^
|
@@ -59,15 +59,11 @@
, m_clientBufferIntegration(static_cast<QWaylandEglClientBufferIntegration *>(mDisplay->clientBufferIntegration()))
, m_waylandEglWindow(0)
, m_eglSurface(0)
+ , m_eglConfig(q_configFromGLFormat(m_clientBufferIntegration->eglDisplay(), window->requestedFormat(), true))
, m_contentFBO(0)
, m_resize(false)
+ , m_format(q_glFormatFromConfig(m_clientBufferIntegration->eglDisplay(), m_eglConfig))
{
- QSurfaceFormat fmt = window->requestedFormat();
- if (mDisplay->supportsWindowDecoration())
- fmt.setAlphaBufferSize(8);
- m_eglConfig = q_configFromGLFormat(m_clientBufferIntegration->eglDisplay(), fmt);
- m_format = q_glFormatFromConfig(m_clientBufferIntegration->eglDisplay(), m_eglConfig);
-
updateSurface(true);
}
@@ -100,6 +96,7 @@
void QWaylandEglWindow::updateSurface(bool create)
{
+ createDecoration();
QMargins margins = frameMargins();
QRect rect = geometry();
QSize sizeWithMargins = rect.size() + QSize(margins.left() + margins.right(), margins.top() + margins.bottom());
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
^
|
@@ -43,226 +43,31 @@
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
#include <QtWaylandClient/private/qwaylandwindow_p.h>
-#include <QtWaylandClient/private/qwaylandabstractdecoration_p.h>
-#include <QtWaylandClient/private/qwaylandintegration_p.h>
+#include <QtWaylandClient/private/qwaylanddecoration_p.h>
#include "qwaylandeglwindow.h"
#include <QDebug>
#include <QtPlatformSupport/private/qeglconvenience_p.h>
#include <QtGui/private/qopenglcontext_p.h>
#include <QtGui/private/qopengltexturecache_p.h>
-#include <QtGui/private/qguiapplication_p.h>
#include <qpa/qplatformopenglcontext.h>
#include <QtGui/QSurfaceFormat>
#include <QtGui/QOpenGLShaderProgram>
-#include <QtGui/QOpenGLFunctions>
-
-// Constants from EGL_KHR_create_context
-#ifndef EGL_CONTEXT_MINOR_VERSION_KHR
-#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB
-#endif
-#ifndef EGL_CONTEXT_FLAGS_KHR
-#define EGL_CONTEXT_FLAGS_KHR 0x30FC
-#endif
-#ifndef EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR
-#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD
-#endif
-#ifndef EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR
-#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001
-#endif
-#ifndef EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR
-#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002
-#endif
-#ifndef EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR
-#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001
-#endif
-#ifndef EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR
-#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002
-#endif
-
-// Constants for OpenGL which are not available in the ES headers.
-#ifndef GL_CONTEXT_FLAGS
-#define GL_CONTEXT_FLAGS 0x821E
-#endif
-#ifndef GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT
-#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001
-#endif
-#ifndef GL_CONTEXT_FLAG_DEBUG_BIT
-#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002
-#endif
-#ifndef GL_CONTEXT_PROFILE_MASK
-#define GL_CONTEXT_PROFILE_MASK 0x9126
-#endif
-#ifndef GL_CONTEXT_CORE_PROFILE_BIT
-#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001
-#endif
-#ifndef GL_CONTEXT_COMPATIBILITY_PROFILE_BIT
-#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
-#endif
QT_BEGIN_NAMESPACE
-class DecorationsBlitter : public QOpenGLFunctions
-{
-public:
- DecorationsBlitter(QWaylandGLContext *context)
- : m_context(context)
- {
- initializeOpenGLFunctions();
- m_blitProgram = new QOpenGLShaderProgram();
- m_blitProgram->addShaderFromSourceCode(QOpenGLShader::Vertex, "attribute vec4 position;\n\
- attribute vec4 texCoords;\n\
- varying vec2 outTexCoords;\n\
- void main()\n\
- {\n\
- gl_Position = position;\n\
- outTexCoords = texCoords.xy;\n\
- }");
- m_blitProgram->addShaderFromSourceCode(QOpenGLShader::Fragment, "varying highp vec2 outTexCoords;\n\
- uniform sampler2D texture;\n\
- void main()\n\
- {\n\
- gl_FragColor = texture2D(texture, outTexCoords);\n\
- }");
-
- m_blitProgram->bindAttributeLocation("position", 0);
- m_blitProgram->bindAttributeLocation("texCoords", 1);
-
- if (!m_blitProgram->link()) {
- qDebug() << "Shader Program link failed.";
- qDebug() << m_blitProgram->log();
- }
- }
- ~DecorationsBlitter()
- {
- delete m_blitProgram;
- }
- void blit(QWaylandEglWindow *window)
- {
- QOpenGLTextureCache *cache = QOpenGLTextureCache::cacheForContext(m_context->context());
-
- QRect windowRect = window->window()->frameGeometry();
- glViewport(0, 0, windowRect.width(), windowRect.height());
-
- glDisable(GL_DEPTH_TEST);
- glDisable(GL_BLEND);
- glDisable(GL_CULL_FACE);
- glDisable(GL_SCISSOR_TEST);
- glDepthMask(GL_FALSE);
- glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
-
- m_context->mUseNativeDefaultFbo = true;
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
- m_context->mUseNativeDefaultFbo = false;
-
- static const GLfloat squareVertices[] = {
- -1.f, -1.f,
- 1.0f, -1.f,
- -1.f, 1.0f,
- 1.0f, 1.0f
- };
-
- static const GLfloat inverseSquareVertices[] = {
- -1.f, 1.f,
- 1.f, 1.f,
- -1.f, -1.f,
- 1.f, -1.f
- };
-
- static const GLfloat textureVertices[] = {
- 0.0f, 0.0f,
- 1.0f, 0.0f,
- 0.0f, 1.0f,
- 1.0f, 1.0f,
- };
-
- glBindBuffer(GL_ARRAY_BUFFER, 0);
- m_blitProgram->bind();
-
- m_blitProgram->enableAttributeArray(0);
- m_blitProgram->enableAttributeArray(1);
- m_blitProgram->setAttributeArray(1, textureVertices, 2);
-
- glActiveTexture(GL_TEXTURE0);
-
- //Draw Decoration
- m_blitProgram->setAttributeArray(0, inverseSquareVertices, 2);
- QImage decorationImage = window->decoration()->contentImage();
- cache->bindTexture(m_context->context(), decorationImage);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- if (m_context->context()->functions()->hasOpenGLFeature(QOpenGLFunctions::NPOTTextureRepeat)) {
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
- } else {
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- }
- glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
-
- //Draw Content
- m_blitProgram->setAttributeArray(0, squareVertices, 2);
- glBindTexture(GL_TEXTURE_2D, window->contentTexture());
- QRect r = window->contentsRect();
- glViewport(r.x(), r.y(), r.width(), r.height());
- glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
-
- //Cleanup
- m_blitProgram->disableAttributeArray(0);
- m_blitProgram->disableAttributeArray(1);
- }
-
- QOpenGLShaderProgram *m_blitProgram;
- QWaylandGLContext *m_context;
-};
-
-
-
-QWaylandGLContext::QWaylandGLContext(EGLDisplay eglDisplay, QWaylandDisplay *display, const QSurfaceFormat &format, QPlatformOpenGLContext *share)
+QWaylandGLContext::QWaylandGLContext(EGLDisplay eglDisplay, const QSurfaceFormat &format, QPlatformOpenGLContext *share)
: QPlatformOpenGLContext()
, m_eglDisplay(eglDisplay)
- , m_display(display)
- , m_blitter(0)
+ , m_config(q_configFromGLFormat(m_eglDisplay, format, true))
+ , m_format(q_glFormatFromConfig(m_eglDisplay, m_config))
+ , m_blitProgram(0)
+ , m_textureCache(0)
, mUseNativeDefaultFbo(false)
{
- QSurfaceFormat fmt = format;
- if (static_cast<QWaylandIntegration *>(QGuiApplicationPrivate::platformIntegration())->display()->supportsWindowDecoration())
- fmt.setAlphaBufferSize(8);
- m_config = q_configFromGLFormat(m_eglDisplay, fmt);
- m_format = q_glFormatFromConfig(m_eglDisplay, m_config);
m_shareEGLContext = share ? static_cast<QWaylandGLContext *>(share)->eglContext() : EGL_NO_CONTEXT;
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h
^
|
@@ -45,6 +45,7 @@
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
#include <qpa/qplatformopenglcontext.h>
+#include <QtGui/QOpenGLFunctions>
#include "qwaylandeglinclude.h"
@@ -54,12 +55,11 @@
class QWaylandGLWindowSurface;
class QOpenGLShaderProgram;
class QOpenGLTextureCache;
-class DecorationsBlitter;
-class QWaylandGLContext : public QPlatformOpenGLContext
+class QWaylandGLContext : public QPlatformOpenGLContext, protected QOpenGLFunctions
{
public:
- QWaylandGLContext(EGLDisplay eglDisplay, QWaylandDisplay *display, const QSurfaceFormat &format, QPlatformOpenGLContext *share);
+ QWaylandGLContext(EGLDisplay eglDisplay, const QSurfaceFormat &format, QPlatformOpenGLContext *share);
~QWaylandGLContext();
void swapBuffers(QPlatformSurface *surface);
@@ -80,18 +80,15 @@
EGLContext eglContext() const { return m_context; }
private:
- void updateGLFormat();
-
EGLDisplay m_eglDisplay;
- QWaylandDisplay *m_display;
+
EGLContext m_context;
EGLContext m_shareEGLContext;
EGLConfig m_config;
QSurfaceFormat m_format;
- DecorationsBlitter *m_blitter;
+ QOpenGLShaderProgram *m_blitProgram;
+ QOpenGLTextureCache *m_textureCache;
bool mUseNativeDefaultFbo;
-
- friend class DecorationsBlitter;
};
QT_END_NAMESPACE
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp
^
|
@@ -44,7 +44,6 @@
#include "qwaylandxcompositeeglwindow.h"
#include <QtCore/QDebug>
-#include <QtPlatformSupport/private/qeglconvenience_p.h>
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
@@ -82,9 +81,7 @@
QPlatformOpenGLContext *QWaylandXCompositeEGLClientBufferIntegration::createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const
{
- EGLDisplay display = eglDisplay();
- EGLConfig config = q_configFromGLFormat(display, glFormat, true, EGL_WINDOW_BIT | EGL_PIXMAP_BIT);
- return new QWaylandXCompositeEGLContext(glFormat, share, display, config);
+ return new QWaylandXCompositeEGLContext(glFormat, share, eglDisplay());
}
Display * QWaylandXCompositeEGLClientBufferIntegration::xDisplay() const
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h
^
|
@@ -65,7 +65,6 @@
#endif
struct qt_xcomposite;
-struct qt_xcomposite_listener;
QT_BEGIN_NAMESPACE
@@ -89,7 +88,6 @@
Window rootWindow() const;
bool supportsThreadedOpenGL() const { return true; }
- bool supportsWindowDecoration() const { return false; }
private:
QWaylandDisplay *mWaylandDisplay;
@@ -103,7 +101,7 @@
static void wlDisplayHandleGlobal(void *data, struct wl_registry *registry, uint32_t id,
const QString &interface, uint32_t version);
- static const struct ::qt_xcomposite_listener xcomposite_listener;
+ static const struct qt_xcomposite_listener xcomposite_listener;
static void rootInformation(void *data,
struct qt_xcomposite *xcomposite,
const char *display_name,
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.cpp
^
|
@@ -50,8 +50,8 @@
QT_BEGIN_NAMESPACE
-QWaylandXCompositeEGLContext::QWaylandXCompositeEGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display, EGLConfig config)
- : QEGLPlatformContext(format, share, display, &config)
+QWaylandXCompositeEGLContext::QWaylandXCompositeEGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display)
+ : QEGLPlatformContext(format, share, display, q_configFromGLFormat(display, format, true, EGL_WINDOW_BIT | EGL_PIXMAP_BIT))
{
}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.h
^
|
@@ -55,7 +55,7 @@
class QWaylandXCompositeEGLContext : public QEGLPlatformContext
{
public:
- QWaylandXCompositeEGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display, EGLConfig config);
+ QWaylandXCompositeEGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display);
void swapBuffers(QPlatformSurface *surface);
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.cpp
^
|
@@ -67,7 +67,7 @@
GLXFBConfig config = qglx_findConfig(display, screen, m_format, GLX_WINDOW_BIT | GLX_PIXMAP_BIT);
XVisualInfo *visualInfo = glXGetVisualFromFBConfig(display, config);
m_context = glXCreateContext(display, visualInfo, shareContext, true);
- qglx_surfaceFormatFromGLXFBConfig(&m_format, display, config);
+ qglx_surfaceFormatFromGLXFBConfig(&m_format, display, config, m_context);
}
bool QWaylandXCompositeGLXContext::makeCurrent(QPlatformSurface *surface)
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h
^
|
@@ -60,7 +60,6 @@
#endif
struct qt_xcomposite;
-struct qt_xcomposite_listener;
QT_BEGIN_NAMESPACE
@@ -83,7 +82,6 @@
Window rootWindow() const;
bool supportsThreadedOpenGL() const { return false; }
- bool supportsWindowDecoration() const { return false; }
private:
QWaylandDisplay *mWaylandDisplay;
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/hardwareintegration/compositor/brcm-egl/brcmbuffer.cpp
^
|
@@ -48,7 +48,7 @@
QT_BEGIN_NAMESPACE
BrcmBuffer::BrcmBuffer(struct ::wl_client *client, uint32_t id, const QSize &size, EGLint *data, size_t count)
- : QtWaylandServer::wl_buffer(client, id, 1)
+ : QtWaylandServer::wl_buffer(client, id)
, m_handle(count)
, m_invertedY(false)
, m_size(size)
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/hardwareintegration/compositor/brcm-egl/brcmeglintegration.cpp
^
|
@@ -120,7 +120,7 @@
return;
}
d->valid = true;
- init(waylandDisplay->handle(), 1);
+ init(waylandDisplay->handle());
}
}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp
^
|
@@ -95,7 +95,7 @@
return 0;
}
struct ::wl_resource *drm_egl_resource = (*drm_egl_it)->handle;
- Resource *resource = add(client, 1, 1);
+ Resource *resource = add(client);
m_integration->send_server_buffer_created(drm_egl_resource, resource->handle, m_name, m_size.width(), m_size.height(), m_stride, m_drm_format);
return resource->handle;
}
@@ -166,7 +166,7 @@
return;
}
- QtWaylandServer::qt_drm_egl_server_buffer::init(compositor->waylandDisplay(), 1);
+ QtWaylandServer::qt_drm_egl_server_buffer::init(compositor->waylandDisplay());
}
bool DrmEglServerBufferIntegration::supportsFormat(QtWayland::ServerBuffer::Format format) const
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.cpp
^
|
@@ -89,7 +89,7 @@
return 0;
}
struct ::wl_resource *egl_resource = (*egl_it)->handle;
- Resource *resource = add(client, 1, 1);
+ Resource *resource = add(client);
wl_resource *bufRes = wl_client_new_object(client, &qt_libhybris_buffer_interface, 0, 0);
m_integration->send_server_buffer_created(egl_resource, resource->handle, bufRes, m_fds.size(), QByteArray((char *)m_ints.data(), m_ints.size() * sizeof(int32_t)),
@@ -174,7 +174,7 @@
return;
}
- QtWaylandServer::qt_libhybris_egl_server_buffer::init(compositor->waylandDisplay(), 1);
+ QtWaylandServer::qt_libhybris_egl_server_buffer::init(compositor->waylandDisplay());
}
bool LibHybrisEglServerBufferIntegration::supportsFormat(QtWayland::ServerBuffer::Format format) const
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.h
^
|
@@ -64,8 +64,8 @@
#ifndef EGL_HYBRIS_native_buffer
typedef EGLBoolean (EGLAPIENTRYP PFNEGLHYBRISCREATENATIVEBUFFERPROC)(EGLint width, EGLint height, EGLint usage, EGLint format, EGLint *stride, EGLClientBuffer *buffer);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLHYBRISGETNATIVEBUFFERINFOPROC)(EGLClientBuffer buffer, int *num_ints, int *num_fds);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLHYBRISSERIALIZENATIVEBUFFERPROC)(EGLClientBuffer buffer, int *ints, int *fds);
+typedef void (EGLAPIENTRYP PFNEGLHYBRISGETNATIVEBUFFERINFOPROC)(EGLClientBuffer buffer, int *num_ints, int *num_fds);
+typedef void (EGLAPIENTRYP PFNEGLHYBRISSERIALIZENATIVEBUFFERPROC)(EGLClientBuffer buffer, int *ints, int *fds);
#endif
#ifndef GL_OES_EGL_image
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp
^
|
@@ -115,68 +115,66 @@
QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface();
if (!nativeInterface) {
- qWarning("QtCompositor: Failed to initialize EGL display. No native platform interface available.");
+ qWarning("Failed to initialize egl display. No native platform interface available.\n");
return;
}
d->egl_display = nativeInterface->nativeResourceForWindow("EglDisplay", m_compositor->window());
if (!d->egl_display) {
- qWarning("QtCompositor: Failed to initialize EGL display. Could not get EglDisplay for window.");
+ qWarning("Failed to initialize egl display. Could not get EglDisplay for window.\n");
return;
}
const char *extensionString = eglQueryString(d->egl_display, EGL_EXTENSIONS);
if ((!extensionString || !strstr(extensionString, "EGL_WL_bind_wayland_display")) && !ignoreBindDisplay) {
- qWarning("QtCompositor: Failed to initialize EGL display. There is no EGL_WL_bind_wayland_display extension.");
+ qWarning("Failed to initialize egl display. There is no EGL_WL_bind_wayland_display extension.\n");
return;
}
d->egl_bind_wayland_display = reinterpret_cast<PFNEGLBINDWAYLANDDISPLAYWL>(eglGetProcAddress("eglBindWaylandDisplayWL"));
d->egl_unbind_wayland_display = reinterpret_cast<PFNEGLUNBINDWAYLANDDISPLAYWL>(eglGetProcAddress("eglUnbindWaylandDisplayWL"));
if ((!d->egl_bind_wayland_display || !d->egl_unbind_wayland_display) && !ignoreBindDisplay) {
- qWarning("QtCompositor: Failed to initialize EGL display. Could not find eglBindWaylandDisplayWL and eglUnbindWaylandDisplayWL.");
+ qWarning("Failed to initialize egl display. Could not find eglBindWaylandDisplayWL and eglUnbindWaylandDisplayWL.\n");
return;
}
d->egl_query_wayland_buffer = reinterpret_cast<PFNEGLQUERYWAYLANDBUFFERWL_compat>(eglGetProcAddress("eglQueryWaylandBufferWL"));
if (!d->egl_query_wayland_buffer) {
- qWarning("QtCompositor: Failed to initialize EGL display. Could not find eglQueryWaylandBufferWL.");
+ qWarning("Failed to initialize egl display. Could not find eglQueryWaylandBufferWL.\n");
return;
}
d->egl_create_image = reinterpret_cast<PFNEGLCREATEIMAGEKHRPROC>(eglGetProcAddress("eglCreateImageKHR"));
d->egl_destroy_image = reinterpret_cast<PFNEGLDESTROYIMAGEKHRPROC>(eglGetProcAddress("eglDestroyImageKHR"));
if (!d->egl_create_image || !d->egl_destroy_image) {
- qWarning("QtCompositor: Failed to initialize EGL display. Could not find eglCreateImageKHR and eglDestroyImageKHR.");
+ qWarning("Failed to initialize egl display. Could not find eglCreateImageKHR and eglDestroyImageKHR.\n");
return;
}
d->gl_egl_image_target_texture_2d = reinterpret_cast<PFNGLEGLIMAGETARGETTEXTURE2DOESPROC>(eglGetProcAddress("glEGLImageTargetTexture2DOES"));
if (!d->gl_egl_image_target_texture_2d) {
- qWarning("QtCompositor: Failed to initialize EGL display. Could not find glEGLImageTargetTexture2DOES.");
+ qWarning("Failed to initialize egl display. Could not find glEGLImageTargetTexture2DOES.\n");
return;
}
if (d->egl_bind_wayland_display && d->egl_unbind_wayland_display) {
d->display_bound = d->egl_bind_wayland_display(d->egl_display, waylandDisplay->handle());
- if (!d->display_bound) {
- if (!ignoreBindDisplay) {
- qWarning("QtCompositor: Failed to initialize EGL display. Could not bind Wayland display.");
- return;
- } else {
- qWarning("QtCompositor: Could not bind Wayland display. Ignoring.");
- }
+ if (!d->display_bound && !ignoreBindDisplay) {
+ qWarning("Failed to initialize egl display. Could not bind Wayland display.\n");
+ return;
}
}
d->valid = true;
+
+ qWarning("EGL Wayland extension successfully initialized.%s\n", !d->display_bound ? " eglBindWaylandDisplayWL ignored" : "");
}
void WaylandEglClientBufferIntegration::bindTextureToBuffer(struct ::wl_resource *buffer)
{
Q_D(WaylandEglClientBufferIntegration);
if (!d->valid) {
- qWarning("QtCompositor: bindTextureToBuffer() failed");
+ qWarning("bindTextureToBuffer() failed");
return;
}
@@ -208,14 +206,13 @@
// and EGL_TRUE in value.
if (ret == EGL_FALSE || isYInverted == EGL_TRUE)
return true;
- return false;
#endif
return QtWayland::ClientBufferIntegration::isYInverted(buffer);
}
-void *WaylandEglClientBufferIntegration::lockNativeBuffer(struct ::wl_resource *buffer) const
+void *WaylandEglClientBufferIntegration::lockNativeBuffer(struct ::wl_resource *buffer, QOpenGLContext *) const
{
Q_D(const WaylandEglClientBufferIntegration);
@@ -225,7 +222,7 @@
return image;
}
-void WaylandEglClientBufferIntegration::unlockNativeBuffer(void *native_buffer) const
+void WaylandEglClientBufferIntegration::unlockNativeBuffer(void *native_buffer, QOpenGLContext *) const
{
Q_D(const WaylandEglClientBufferIntegration);
EGLImageKHR image = static_cast<EGLImageKHR>(native_buffer);
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.h
^
|
@@ -59,8 +59,8 @@
void bindTextureToBuffer(struct ::wl_resource *buffer) Q_DECL_OVERRIDE;
bool isYInverted(struct ::wl_resource *) const Q_DECL_OVERRIDE;
- void *lockNativeBuffer(struct ::wl_resource *buffer) const Q_DECL_OVERRIDE;
- void unlockNativeBuffer(void *native_buffer) const Q_DECL_OVERRIDE;
+ void *lockNativeBuffer(struct ::wl_resource *buffer, QOpenGLContext *context) const Q_DECL_OVERRIDE;
+ void unlockNativeBuffer(void *native_buffer, QOpenGLContext *context) const Q_DECL_OVERRIDE;
QSize bufferSize(struct ::wl_resource *buffer) const Q_DECL_OVERRIDE;
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/hardwareintegration/compositor/xcomposite_share/xcompositebuffer.cpp
^
|
@@ -44,7 +44,7 @@
XCompositeBuffer::XCompositeBuffer(Window window, const QSize &size,
struct ::wl_client *client, uint32_t id)
- : QtWaylandServer::wl_buffer(client, id, 1)
+ : QtWaylandServer::wl_buffer(client, id)
, mWindow(window)
, mInvertedY(false)
, mSize(size)
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/hardwareintegration/compositor/xcomposite_share/xcompositebuffer.h
^
|
@@ -68,7 +68,7 @@
QSize size() const { return mSize; }
- static XCompositeBuffer *fromResource(struct ::wl_resource *resource) { return static_cast<XCompositeBuffer*>(Resource::fromResource(resource)->buffer_object); }
+ static XCompositeBuffer *fromResource(struct ::wl_resource *resource) { return static_cast<XCompositeBuffer*>(Resource::fromResource(resource)->buffer); }
protected:
void buffer_destroy_resource(Resource *) Q_DECL_OVERRIDE;
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/hardwareintegration/compositor/xcomposite_share/xcompositehandler.cpp
^
|
@@ -48,7 +48,7 @@
QT_BEGIN_NAMESPACE
XCompositeHandler::XCompositeHandler(QtWayland::Compositor *compositor, Display *display)
- : QtWaylandServer::qt_xcomposite(compositor->wl_display(), 1)
+ : QtWaylandServer::qt_xcomposite(compositor->wl_display())
{
compositor->window()->create();
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/plugins/decorations
^
|
-(directory)
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/plugins/decorations/bradient
^
|
-(directory)
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/plugins/decorations/bradient/bradient.json
^
|
@@ -1,3 +0,0 @@
-{
- "Keys": [ "bradient" ]
-}
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/plugins/decorations/bradient/bradient.pro
^
|
@@ -1,17 +0,0 @@
-PLUGIN_TYPE = wayland-decoration-client
-load(qt_plugin)
-
-QT += waylandclient-private
-
-OTHER_FILES += \
- bradient.json
-
-SOURCES += main.cpp
-
-contains(QT_CONFIG, no-pkg-config) {
- LIBS += -lwayland-client
-} else {
- CONFIG += link_pkgconfig
- PKGCONFIG += wayland-client
-}
-
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/plugins/decorations/bradient/main.cpp
^
|
@@ -1,452 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Robin Burchell <robin.burchell@viroteck.net>
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtGui/QCursor>
-#include <QtGui/QPainter>
-#include <QtGui/QPalette>
-#include <QtGui/QLinearGradient>
-
-#include <qpa/qwindowsysteminterface.h>
-
-#include <QtWaylandClient/private/qwaylanddecorationplugin_p.h>
-#include <QtWaylandClient/private/qwaylandabstractdecoration_p.h>
-#include <QtWaylandClient/private/qwaylandwindow_p.h>
-#include <QtWaylandClient/private/qwaylandshellsurface_p.h>
-
-QT_BEGIN_NAMESPACE
-
-#define BUTTON_SPACING 5
-
-#ifndef QT_NO_IMAGEFORMAT_XPM
-# define BUTTON_WIDTH 10
-
-static const char * const qt_close_xpm[] = {
-"10 10 2 1",
-"# c #000000",
-". c None",
-"..........",
-".##....##.",
-"..##..##..",
-"...####...",
-"....##....",
-"...####...",
-"..##..##..",
-".##....##.",
-"..........",
-".........."};
-
-static const char * const qt_maximize_xpm[]={
-"10 10 2 1",
-"# c #000000",
-". c None",
-"#########.",
-"#########.",
-"#.......#.",
-"#.......#.",
-"#.......#.",
-"#.......#.",
-"#.......#.",
-"#.......#.",
-"#########.",
-".........."};
-
-static const char * const qt_minimize_xpm[] = {
-"10 10 2 1",
-"# c #000000",
-". c None",
-"..........",
-"..........",
-"..........",
-"..........",
-"..........",
-"..........",
-"..........",
-".#######..",
-".#######..",
-".........."};
-
-static const char * const qt_normalizeup_xpm[] = {
-"10 10 2 1",
-"# c #000000",
-". c None",
-"...######.",
-"...######.",
-"...#....#.",
-".######.#.",
-".######.#.",
-".#....###.",
-".#....#...",
-".#....#...",
-".######...",
-".........."};
-#else
-# define BUTTON_WIDTH 22
-#endif
-
-class Q_WAYLAND_CLIENT_EXPORT QWaylandBradientDecoration : public QWaylandAbstractDecoration
-{
-public:
- QWaylandBradientDecoration();
-protected:
- QMargins margins() const Q_DECL_OVERRIDE;
- void paint(QPaintDevice *device) Q_DECL_OVERRIDE;
- bool handleMouse(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global,Qt::MouseButtons b,Qt::KeyboardModifiers mods) Q_DECL_OVERRIDE;
- bool handleTouch(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global, Qt::TouchPointState state, Qt::KeyboardModifiers mods) Q_DECL_OVERRIDE;
-private:
- void processMouseTop(QWaylandInputDevice *inputDevice, const QPointF &local, Qt::MouseButtons b,Qt::KeyboardModifiers mods);
- void processMouseBottom(QWaylandInputDevice *inputDevice, const QPointF &local, Qt::MouseButtons b,Qt::KeyboardModifiers mods);
- void processMouseLeft(QWaylandInputDevice *inputDevice, const QPointF &local, Qt::MouseButtons b,Qt::KeyboardModifiers mods);
- void processMouseRight(QWaylandInputDevice *inputDevice, const QPointF &local, Qt::MouseButtons b,Qt::KeyboardModifiers mods);
-
- QRectF closeButtonRect() const;
- QRectF maximizeButtonRect() const;
- QRectF minimizeButtonRect() const;
-
- QColor m_foregroundColor;
- QColor m_backgroundColor;
- QStaticText m_windowTitle;
-};
-
-
-
-QWaylandBradientDecoration::QWaylandBradientDecoration()
- : QWaylandAbstractDecoration()
-{
- QPalette palette;
- m_foregroundColor = palette.color(QPalette::Active, QPalette::HighlightedText);
- m_backgroundColor = palette.color(QPalette::Active, QPalette::Highlight);
-
- QTextOption option(Qt::AlignHCenter | Qt::AlignVCenter);
- option.setWrapMode(QTextOption::NoWrap);
- m_windowTitle.setTextOption(option);
-}
-
-QRectF QWaylandBradientDecoration::closeButtonRect() const
-{
- return QRectF(window()->frameGeometry().width() - BUTTON_WIDTH - BUTTON_SPACING * 2,
- (margins().top() - BUTTON_WIDTH) / 2, BUTTON_WIDTH, BUTTON_WIDTH);
-}
-
-QRectF QWaylandBradientDecoration::maximizeButtonRect() const
-{
- return QRectF(window()->frameGeometry().width() - BUTTON_WIDTH * 2 - BUTTON_SPACING * 3,
- (margins().top() - BUTTON_WIDTH) / 2, BUTTON_WIDTH, BUTTON_WIDTH);
-}
-
-QRectF QWaylandBradientDecoration::minimizeButtonRect() const
-{
- return QRectF(window()->frameGeometry().width() - BUTTON_WIDTH * 3 - BUTTON_SPACING * 4,
- (margins().top() - BUTTON_WIDTH) / 2, BUTTON_WIDTH, BUTTON_WIDTH);
-}
-
-QMargins QWaylandBradientDecoration::margins() const
-{
- return QMargins(3, 30, 3, 3);
-}
-
-void QWaylandBradientDecoration::paint(QPaintDevice *device)
-{
- QRect surfaceRect(QPoint(), window()->frameGeometry().size());
- QRect clips[] =
- {
- QRect(0, 0, surfaceRect.width(), margins().top()),
- QRect(0, surfaceRect.height() - margins().bottom(), surfaceRect.width(), margins().bottom()),
- QRect(0, margins().top(), margins().left(), surfaceRect.height() - margins().top() - margins().bottom()),
- QRect(surfaceRect.width() - margins().right(), margins().top(), margins().left(), surfaceRect.height() - margins().top() - margins().bottom())
- };
-
- QRect top = clips[0];
-
- QPainter p(device);
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/src/plugins/decorations/decorations.pro
^
|
@@ -1,3 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS += \
- bradient
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/plugins/hardwareintegration/client/brcm-egl/brcm-egl.pro
^
|
@@ -1,4 +1,4 @@
-PLUGIN_TYPE = wayland-graphics-integration-client
+PLUGIN_TYPE = wayland-graphics-integration/client
load(qt_plugin)
QT += waylandclient-private
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/plugins/hardwareintegration/client/drm-egl-server/drm-egl-server.pro
^
|
@@ -1,4 +1,4 @@
-PLUGIN_TYPE = wayland-graphics-integration-client
+PLUGIN_TYPE = wayland-graphics-integration/client
load(qt_plugin)
QT += waylandclient-private
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/plugins/hardwareintegration/client/libhybris-egl-server/libhybris-egl-server.pro
^
|
@@ -1,4 +1,4 @@
-PLUGIN_TYPE = wayland-graphics-integration-client
+PLUGIN_TYPE = wayland-graphics-integration/client
load(qt_plugin)
QT += waylandclient-private
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/plugins/hardwareintegration/client/wayland-egl/wayland-egl.pro
^
|
@@ -1,4 +1,4 @@
-PLUGIN_TYPE = wayland-graphics-integration-client
+PLUGIN_TYPE = wayland-graphics-integration/client
load(qt_plugin)
QT += waylandclient-private
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/plugins/hardwareintegration/client/xcomposite-egl/xcomposite-egl.pro
^
|
@@ -1,4 +1,4 @@
-PLUGIN_TYPE = wayland-graphics-integration-client
+PLUGIN_TYPE = wayland-graphics-integration/client
load(qt_plugin)
QT += waylandclient-private
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/plugins/hardwareintegration/client/xcomposite-glx/xcomposite-glx.pro
^
|
@@ -1,4 +1,4 @@
-PLUGIN_TYPE = wayland-graphics-integration-client
+PLUGIN_TYPE = wayland-graphics-integration/client
load(qt_plugin)
QT += waylandclient-private
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/plugins/hardwareintegration/compositor/brcm-egl/brcm-egl.pro
^
|
@@ -1,4 +1,4 @@
-PLUGIN_TYPE = wayland-graphics-integration-server
+PLUGIN_TYPE = wayland-graphics-integration/server
load(qt_plugin)
QT = compositor compositor-private core-private gui-private
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/plugins/hardwareintegration/compositor/drm-egl-server/drm-egl-server.pro
^
|
@@ -1,4 +1,4 @@
-PLUGIN_TYPE = wayland-graphics-integration-server
+PLUGIN_TYPE = wayland-graphics-integration/server
load(qt_plugin)
QT = compositor compositor-private core-private gui-private
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/plugins/hardwareintegration/compositor/libhybris-egl-server/libhybris-egl-server.pro
^
|
@@ -1,4 +1,4 @@
-PLUGIN_TYPE = wayland-graphics-integration-server
+PLUGIN_TYPE = wayland-graphics-integration/server
load(qt_plugin)
QT = compositor compositor-private core-private gui-private
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/plugins/hardwareintegration/compositor/wayland-egl/wayland-egl.pro
^
|
@@ -1,4 +1,4 @@
-PLUGIN_TYPE = wayland-graphics-integration-server
+PLUGIN_TYPE = wayland-graphics-integration/server
load(qt_plugin)
QT = compositor compositor-private core-private gui-private
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/plugins/hardwareintegration/compositor/xcomposite-egl/xcomposite-egl.pro
^
|
@@ -1,4 +1,4 @@
-PLUGIN_TYPE = wayland-graphics-integration-server
+PLUGIN_TYPE = wayland-graphics-integration/server
load(qt_plugin)
QT += compositor compositor-private core-private gui-private
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/plugins/hardwareintegration/compositor/xcomposite-glx/xcomposite-glx.pro
^
|
@@ -1,4 +1,4 @@
-PLUGIN_TYPE = wayland-graphics-integration-server
+PLUGIN_TYPE = wayland-graphics-integration/server
load(qt_plugin)
QT += compositor compositor-private core-private gui-private
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/plugins/platforms/qwayland-brcm-egl/main.cpp
^
|
@@ -52,6 +52,13 @@
QPlatformIntegration *create(const QString&, const QStringList&) Q_DECL_OVERRIDE;
};
+QStringList QWaylandIntegrationPlugin::keys() const
+{
+ QStringList list;
+ list << "wayland-brcm";
+ return list;
+}
+
QPlatformIntegration *QWaylandIntegrationPlugin::create(const QString& system, const QStringList& paramList)
{
Q_UNUSED(paramList);
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/plugins/plugins.pro
^
|
@@ -1,5 +1,2 @@
TEMPLATE=subdirs
-SUBDIRS += \
- platforms \
- hardwareintegration \
- decorations
+SUBDIRS += platforms hardwareintegration
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/qtwaylandscanner/qtwaylandscanner.cpp
^
|
@@ -416,8 +416,8 @@
printf(" class %s %s\n {\n", serverExport.constData(), interfaceName);
printf(" public:\n");
- printf(" %s(struct ::wl_client *client, int id, int version);\n", interfaceName);
- printf(" %s(struct ::wl_display *display, int version);\n", interfaceName);
+ printf(" %s(struct ::wl_client *client, int id);\n", interfaceName);
+ printf(" %s(struct ::wl_display *display);\n", interfaceName);
printf(" %s();\n", interfaceName);
printf("\n");
printf(" virtual ~%s();\n", interfaceName);
@@ -425,24 +425,23 @@
printf(" class Resource\n");
printf(" {\n");
printf(" public:\n");
- printf(" Resource() : %s_object(0), handle(0) {}\n", interfaceNameStripped);
+ printf(" Resource() : %s(0), handle(0) {}\n", interfaceNameStripped);
printf(" virtual ~Resource() {}\n");
printf("\n");
- printf(" %s *%s_object;\n", interfaceName, interfaceNameStripped);
+ printf(" %s *%s;\n", interfaceName, interfaceNameStripped);
printf(" struct ::wl_resource *handle;\n");
printf("\n");
printf(" struct ::wl_client *client() const { return handle->client; }\n");
- printf(" int version() const { return wl_resource_get_version(handle); }\n");
printf("\n");
printf(" static Resource *fromResource(struct ::wl_resource *resource) { return static_cast<Resource *>(resource->data); }\n");
printf(" };\n");
printf("\n");
- printf(" void init(struct ::wl_client *client, int id, int version);\n");
- printf(" void init(struct ::wl_display *display, int version);\n");
+ printf(" void init(struct ::wl_client *client, int id);\n");
+ printf(" void init(struct ::wl_display *display);\n");
printf("\n");
- printf(" Resource *add(struct ::wl_client *client, int version);\n");
- printf(" Resource *add(struct ::wl_client *client, int id, int version);\n");
- printf(" Resource *add(struct wl_list *resource_list, struct ::wl_client *client, int id, int version);\n");
+ printf(" Resource *add(struct ::wl_client *client);\n");
+ printf(" Resource *add(struct ::wl_client *client, int id);\n");
+ printf(" Resource *add(struct wl_list *resource_list, struct ::wl_client *client, int id);\n");
printf("\n");
printf(" Resource *resource() { return m_resource; }\n");
printf(" const Resource *resource() const { return m_resource; }\n");
@@ -492,7 +491,7 @@
printf(" static void bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id);\n");
printf(" static void destroy_func(struct ::wl_resource *client_resource);\n");
printf("\n");
- printf(" Resource *bind(struct ::wl_client *client, uint32_t id, int version);\n");
+ printf(" Resource *bind(struct ::wl_client *client, uint32_t id);\n");
if (hasRequests) {
printf("\n");
@@ -512,7 +511,6 @@
printf(" QMultiMap<struct ::wl_client*, Resource*> m_resource_map;\n");
printf(" Resource *m_resource;\n");
printf(" struct ::wl_global *m_global;\n");
- printf(" uint32_t m_globalVersion;\n");
printf(" };\n");
if (j < interfaces.size() - 1)
@@ -553,21 +551,21 @@
QByteArray stripped = stripInterfaceName(interface.name, prefix);
const char *interfaceNameStripped = stripped.constData();
- printf(" %s::%s(struct ::wl_client *client, int id, int version)\n", interfaceName, interfaceName);
+ printf(" %s::%s(struct ::wl_client *client, int id)\n", interfaceName, interfaceName);
printf(" : m_resource_map()\n");
printf(" , m_resource(0)\n");
printf(" , m_global(0)\n");
printf(" {\n");
- printf(" init(client, id, version);\n");
+ printf(" init(client, id);\n");
printf(" }\n");
printf("\n");
- printf(" %s::%s(struct ::wl_display *display, int version)\n", interfaceName, interfaceName);
+ printf(" %s::%s(struct ::wl_display *display)\n", interfaceName, interfaceName);
printf(" : m_resource_map()\n");
printf(" , m_resource(0)\n");
printf(" , m_global(0)\n");
printf(" {\n");
- printf(" init(display, version);\n");
+ printf(" init(display);\n");
printf(" }\n");
printf("\n");
@@ -584,32 +582,31 @@
printf(" }\n");
printf("\n");
- printf(" void %s::init(struct ::wl_client *client, int id, int version)\n", interfaceName);
+ printf(" void %s::init(struct ::wl_client *client, int id)\n", interfaceName);
printf(" {\n");
- printf(" m_resource = bind(client, id, version);\n");
+ printf(" m_resource = bind(client, id);\n");
printf(" }\n");
printf("\n");
- printf(" %s::Resource *%s::add(struct ::wl_client *client, int version)\n", interfaceName, interfaceName);
+ printf(" %s::Resource *%s::add(struct ::wl_client *client)\n", interfaceName, interfaceName);
printf(" {\n");
- printf(" Resource *resource = bind(client, 0, version);\n");
+ printf(" Resource *resource = bind(client, 0);\n");
printf(" m_resource_map.insert(client, resource);\n");
printf(" return resource;\n");
printf(" }\n");
printf("\n");
- printf(" %s::Resource *%s::add(struct ::wl_client *client, int id, int version)\n", interfaceName, interfaceName);
+ printf(" %s::Resource *%s::add(struct ::wl_client *client, int id)\n", interfaceName, interfaceName);
printf(" {\n");
- printf(" Resource *resource = bind(client, id, version);\n");
+ printf(" Resource *resource = bind(client, id);\n");
printf(" m_resource_map.insert(client, resource);\n");
printf(" return resource;\n");
printf(" }\n");
printf("\n");
- printf(" void %s::init(struct ::wl_display *display, int version)\n", interfaceName);
+ printf(" void %s::init(struct ::wl_display *display)\n", interfaceName);
printf(" {\n");
- printf(" m_global = wl_global_create(display, &::%s_interface, version, this, bind_func);\n", interfaceName);
- printf(" m_globalVersion = version;\n");
+ printf(" m_global = wl_global_create(display, &::%s_interface, ::%s_interface.version, this, bind_func);\n", interfaceName, interfaceName);
printf(" }\n");
printf("\n");
@@ -631,15 +628,15 @@
printf(" void %s::bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id)\n", interfaceName);
printf(" {\n");
- printf(" %s *that = static_cast<%s *>(data);\n", interfaceName, interfaceName);
- printf(" that->add(client, id, qMin(that->m_globalVersion, version));\n");
+ printf(" Q_UNUSED(version);\n");
+ printf(" static_cast<%s *>(data)->add(client, id);\n", interfaceName);
printf(" }\n");
printf("\n");
printf(" void %s::destroy_func(struct ::wl_resource *client_resource)\n", interfaceName);
printf(" {\n");
printf(" Resource *resource = Resource::fromResource(client_resource);\n");
- printf(" %s *that = resource->%s_object;\n", interfaceName, interfaceNameStripped);
+ printf(" %s *that = resource->%s;\n", interfaceName, interfaceNameStripped);
printf(" that->m_resource_map.remove(resource->client(), resource);\n");
printf(" that->%s_destroy_resource(resource);\n", interfaceNameStripped);
printf(" delete resource;\n");
@@ -655,12 +652,12 @@
//We should consider changing bind so that it doesn't special case id == 0
//and use function overloading instead. Jan do you have a lot of code dependent on this behavior?
- printf(" %s::Resource *%s::bind(struct ::wl_client *client, uint32_t id, int version)\n", interfaceName, interfaceName);
+ printf(" %s::Resource *%s::bind(struct ::wl_client *client, uint32_t id)\n", interfaceName, interfaceName);
printf(" {\n");
printf(" Resource *resource = %s_allocate();\n", interfaceNameStripped);
- printf(" resource->%s_object = this;\n", interfaceNameStripped);
+ printf(" resource->%s = this;\n", interfaceNameStripped);
printf("\n");
- printf(" struct ::wl_resource *handle = wl_resource_create(client, &::%s_interface, version, id);\n", interfaceName);
+ printf(" struct ::wl_resource *handle = wl_resource_create(client, &::%s_interface, ::%s_interface.version, id);\n", interfaceName, interfaceName);
printf(" wl_resource_set_implementation(handle, %s, resource, destroy_func);", interfaceMember.constData());
printf("\n");
printf(" resource->handle = handle;\n");
@@ -702,7 +699,7 @@
printf(" {\n");
printf(" Q_UNUSED(client);\n");
printf(" Resource *r = Resource::fromResource(resource);\n");
- printf(" static_cast<%s *>(r->%s_object)->%s_%s(\n", interfaceName, interfaceNameStripped, interfaceNameStripped, e.name.constData());
+ printf(" static_cast<%s *>(r->%s)->%s_%s(\n", interfaceName, interfaceNameStripped, interfaceNameStripped, e.name.constData());
printf(" r");
for (int i = 0; i < e.arguments.size(); ++i) {
printf(",\n");
@@ -825,13 +822,13 @@
printf(" class %s %s\n {\n", clientExport.constData(), interfaceName);
printf(" public:\n");
- printf(" %s(struct ::wl_registry *registry, int id, int version);\n", interfaceName);
+ printf(" %s(struct ::wl_registry *registry, int id);\n", interfaceName);
printf(" %s(struct ::%s *object);\n", interfaceName, interfaceName);
printf(" %s();\n", interfaceName);
printf("\n");
printf(" virtual ~%s();\n", interfaceName);
printf("\n");
- printf(" void init(struct ::wl_registry *registry, int id, int version);\n");
+ printf(" void init(struct ::wl_registry *registry, int id);\n");
printf(" void init(struct ::%s *object);\n", interfaceName);
printf("\n");
printf(" struct ::%s *object() { return m_%s; }\n", interfaceName, interfaceName);
@@ -911,9 +908,9 @@
bool hasEvents = !interface.events.isEmpty();
- printf(" %s::%s(struct ::wl_registry *registry, int id, int version)\n", interfaceName, interfaceName);
+ printf(" %s::%s(struct ::wl_registry *registry, int id)\n", interfaceName, interfaceName);
printf(" {\n");
- printf(" init(registry, id, version);\n");
+ printf(" init(registry, id);\n");
printf(" }\n");
printf("\n");
@@ -936,9 +933,9 @@
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/src/src.pro
^
|
@@ -1,24 +1,11 @@
TEMPLATE=subdirs
+CONFIG+=ordered
-sub_qtwaylandscanner.subdir = qtwaylandscanner
-sub_qtwaylandscanner.target = sub-qtwaylandscanner
-SUBDIRS += sub_qtwaylandscanner
+SUBDIRS += qtwaylandscanner
-# Don't build QtCompositor API unless explicitly enabled
+#Don't build QtCompositor API unless explicitly enabled
contains(CONFIG, wayland-compositor) {
- sub_compositor.subdir = compositor
- sub_compositor.depends = sub-qtwaylandscanner
- sub_compositor.target = sub-compositor
- SUBDIRS += sub_compositor
+ SUBDIRS += compositor
}
-sub_client.subdir = client
-sub_client.depends = sub-qtwaylandscanner
-sub_client.target = sub-client
-SUBDIRS += sub_client
-
-sub_plugins.subdir = plugins
-sub_plugins.depends = sub-qtwaylandscanner sub-client
-contains(CONFIG, wayland-compositor): sub_plugins.depends += sub-compositor
-sub_plugins.target = sub-plugins
-SUBDIRS += sub_plugins
+SUBDIRS += client plugins
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/tests/auto/auto.pro
^
|
@@ -5,5 +5,4 @@
contains(CONFIG, wayland-compositor) {
SUBDIRS += compositor
SUBDIRS += client
- SUBDIRS += cmake
}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/tests/auto/client/mockcompositor.cpp
^
|
@@ -135,13 +135,8 @@
QSharedPointer<MockSurface> result;
lock();
QVector<Impl::Surface *> surfaces = m_compositor->surfaces();
- foreach (Impl::Surface *surface, surfaces) {
- // we don't want to mistake the cursor surface for a window surface
- if (surface->isMapped()) {
- result = surface->mockSurface();
- break;
- }
- }
+ if (!surfaces.isEmpty())
+ result = surfaces.first()->mockSurface();
unlock();
return result;
}
@@ -209,8 +204,6 @@
wl_display_add_global(m_display, &wl_compositor_interface, this, bindCompositor);
- m_data_device_manager.reset(new DataDeviceManager(this, m_display));
-
wl_display_init_shm(m_display);
m_seat.reset(new Seat(this, m_display));
@@ -238,7 +231,7 @@
static void compositor_create_surface(wl_client *client, wl_resource *compositorResource, uint32_t id)
{
Compositor *compositor = static_cast<Compositor *>(compositorResource->data);
- compositor->addSurface(new Surface(client, id, wl_resource_get_version(compositorResource), compositor));
+ compositor->addSurface(new Surface(client, id, compositor));
}
static void compositor_create_region(wl_client *client, wl_resource *compositorResource, uint32_t id)
@@ -293,7 +286,7 @@
void Compositor::removeSurface(Surface *surface)
{
- m_surfaces.removeOne(surface);
+ m_surfaces.remove(m_surfaces.indexOf(surface));
if (m_keyboard->focus() == surface)
m_keyboard->setFocus(0);
if (m_pointer->focus() == surface)
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/tests/auto/client/mockcompositor.h
^
|
@@ -61,7 +61,6 @@
class Keyboard;
class Pointer;
class Seat;
-class DataDeviceManager;
class Surface;
class Compositor
@@ -112,7 +111,6 @@
QScopedPointer<Seat> m_seat;
Pointer *m_pointer;
Keyboard *m_keyboard;
- QScopedPointer<DataDeviceManager> m_data_device_manager;
QVector<Surface *> m_surfaces;
};
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/tests/auto/client/mockinput.cpp
^
|
@@ -101,7 +101,7 @@
}
Seat::Seat(Compositor *compositor, struct ::wl_display *display)
- : wl_seat(display, 2)
+ : wl_seat(display)
, m_compositor(compositor)
, m_keyboard(new Keyboard(compositor))
, m_pointer(new Pointer(compositor))
@@ -119,19 +119,17 @@
void Seat::seat_get_keyboard(Resource *resource, uint32_t id)
{
- m_keyboard->add(resource->client(), id, resource->version());
+ m_keyboard->add(resource->client(), id);
}
void Seat::seat_get_pointer(Resource *resource, uint32_t id)
{
- m_pointer->add(resource->client(), id, resource->version());
+ m_pointer->add(resource->client(), id);
}
Keyboard::Keyboard(Compositor *compositor)
: wl_keyboard()
, m_compositor(compositor)
- , m_focusResource(Q_NULLPTR)
- , m_focus(Q_NULLPTR)
{
}
@@ -166,18 +164,9 @@
}
}
-
-void Keyboard::keyboard_destroy_resource(wl_keyboard::Resource *resource)
-{
- if (m_focusResource == resource)
- m_focusResource = 0;
-}
-
Pointer::Pointer(Compositor *compositor)
: wl_pointer()
, m_compositor(compositor)
- , m_focusResource(Q_NULLPTR)
- , m_focus(Q_NULLPTR)
{
}
@@ -221,41 +210,4 @@
}
}
-void Pointer::pointer_destroy_resource(wl_pointer::Resource *resource)
-{
- if (m_focusResource == resource)
- m_focusResource = 0;
-}
-
-DataDevice::DataDevice(Compositor *compositor)
- : wl_data_device()
- , m_compositor(compositor)
-{
-
-}
-
-DataDevice::~DataDevice()
-{
-
-}
-
-DataDeviceManager::DataDeviceManager(Compositor *compositor, wl_display *display)
- : wl_data_device_manager(display, 1)
- , m_compositor(compositor)
-{
-
-}
-
-DataDeviceManager::~DataDeviceManager()
-{
-
-}
-
-void DataDeviceManager::data_device_manager_get_data_device(Resource *resource, uint32_t id, struct ::wl_resource *seat)
-{
- if (!m_data_device)
- m_data_device.reset(new DataDevice(m_compositor));
- m_data_device->add(resource->client(), id, 1);
-}
-
}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/tests/auto/client/mockinput.h
^
|
@@ -88,9 +88,6 @@
void sendKey(uint32_t key, uint32_t state);
-protected:
- void keyboard_destroy_resource(wl_keyboard::Resource *resource) Q_DECL_OVERRIDE;
-
private:
Compositor *m_compositor;
@@ -110,9 +107,6 @@
void sendMotion(const QPoint &pos);
void sendButton(uint32_t button, uint32_t state);
-protected:
- void pointer_destroy_resource(wl_pointer::Resource *resource) Q_DECL_OVERRIDE;
-
private:
Compositor *m_compositor;
@@ -120,31 +114,6 @@
Surface *m_focus;
};
-class DataDevice : public QtWaylandServer::wl_data_device
-{
-public:
- DataDevice(Compositor *compositor);
- ~DataDevice();
-
-private:
- Compositor *m_compositor;
-};
-
-class DataDeviceManager : public QtWaylandServer::wl_data_device_manager
-{
-public:
- DataDeviceManager(Compositor *compositor, struct ::wl_display *display);
- ~DataDeviceManager();
-
-protected:
- void data_device_manager_get_data_device(Resource *resource, uint32_t id, struct ::wl_resource *seat) Q_DECL_OVERRIDE;
-
-private:
- Compositor *m_compositor;
-
- QScopedPointer<DataDevice> m_data_device;
-};
-
}
#endif // MOCKINPUT_H
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/tests/auto/client/mockshell.cpp
^
|
@@ -40,7 +40,6 @@
****************************************************************************/
#include "mockcompositor.h"
-#include "mocksurface.h"
namespace Impl {
@@ -174,8 +173,6 @@
Q_UNUSED(compositorResource);
wl_client_add_object(client, &wl_shell_surface_interface, &shellSurfaceInterface, id, surfaceResource->data);
- Surface *surf = Surface::fromResource(surfaceResource);
- surf->map();
}
void Compositor::bindShell(wl_client *client, void *compositorData, uint32_t version, uint32_t id)
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/tests/auto/client/mocksurface.cpp
^
|
@@ -44,13 +44,12 @@
namespace Impl {
-Surface::Surface(wl_client *client, uint32_t id, int v, Compositor *compositor)
- : QtWaylandServer::wl_surface(client, id, v)
- , m_buffer(Q_NULLPTR)
+Surface::Surface(wl_client *client, uint32_t id, Compositor *compositor)
+ : QtWaylandServer::wl_surface(client, id)
, m_compositor(compositor)
, m_mockSurface(new MockSurface(this))
- , m_mapped(false)
{
+ wl_list_init(&m_frameCallbackList);
}
Surface::~Surface()
@@ -58,21 +57,6 @@
m_mockSurface->m_surface = 0;
}
-void Surface::map()
-{
- m_mapped = true;
-}
-
-bool Surface::isMapped() const
-{
- return m_mapped;
-}
-
-Surface *Surface::fromResource(struct ::wl_resource *resource)
-{
- return static_cast<Surface *>(Resource::fromResource(resource)->surface_object);
-}
-
void Surface::surface_destroy_resource(Resource *)
{
compositor()->removeSurface(this);
@@ -104,44 +88,47 @@
Q_UNUSED(y);
Q_UNUSED(width);
Q_UNUSED(height);
-}
-void Surface::surface_frame(Resource *resource,
- uint32_t callback)
-{
- wl_resource *frameCallback = wl_client_add_object(resource->client(), &wl_callback_interface, 0, callback, this);
- m_frameCallbackList << frameCallback;
-}
+ if (!m_buffer)
+ return;
-void Surface::surface_commit(Resource *resource)
-{
- Q_UNUSED(resource);
-
- if (m_buffer) {
#if WAYLAND_VERSION_CHECK(1, 2, 0)
- struct ::wl_shm_buffer *shm_buffer = wl_shm_buffer_get(m_buffer);
+ struct ::wl_shm_buffer *shm_buffer = wl_shm_buffer_get(m_buffer);
#else
- struct ::wl_buffer *shm_buffer = 0;
- if (wl_buffer_is_shm(static_cast<struct ::wl_buffer*>(m_buffer->data)))
- shm_buffer = static_cast<struct ::wl_buffer*>(m_buffer->data);
+ struct ::wl_buffer *shm_buffer = 0;
+ if (wl_buffer_is_shm(static_cast<struct ::wl_buffer*>(m_buffer->data)))
+ shm_buffer = static_cast<struct ::wl_buffer*>(m_buffer->data);
#endif
- if (shm_buffer) {
- int stride = wl_shm_buffer_get_stride(shm_buffer);
- uint format = wl_shm_buffer_get_format(shm_buffer);
- Q_UNUSED(format);
- void *data = wl_shm_buffer_get_data(shm_buffer);
- const uchar *char_data = static_cast<const uchar *>(data);
- QImage img(char_data, wl_shm_buffer_get_width(shm_buffer), wl_shm_buffer_get_height(shm_buffer), stride, QImage::Format_ARGB32_Premultiplied);
- m_mockSurface->image = img;
- }
+ if (shm_buffer) {
+ int stride = wl_shm_buffer_get_stride(shm_buffer);
+ uint format = wl_shm_buffer_get_format(shm_buffer);
+ Q_UNUSED(format);
+ void *data = wl_shm_buffer_get_data(shm_buffer);
+ const uchar *char_data = static_cast<const uchar *>(data);
+ QImage img(char_data, wl_shm_buffer_get_width(shm_buffer), wl_shm_buffer_get_height(shm_buffer), stride, QImage::Format_ARGB32_Premultiplied);
+ m_mockSurface->image = img;
}
- foreach (wl_resource *frameCallback, m_frameCallbackList) {
+ wl_resource *frameCallback;
+ wl_list_for_each(frameCallback, &m_frameCallbackList, link) {
wl_callback_send_done(frameCallback, m_compositor->time());
wl_resource_destroy(frameCallback);
}
- m_frameCallbackList.clear();
+
+ wl_list_init(&m_frameCallbackList);
+}
+
+void Surface::surface_frame(Resource *resource,
+ uint32_t callback)
+{
+ wl_resource *frameCallback = wl_client_add_object(resource->client(), &wl_callback_interface, 0, callback, this);
+ wl_list_insert(&m_frameCallbackList, &frameCallback->link);
+}
+
+void Surface::surface_commit(Resource *resource)
+{
+ Q_UNUSED(resource);
}
}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/tests/auto/client/mocksurface.h
^
|
@@ -50,13 +50,10 @@
class Surface : public QtWaylandServer::wl_surface
{
public:
- Surface(wl_client *client, uint32_t id, int v, Compositor *compositor);
+ Surface(wl_client *client, uint32_t id, Compositor *compositor);
~Surface();
Compositor *compositor() const { return m_compositor; }
- static Surface *fromResource(struct ::wl_resource *resource);
- void map();
- bool isMapped() const;
QSharedPointer<MockSurface> mockSurface() const { return m_mockSurface; }
@@ -77,8 +74,8 @@
Compositor *m_compositor;
QSharedPointer<MockSurface> m_mockSurface;
- QList<wl_resource *> m_frameCallbackList;
- bool m_mapped;
+
+ wl_list m_frameCallbackList;
};
}
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/tests/auto/client/tst_client.cpp
^
|
@@ -119,9 +119,6 @@
{
QSocketNotifier *notifier = new QSocketNotifier(compositor->waylandFileDescriptor(), QSocketNotifier::Read, this);
connect(notifier, SIGNAL(activated(int)), this, SLOT(processWaylandEvents()));
- // connect to the event dispatcher to make sure to flush out the outgoing message queue
- connect(QCoreApplication::eventDispatcher(), &QAbstractEventDispatcher::awake, this, &tst_WaylandClient::processWaylandEvents);
- connect(QCoreApplication::eventDispatcher(), &QAbstractEventDispatcher::aboutToBlock, this, &tst_WaylandClient::processWaylandEvents);
}
public slots:
@@ -248,11 +245,6 @@
setenv("XDG_RUNTIME_DIR", ".", 1);
setenv("QT_QPA_PLATFORM", "wayland", 1); // force QGuiApplication to use wayland plugin
- // wayland-egl hangs in the test setup when we try to initialize. Until it gets
- // figured out, avoid clientBufferIntegration() from being called in
- // QWaylandWindow::createDecorations().
- setenv("QT_WAYLAND_DISABLE_WINDOWDECORATION", "1", 1);
-
MockCompositor compositor;
compositor.setOutputGeometry(QRect(QPoint(), screenSize));
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/tests/auto/cmake
^
|
-(directory)
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/tests/auto/cmake/CMakeLists.txt
^
|
@@ -1,15 +0,0 @@
-
-cmake_minimum_required(VERSION 2.8)
-
-project(qmake_cmake_files)
-
-enable_testing()
-
-find_package(Qt5Core REQUIRED)
-set(Qt5_MODULE_TEST_DEPENDS Quick)
-
-include("${_Qt5CTestMacros}")
-
-test_module_includes(
- Compositor QWaylandBufferRef
-)
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/tests/auto/cmake/cmake.pro
^
|
@@ -1,6 +0,0 @@
-# Cause make to do nothing.
-TEMPLATE = subdirs
-
-CMAKE_QT_MODULES_UNDER_TEST = waylandclient
-
-CONFIG += ctest_testcase
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/tests/auto/compositor/compositor.pro
^
|
@@ -2,7 +2,7 @@
TARGET = tst_compositor
QT += testlib
-QT += core-private gui-private compositor compositor-private
+QT += core-private gui-private compositor
!contains(QT_CONFIG, no-pkg-config) {
PKGCONFIG += wayland-client wayland-server
@@ -10,21 +10,5 @@
LIBS += -lwayland-client -lwayland-server
}
-config_xkbcommon {
- !contains(QT_CONFIG, no-pkg-config) {
- PKGCONFIG_PRIVATE += xkbcommon
- } else {
- LIBS_PRIVATE += -lxkbcommon
- }
-} else {
- DEFINES += QT_NO_WAYLAND_XKB
-}
-
-SOURCES += tst_compositor.cpp \
- testcompositor.cpp \
- testkeyboardgrabber.cpp \
- mockclient.cpp \
-
-HEADERS += testcompositor.h \
- testkeyboardgrabber.h \
- mockclient.h \
+SOURCES += tst_compositor.cpp testcompositor.cpp mockclient.cpp
+HEADERS += testcompositor.h mockclient.h
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/tests/auto/compositor/mockclient.cpp
^
|
@@ -61,7 +61,6 @@
, compositor(0)
, output(0)
, registry(0)
- , wlshell(0)
{
if (!display)
qFatal("MockClient(): wl_display_connect() failed");
@@ -89,8 +88,7 @@
const wl_output_listener MockClient::outputListener = {
MockClient::outputGeometryEvent,
- MockClient::outputModeEvent,
- MockClient::outputDone
+ MockClient::outputModeEvent
};
MockClient::~MockClient()
@@ -104,18 +102,12 @@
int, const char *, const char *,
int32_t )
{
- resolve(data)->geometry.moveTopLeft(QPoint(x, y));
+ resolve(data)->geometry = QRect(x, y, width, height);
}
-void MockClient::outputModeEvent(void *data, wl_output *, uint32_t,
- int w, int h, int)
+void MockClient::outputModeEvent(void *, wl_output *, uint32_t,
+ int, int, int)
{
- resolve(data)->geometry.setSize(QSize(w, h));
-}
-
-void MockClient::outputDone(void *, wl_output *)
-{
-
}
void MockClient::readEvents()
@@ -139,12 +131,10 @@
if (interface == "wl_compositor") {
compositor = static_cast<wl_compositor *>(wl_registry_bind(registry, id, &wl_compositor_interface, 1));
} else if (interface == "wl_output") {
- output = static_cast<wl_output *>(wl_registry_bind(registry, id, &wl_output_interface, 2));
+ output = static_cast<wl_output *>(wl_registry_bind(registry, id, &wl_output_interface, 1));
wl_output_add_listener(output, &outputListener, this);
} else if (interface == "wl_shm") {
shm = static_cast<wl_shm *>(wl_registry_bind(registry, id, &wl_shm_interface, 1));
- } else if (interface == "wl_shell") {
- wlshell = static_cast<wl_shell *>(wl_registry_bind(registry, id, &wl_shell_interface, 1));
}
}
@@ -154,12 +144,6 @@
return wl_compositor_create_surface(compositor);
}
-wl_shell_surface *MockClient::createShellSurface(wl_surface *surface)
-{
- flushDisplay();
- return wl_shell_get_shell_surface(wlshell, surface);
-}
-
ShmBuffer::ShmBuffer(const QSize &size, wl_shm *shm)
: handle(0)
{
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/tests/auto/compositor/mockclient.h
^
|
@@ -65,14 +65,12 @@
~MockClient();
wl_surface *createSurface();
- wl_shell_surface *createShellSurface(wl_surface *surface);
wl_display *display;
wl_compositor *compositor;
wl_output *output;
wl_shm *shm;
wl_registry *registry;
- wl_shell *wlshell;
QRect geometry;
@@ -103,7 +101,6 @@
int width,
int height,
int refresh);
- static void outputDone(void *data, wl_output *output);
void handleGlobal(uint32_t id, const QByteArray &interface);
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/tests/auto/compositor/testcompositor.cpp
^
|
@@ -41,11 +41,6 @@
#include "testcompositor.h"
-TestCompositor::TestCompositor(QWaylandCompositor::ExtensionFlag flags) : QWaylandCompositor(0, 0, flags)
-{
- addDefaultShell();
-}
-
void TestCompositor::surfaceCreated(QWaylandSurface *surface)
{
surfaces << surface;
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/tests/auto/compositor/testcompositor.h
^
|
@@ -45,8 +45,6 @@
class TestCompositor : public QWaylandCompositor
{
public:
- TestCompositor(QWaylandCompositor::ExtensionFlag flags = QWaylandCompositor::DefaultExtensions);
-
void surfaceCreated(QWaylandSurface *surface);
void surfaceAboutToBeDestroyed(QWaylandSurface *surface);
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/tests/auto/compositor/testkeyboardgrabber.cpp
^
|
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 LG Electronics, Inc., author: <mikko.levonmaa@lge.com>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "testkeyboardgrabber.h"
-
-namespace QtWayland {
- KeyboardGrabber::~KeyboardGrabber() {}
-}
-
-void TestKeyboardGrabber::focused(QtWayland::Surface *surface)
-{
- Q_UNUSED(surface);
- Q_EMIT focusedCalled();
-}
-
-void TestKeyboardGrabber::key(uint32_t serial, uint32_t time, uint32_t key, uint32_t state)
-{
- Q_UNUSED(serial);
- Q_UNUSED(time);
- Q_UNUSED(key);
- Q_UNUSED(state);
- Q_EMIT keyCalled();
-}
-
-void TestKeyboardGrabber::modifiers(uint32_t serial, uint32_t mods_depressed,
- uint32_t mods_latched, uint32_t mods_locked, uint32_t group)
-{
- Q_UNUSED(serial);
- Q_UNUSED(mods_depressed);
- Q_UNUSED(mods_latched);
- Q_UNUSED(mods_locked);
- Q_UNUSED(group);
- Q_EMIT modifiersCalled();
-}
-
|
[-]
[+]
|
Deleted |
qtwayland.tar.bz2/tests/auto/compositor/testkeyboardgrabber.h
^
|
@@ -1,65 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 LG Electronics, Inc., author: <mikko.levonmaa@lge.com>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "QtCompositor/private/qwlkeyboard_p.h"
-#include "QtCompositor/private/qwlsurface_p.h"
-
-class TestKeyboardGrabber : public QObject, public QtWayland::KeyboardGrabber
-{
- Q_OBJECT
-
-public:
-
- TestKeyboardGrabber() {}
- ~TestKeyboardGrabber() {}
-
- void focused(QtWayland::Surface *surface);
- void key(uint32_t serial, uint32_t time, uint32_t key, uint32_t state);
- void modifiers(uint32_t serial, uint32_t mods_depressed,
- uint32_t mods_latched, uint32_t mods_locked, uint32_t group);
-
-signals:
- void focusedCalled();
- void keyCalled();
- void modifiersCalled();
-};
-
-
|
[-]
[+]
|
Changed |
qtwayland.tar.bz2/tests/auto/compositor/tst_compositor.cpp
^
|
@@ -41,17 +41,9 @@
#include "mockclient.h"
#include "testcompositor.h"
-#include "testkeyboardgrabber.h"
-
-#include "QtCompositor/private/qwlkeyboard_p.h"
-#include "QtCompositor/private/qwlinputdevice_p.h"
-
-#include "qwaylandbufferref.h"
#include <QtTest/QtTest>
-#include <QtCompositor/private/qwlinputdevice_p.h>
-
class tst_WaylandCompositor : public QObject
{
Q_OBJECT
@@ -62,8 +54,6 @@
}
private slots:
- void inputDeviceCapabilities();
- void keyboardGrab();
void singleClient();
void multipleClients();
void geometry();
@@ -138,53 +128,6 @@
QTRY_COMPARE(compositor.surfaces.size(), 0);
}
-void tst_WaylandCompositor::keyboardGrab()
-{
- TestCompositor compositor((QWaylandCompositor::ExtensionFlag)0);
- MockClient mc;
-
- mc.createSurface();
- // This is needed for timing purposes, otherwise the query for the
- // compositor surfaces will return null
- QTRY_COMPARE(compositor.surfaces.size(), 1);
-
- // Set the focused surface so that key event will flow through
- QWaylandSurface *waylandSurface = compositor.surfaces.at(0);
- QWaylandInputDevice* inputDevice = compositor.defaultInputDevice();
- inputDevice->handle()->keyboardDevice()->setFocus(waylandSurface->handle());
-
- TestKeyboardGrabber grab;
- QSignalSpy grabFocusSpy(&grab, SIGNAL(focusedCalled()));
- QSignalSpy grabKeySpy(&grab, SIGNAL(keyCalled()));
- QSignalSpy grabModifierSpy(&grab, SIGNAL(modifiersCalled()));
-
- QtWayland::Keyboard *keyboard = inputDevice->handle()->keyboardDevice();
- keyboard->startGrab(&grab);
-
- QTRY_COMPARE(grabFocusSpy.count(), 1);
- QCOMPARE(grab.m_keyboard, inputDevice->handle()->keyboardDevice());
-
- QKeyEvent ke(QEvent::KeyPress, Qt::Key_A, Qt::NoModifier, 30, 0, 0);
- QKeyEvent ke1(QEvent::KeyRelease, Qt::Key_A, Qt::NoModifier, 30, 0, 0);
- inputDevice->sendFullKeyEvent(&ke);
- inputDevice->sendFullKeyEvent(&ke1);
- QTRY_COMPARE(grabKeySpy.count(), 2);
-
- QKeyEvent ke2(QEvent::KeyPress, Qt::Key_Shift, Qt::NoModifier, 50, 0, 0);
- QKeyEvent ke3(QEvent::KeyRelease, Qt::Key_Shift, Qt::NoModifier, 50, 0, 0);
- inputDevice->sendFullKeyEvent(&ke2);
- inputDevice->sendFullKeyEvent(&ke3);
- QTRY_COMPARE(grabModifierSpy.count(), 2);
- // Modifiers are also keys
- QTRY_COMPARE(grabKeySpy.count(), 4);
-
- // Stop grabbing
- keyboard->endGrab();
- inputDevice->sendFullKeyEvent(&ke);
- inputDevice->sendFullKeyEvent(&ke1);
- QTRY_COMPARE(grabKeySpy.count(), 4);
-}
-
void tst_WaylandCompositor::geometry()
{
TestCompositor compositor;
@@ -216,11 +159,8 @@
QSize size(256, 256);
ShmBuffer buffer(size, client.shm);
- // we need to create a shell surface here or the surface won't be mapped
- client.createShellSurface(surface);
wl_surface_attach(surface, buffer.handle, 0, 0);
wl_surface_damage(surface, 0, 0, size.width(), size.height());
- wl_surface_commit(surface);
QTRY_COMPARE(waylandSurface->size(), size);
QTRY_COMPARE(waylandSurface->type(), QWaylandSurface::Shm);
@@ -246,53 +186,30 @@
void tst_WaylandCompositor::frameCallback()
{
- class BufferAttacher : public QWaylandBufferAttacher
- {
- public:
- void attach(const QWaylandBufferRef &ref) Q_DECL_OVERRIDE
- {
- bufferRef = ref;
- }
-
- QImage image() const
- {
- if (!bufferRef || !bufferRef.isShm())
- return QImage();
- return bufferRef.image();
- }
-
- QWaylandBufferRef bufferRef;
- };
-
TestCompositor compositor;
MockClient client;
+ QSize size(8, 8);
+ ShmBuffer buffer(size, client.shm);
+
wl_surface *surface = client.createSurface();
+ wl_surface_attach(surface, buffer.handle, 0, 0);
int frameCounter = 0;
QTRY_COMPARE(compositor.surfaces.size(), 1);
QWaylandSurface *waylandSurface = compositor.surfaces.at(0);
- BufferAttacher attacher;
- waylandSurface->setBufferAttacher(&attacher);
- QSignalSpy damagedSpy(waylandSurface, SIGNAL(damaged(const QRegion &)));
+ QSignalSpy damagedSpy(waylandSurface, SIGNAL(damaged(const QRect &)));
for (int i = 0; i < 10; ++i) {
- QSize size(i * 8 + 2, i * 8 + 2);
- ShmBuffer buffer(size, client.shm);
-
- // attach a new buffer every frame, else the damage signal won't be fired
- wl_surface_attach(surface, buffer.handle, 0, 0);
registerFrameCallback(surface, &frameCounter);
wl_surface_damage(surface, 0, 0, size.width(), size.height());
- wl_surface_commit(surface);
QTRY_COMPARE(waylandSurface->type(), QWaylandSurface::Shm);
QTRY_COMPARE(damagedSpy.count(), i + 1);
- QCOMPARE(static_cast<BufferAttacher *>(waylandSurface->bufferAttacher())->image(), buffer.image);
- compositor.frameStarted();
+ QCOMPARE(waylandSurface->image(), buffer.image);
compositor.sendFrameCallbacks(QList<QWaylandSurface *>() << waylandSurface);
QTRY_COMPARE(frameCounter, i + 1);
@@ -301,25 +218,5 @@
wl_surface_destroy(surface);
}
-void tst_WaylandCompositor::inputDeviceCapabilities()
-{
- TestCompositor compositor;
- QtWayland::InputDevice dev(NULL, compositor.handle(), QWaylandInputDevice::Pointer);
-
- QTRY_VERIFY(dev.pointerDevice());
- QTRY_VERIFY(!dev.keyboardDevice());
- QTRY_VERIFY(!dev.touchDevice());
-
- dev.setCapabilities(QWaylandInputDevice::Keyboard | QWaylandInputDevice::Touch);
- QTRY_VERIFY(!dev.pointerDevice());
- QTRY_VERIFY(dev.keyboardDevice());
- QTRY_VERIFY(dev.touchDevice());
-
- // Test that existing devices do not change when another is removed
- QtWayland::Keyboard *k = dev.keyboardDevice();
- dev.setCapabilities(QWaylandInputDevice::Keyboard);
- QTRY_COMPARE(k, dev.keyboardDevice());
-}
-
#include <tst_compositor.moc>
QTEST_MAIN(tst_WaylandCompositor);
|