summaryrefslogtreecommitdiffstats
path: root/src/compositor/wayland_wrapper
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@theqtcompany.com>2015-08-12 15:39:39 +0200
committerJørgen Lind <jorgen.lind@theqtcompany.com>2015-08-28 13:10:33 +0200
commit674c6eef06ae23abadab7969125834617a7be562 (patch)
tree88d4c1039dc25905241721416352286875a24c7c /src/compositor/wayland_wrapper
parent1b9e6e56269a5768cb8a83dc5e4b888fd63dd13c (diff)
Remove QtWayland::Compositor and add QWaylandCompositorPrivate
Diffstat (limited to 'src/compositor/wayland_wrapper')
-rw-r--r--src/compositor/wayland_wrapper/qwlcompositor.cpp529
-rw-r--r--src/compositor/wayland_wrapper/qwlcompositor_p.h218
-rw-r--r--src/compositor/wayland_wrapper/qwldatadevice.cpp6
-rw-r--r--src/compositor/wayland_wrapper/qwldatadevicemanager.cpp16
-rw-r--r--src/compositor/wayland_wrapper/qwldatadevicemanager_p.h10
-rw-r--r--src/compositor/wayland_wrapper/qwldatasource.cpp1
-rw-r--r--src/compositor/wayland_wrapper/qwldisplay.cpp61
-rw-r--r--src/compositor/wayland_wrapper/qwldisplay_p.h64
-rw-r--r--src/compositor/wayland_wrapper/qwlinputdevice.cpp12
-rw-r--r--src/compositor/wayland_wrapper/qwlinputmethod.cpp4
-rw-r--r--src/compositor/wayland_wrapper/qwlkeyboard.cpp14
-rw-r--r--src/compositor/wayland_wrapper/qwloutput.cpp6
-rw-r--r--src/compositor/wayland_wrapper/qwlpointer.cpp5
-rw-r--r--src/compositor/wayland_wrapper/qwlregion.cpp2
-rw-r--r--src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp10
-rw-r--r--src/compositor/wayland_wrapper/qwltouch.cpp2
-rw-r--r--src/compositor/wayland_wrapper/wayland_wrapper.pri4
17 files changed, 41 insertions, 923 deletions
diff --git a/src/compositor/wayland_wrapper/qwlcompositor.cpp b/src/compositor/wayland_wrapper/qwlcompositor.cpp
deleted file mode 100644
index 65b669a02..000000000
--- a/src/compositor/wayland_wrapper/qwlcompositor.cpp
+++ /dev/null
@@ -1,529 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtWaylandCompositor module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** 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 The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later 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 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwlcompositor_p.h"
-
-#include "qwaylandinput.h"
-#include "qwldisplay_p.h"
-#include "qwloutput_p.h"
-#include "qwaylandsurface_p.h"
-#include "qwaylandclient.h"
-#include "qwaylandcompositor.h"
-#include "qwldatadevicemanager_p.h"
-#include "qwldatadevice_p.h"
-#include "qwlextendedsurface_p.h"
-#include "qwlsubsurface_p.h"
-#include "qwlshellsurface_p.h"
-#include "qwlqttouch_p.h"
-#include "qwlqtkey_p.h"
-#include "qwlinputdevice_p.h"
-#include "qwlregion_p.h"
-#include "qwlpointer_p.h"
-#include "qwltextinputmanager_p.h"
-#include <QtCompositor/QWaylandInputPanel>
-#include "qwaylandview.h"
-#include "qwaylandshmformathelper.h"
-#include "qwaylandoutput.h"
-#include "qwlkeyboard_p.h"
-
-#include <QWindow>
-#include <QSocketNotifier>
-#include <QScreen>
-#include <qpa/qplatformscreen.h>
-#include <QGuiApplication>
-#include <QDebug>
-
-#include <QtCore/QAbstractEventDispatcher>
-#include <QtGui/private/qguiapplication_p.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stddef.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-#include <sys/mman.h>
-#include <sys/select.h>
-#include <sys/time.h>
-
-#include <wayland-server.h>
-
-#if defined (QT_COMPOSITOR_WAYLAND_GL)
-#include "hardware_integration/qwlhwintegration_p.h"
-#include "hardware_integration/qwlclientbufferintegration_p.h"
-#include "hardware_integration/qwlserverbufferintegration_p.h"
-#endif
-#include "extensions/qwaylandwindowmanagerextension.h"
-
-#include "hardware_integration/qwlclientbufferintegrationfactory_p.h"
-#include "hardware_integration/qwlserverbufferintegrationfactory_p.h"
-
-#include "../shared/qwaylandxkb.h"
-
-QT_BEGIN_NAMESPACE
-
-namespace QtWayland {
-
-class WindowSystemEventHandler : public QWindowSystemEventHandler
-{
-public:
- WindowSystemEventHandler(Compositor *c) : compositor(c) {}
- bool sendEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *e) Q_DECL_OVERRIDE
- {
- if (e->type == QWindowSystemInterfacePrivate::Key) {
- QWindowSystemInterfacePrivate::KeyEvent *ke = static_cast<QWindowSystemInterfacePrivate::KeyEvent *>(e);
- QWaylandKeyboardPrivate *keyb = QWaylandKeyboardPrivate::get(compositor->defaultInputDevice()->keyboard());
-
- uint32_t code = ke->nativeScanCode;
- bool isDown = ke->keyType == QEvent::KeyPress;
-
-#ifndef QT_NO_WAYLAND_XKB
- QString text;
- Qt::KeyboardModifiers modifiers = QWaylandXkb::modifiers(keyb->xkbState());
-
- const xkb_keysym_t sym = xkb_state_key_get_one_sym(keyb->xkbState(), code);
- uint utf32 = xkb_keysym_to_utf32(sym);
- if (utf32)
- text = QString::fromUcs4(&utf32, 1);
- int qtkey = QWaylandXkb::keysymToQtKey(sym, modifiers, text);
-
- ke->key = qtkey;
- ke->modifiers = modifiers;
- ke->nativeVirtualKey = sym;
- ke->nativeModifiers = keyb->xkbModsMask();
- ke->unicode = text;
-#endif
- if (!ke->repeat)
- keyb->keyEvent(code, isDown ? WL_KEYBOARD_KEY_STATE_PRESSED : WL_KEYBOARD_KEY_STATE_RELEASED);
-
- QWindowSystemEventHandler::sendEvent(e);
-
- if (!ke->repeat) {
- keyb->updateKeymap();
- keyb->updateModifierState(code, isDown ? WL_KEYBOARD_KEY_STATE_PRESSED : WL_KEYBOARD_KEY_STATE_RELEASED);
- }
- } else {
- QWindowSystemEventHandler::sendEvent(e);
- }
- return true;
- }
-
- Compositor *compositor;
-};
-
-Compositor::Compositor(QWaylandCompositor *qt_compositor)
- : m_extensions(QWaylandCompositor::DefaultExtensions)
- , m_display(new Display)
- , m_current_frame(0)
- , m_last_queued_buf(-1)
- , m_qt_compositor(qt_compositor)
- , m_orientation(Qt::PrimaryOrientation)
-#if defined (QT_COMPOSITOR_WAYLAND_GL)
- , m_hw_integration(0)
- , m_client_buffer_integration(0)
- , m_server_buffer_integration(0)
-#endif
- , m_eventHandler(new WindowSystemEventHandler(this))
- , m_retainSelection(false)
- , m_initialized(false)
-{
- m_outputSpaces.append(new QWaylandOutputSpace(qt_compositor));
- m_timer.start();
-
- QWindowSystemInterfacePrivate::installWindowSystemEventHandler(m_eventHandler.data());
-}
-
-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);
-
- m_data_device_manager = new DataDeviceManager(this);
-
- wl_display_init_shm(m_display->handle());
- QVector<wl_shm_format> formats = QWaylandShmFormatHelper::supportedWaylandFormats();
- foreach (wl_shm_format format, formats)
- wl_display_add_shm_format(m_display->handle(), format);
-
- const char *socketName = 0;
- if (m_socket_name.size())
- socketName = m_socket_name.constData();
- if (wl_display_add_socket(m_display->handle(), socketName)) {
- qFatal("Fatal: Failed to open server socket\n");
- }
-
- m_loop = wl_display_get_event_loop(m_display->handle());
-
- int fd = wl_event_loop_get_fd(m_loop);
-
- QSocketNotifier *sockNot = new QSocketNotifier(fd, QSocketNotifier::Read, this);
- connect(sockNot, SIGNAL(activated(int)), this, SLOT(processWaylandEvents()));
-
- QAbstractEventDispatcher *dispatcher = QGuiApplicationPrivate::eventDispatcher;
- connect(dispatcher, SIGNAL(aboutToBlock()), this, SLOT(processWaylandEvents()));
-
- qRegisterMetaType<SurfaceBuffer*>("SurfaceBuffer*");
- qRegisterMetaType<QWaylandClient*>("WaylandClient*");
- qRegisterMetaType<QWaylandSurface*>("WaylandSurface*");
- qRegisterMetaType<QWaylandView*>("WaylandSurfaceView*");
- //initialize distancefieldglyphcache here
-
- initializeHardwareIntegration();
- initializeExtensions();
- initializeDefaultInputDevice();
-
- m_initialized = true;
-}
-
-Compositor::~Compositor()
-{
- if (!m_destroyed_surfaces.isEmpty())
- qWarning("QWaylandCompositor::cleanupGraphicsResources() must be called manually");
- qDeleteAll(m_clients);
-
- qDeleteAll(m_outputSpaces);
-
- removeInputDevice(m_default_wayland_input_device);
- delete m_default_wayland_input_device;
- delete m_data_device_manager;
-
- delete m_display;
-}
-
-uint Compositor::currentTimeMsecs() const
-{
- return m_timer.elapsed();
-}
-
-QWaylandOutput *Compositor::output(QWindow *window) const
-{
- foreach (QWaylandOutputSpace *outputSpace, m_outputSpaces) {
- QWaylandOutput *output = outputSpace->output(window);
- if (output)
- return output;
- }
-
- return Q_NULLPTR;
-}
-
-QWaylandOutput *Compositor::primaryOutput() const
-{
- return primaryOutputSpace()->primaryOutput();
-}
-
-QWaylandOutputSpace *Compositor::primaryOutputSpace() const
-{
- Q_ASSERT(!m_outputSpaces.isEmpty());
- return m_outputSpaces.first();
-}
-
-void Compositor::setPrimaryOutputSpace(QWaylandOutputSpace *outputSpace)
-{
- Q_ASSERT(!m_outputSpaces.isEmpty());
- if (m_outputSpaces.first() == outputSpace)
- return;
- if (m_outputSpaces.removeOne(outputSpace)) {
- m_outputSpaces.prepend(outputSpace);
- waylandCompositor()->primaryOutputSpaceChanged();
- }
-}
-
-void Compositor::addOutputSpace(QWaylandOutputSpace *outputSpace)
-{
- Q_ASSERT(!m_outputSpaces.contains(outputSpace));
- m_outputSpaces.append(outputSpace);
- waylandCompositor()->outputSpacesChanged();
-}
-
-void Compositor::removeOutputSpace(QWaylandOutputSpace *outputSpace)
-{
- if (m_outputSpaces.removeOne(outputSpace))
- waylandCompositor()->outputSpacesChanged();
-}
-
-void Compositor::processWaylandEvents()
-{
- int ret = wl_event_loop_dispatch(m_loop, 0);
- if (ret)
- fprintf(stderr, "wl_event_loop_dispatch error: %d\n", ret);
- wl_display_flush_clients(m_display->handle());
-}
-
-void Compositor::destroySurface(QWaylandSurface *surface)
-{
- waylandCompositor()->surfaceAboutToBeDestroyed(surface);
-
- m_destroyed_surfaces << surface;
-}
-
-void Compositor::unregisterSurface(QWaylandSurface *surface)
-{
- if (!m_all_surfaces.removeOne(surface))
- qWarning("%s Unexpected state. Cant find registered surface\n", Q_FUNC_INFO);
-}
-
-void Compositor::cleanupGraphicsResources()
-{
- qDeleteAll(m_destroyed_surfaces);
- m_destroyed_surfaces.clear();
-}
-
-void Compositor::compositor_create_surface(Resource *resource, uint32_t id)
-{
- QWaylandClient *client = QWaylandClient::fromWlClient(m_qt_compositor, resource->client());
- QWaylandSurface *surface = m_qt_compositor->createSurface(client, id, resource->version());
- m_all_surfaces.append(surface);
- emit m_qt_compositor->surfaceCreated(surface);
-}
-
-void Compositor::compositor_create_region(Resource *resource, uint32_t id)
-{
- new Region(resource->client(), id);
-}
-
-void Compositor::destroyClient(QWaylandClient *client)
-{
- if (!client)
- return;
-
- QWaylandWindowManagerExtension *wmExtension = QWaylandWindowManagerExtension::findIn(waylandCompositor());
- if (wmExtension)
- wmExtension->sendQuitMessage(client->client());
-
- wl_client_destroy(client->client());
-}
-
-ClientBufferIntegration * Compositor::clientBufferIntegration() const
-{
-#ifdef QT_COMPOSITOR_WAYLAND_GL
- return m_client_buffer_integration.data();
-#else
- return 0;
-#endif
-}
-
-ServerBufferIntegration * Compositor::serverBufferIntegration() const
-{
-#ifdef QT_COMPOSITOR_WAYLAND_GL
- return m_server_buffer_integration.data();
-#else
- return 0;
-#endif
-}
-
-void Compositor::initializeHardwareIntegration()
-{
-#ifdef QT_COMPOSITOR_WAYLAND_GL
- if (m_extensions & QWaylandCompositor::HardwareIntegrationExtension)
- m_hw_integration.reset(new HardwareIntegration(this));
-
- loadClientBufferIntegration();
- loadServerBufferIntegration();
-
- if (m_client_buffer_integration)
- m_client_buffer_integration->initializeHardware(m_display);
- if (m_server_buffer_integration)
- m_server_buffer_integration->initializeHardware(m_qt_compositor);
-#endif
-}
-
-void Compositor::initializeExtensions()
-{
- if (m_extensions & QWaylandCompositor::SurfaceExtension)
- new SurfaceExtensionGlobal(this);
- if (m_extensions & QWaylandCompositor::SubSurfaceExtension)
- new SubSurfaceExtensionGlobal(waylandCompositor());
- if (m_extensions & QWaylandCompositor::TouchExtension)
- new TouchExtensionGlobal(this);
- if (m_extensions & QWaylandCompositor::QtKeyExtension)
- new QtKeyExtensionGlobal(this);
- if (m_extensions & QWaylandCompositor::TextInputExtension) {
- new TextInputManager(this);
- new QWaylandInputPanel(waylandCompositor());
- }
- if (m_extensions & QWaylandCompositor::WindowManagerExtension)
- new QWaylandWindowManagerExtension(waylandCompositor());
-}
-
-void Compositor::initializeDefaultInputDevice()
-{
- m_default_wayland_input_device = m_qt_compositor->createInputDevice();
- registerInputDevice(m_default_wayland_input_device);
-}
-
-QList<QWaylandClient *> Compositor::clients() const
-{
- return m_clients;
-}
-
-QWaylandCompositor::ExtensionFlags Compositor::extensions() const
-{
- return m_extensions;
-}
-
-QWaylandInputDevice *Compositor::defaultInputDevice()
-{
- // The list gets prepended so that default is the last element
- return m_inputDevices.last();
-}
-
-DataDeviceManager *Compositor::dataDeviceManager() const
-{
- return m_data_device_manager;
-}
-
-void Compositor::setRetainedSelectionEnabled(bool enabled)
-{
- m_retainSelection = enabled;
-}
-
-bool Compositor::retainedSelectionEnabled() const
-{
- return m_retainSelection;
-}
-
-void Compositor::feedRetainedSelectionData(QMimeData *data)
-{
- if (m_retainSelection)
- m_qt_compositor->retainedSelectionReceived(data);
-}
-
-void Compositor::overrideSelection(const QMimeData *data)
-{
- m_data_device_manager->overrideSelection(*data);
-}
-
-bool Compositor::isDragging() const
-{
- return false;
-}
-
-void Compositor::sendDragMoveEvent(const QPoint &global, const QPoint &local,
- QWaylandSurface *surface)
-{
- Q_UNUSED(global);
- Q_UNUSED(local);
- Q_UNUSED(surface);
-// Drag::instance()->dragMove(global, local, surface);
-}
-
-void Compositor::sendDragEndEvent()
-{
-// Drag::instance()->dragEnd();
-}
-
-void Compositor::loadClientBufferIntegration()
-{
-#ifdef QT_COMPOSITOR_WAYLAND_GL
- QStringList keys = ClientBufferIntegrationFactory::keys();
- QString targetKey;
- QByteArray clientBufferIntegration = qgetenv("QT_WAYLAND_HARDWARE_INTEGRATION");
- if (clientBufferIntegration.isEmpty())
- clientBufferIntegration = qgetenv("QT_WAYLAND_CLIENT_BUFFER_INTEGRATION");
- if (keys.contains(QString::fromLocal8Bit(clientBufferIntegration.constData()))) {
- targetKey = QString::fromLocal8Bit(clientBufferIntegration.constData());
- } else if (keys.contains(QString::fromLatin1("wayland-egl"))) {
- targetKey = QString::fromLatin1("wayland-egl");
- } else if (!keys.isEmpty()) {
- targetKey = keys.first();
- }
-
- if (!targetKey.isEmpty()) {
- m_client_buffer_integration.reset(ClientBufferIntegrationFactory::create(targetKey, QStringList()));
- if (m_client_buffer_integration) {
- m_client_buffer_integration->setCompositor(m_qt_compositor);
- if (m_hw_integration)
- m_hw_integration->setClientBufferIntegration(targetKey);
- }
- }
- //BUG: if there is no client buffer integration, bad things will happen when opengl is used
-#endif
-}
-
-void Compositor::loadServerBufferIntegration()
-{
-#ifdef QT_COMPOSITOR_WAYLAND_GL
- QStringList keys = ServerBufferIntegrationFactory::keys();
- QString targetKey;
- QByteArray serverBufferIntegration = qgetenv("QT_WAYLAND_SERVER_BUFFER_INTEGRATION");
- if (keys.contains(QString::fromLocal8Bit(serverBufferIntegration.constData()))) {
- targetKey = QString::fromLocal8Bit(serverBufferIntegration.constData());
- }
- if (!targetKey.isEmpty()) {
- m_server_buffer_integration.reset(ServerBufferIntegrationFactory::create(targetKey, QStringList()));
- if (m_hw_integration)
- m_hw_integration->setServerBufferIntegration(targetKey);
- }
-#endif
-}
-
-void Compositor::registerInputDevice(QWaylandInputDevice *device)
-{
- // The devices get prepended as the first input device that gets added
- // is assumed to be the default and it will claim to accept all the input
- // events if asked
- m_inputDevices.prepend(device);
-}
-
-void Compositor::removeInputDevice(QWaylandInputDevice *device)
-{
- m_inputDevices.removeOne(device);
-}
-
-QWaylandInputDevice *Compositor::inputDeviceFor(QInputEvent *inputEvent)
-{
- QWaylandInputDevice *dev = NULL;
- for (int i = 0; i < m_inputDevices.size(); i++) {
- QWaylandInputDevice *candidate = m_inputDevices.at(i);
- if (candidate->isOwner(inputEvent)) {
- dev = candidate;
- break;
- }
- }
- return dev;
-}
-
-} // namespace Wayland
-
-QT_END_NAMESPACE
diff --git a/src/compositor/wayland_wrapper/qwlcompositor_p.h b/src/compositor/wayland_wrapper/qwlcompositor_p.h
deleted file mode 100644
index 4881addae..000000000
--- a/src/compositor/wayland_wrapper/qwlcompositor_p.h
+++ /dev/null
@@ -1,218 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014-2015 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtWaylandCompositor module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** 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 The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later 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 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef WL_COMPOSITOR_H
-#define WL_COMPOSITOR_H
-
-#include <QtCompositor/qwaylandexport.h>
-#include <QtCompositor/qwaylandcompositor.h>
-
-#include <QtCompositor/private/qwayland-server-wayland.h>
-
-#include <QtCore/QElapsedTimer>
-#include <QtCore/QSet>
-
-#include <private/qwldisplay_p.h>
-
-#include <wayland-server.h>
-
-QT_BEGIN_NAMESPACE
-
-class QWaylandClient;
-class QWaylandClientPrivate;
-class QInputEvent;
-
-class QWaylandCompositor;
-class QWaylandInputDevice;
-class WindowManagerServerIntegration;
-class QMimeData;
-class QPlatformScreenBuffer;
-class QWaylandSurface;
-class QWindowSystemEventHandler;
-
-namespace QtWayland {
-
-class Surface;
-class SurfaceBuffer;
-class InputDevice;
-class DataDeviceManager;
-class SurfaceExtensionGlobal;
-class TouchExtensionGlobal;
-class QtKeyExtensionGlobal;
-class TextInputManager;
-class InputPanel;
-class HardwareIntegration;
-class ClientBufferIntegration;
-class ServerBufferIntegration;
-
-class Q_COMPOSITOR_EXPORT Compositor : public QObject, public QtWaylandServer::wl_compositor
-{
- Q_OBJECT
-
-public:
- Compositor(QWaylandCompositor *qt_compositor);
- ~Compositor();
-
- void init();
-
- QWaylandInputDevice *defaultInputDevice();
-
- void registerInputDevice(QWaylandInputDevice *device);
- QList<QWaylandInputDevice *> inputDevices() const { return m_inputDevices; }
- QWaylandInputDevice *inputDeviceFor(QInputEvent *inputEvent);
- void removeInputDevice(QWaylandInputDevice *device);
-
- void destroySurface(QWaylandSurface *surface);
-
- void destroyClient(QWaylandClient *client);
-
- uint currentTimeMsecs() const;
-
- QWaylandOutput *output(QWindow *window) const;
-
- QWaylandOutput *primaryOutput() const;
- QWaylandOutputSpace *primaryOutputSpace() const;
- void setPrimaryOutputSpace(QWaylandOutputSpace *outputSpace);
- void addOutputSpace(QWaylandOutputSpace *outputSpace);
- void removeOutputSpace(QWaylandOutputSpace *outputSpace);
-
- ClientBufferIntegration *clientBufferIntegration() const;
- ServerBufferIntegration *serverBufferIntegration() const;
- void initializeHardwareIntegration();
- void initializeExtensions();
- void initializeDefaultInputDevice();
- void initializeWindowManagerProtocol();
-
- QWaylandCompositor *waylandCompositor() const { return m_qt_compositor; }
-
- struct wl_display *wl_display() const { return m_display->handle(); }
- Display *display() const { return m_display; }
-
- QList<QWaylandClient *> clients() const;
-
- QWaylandCompositor::ExtensionFlags extensions() const;
-
- InputPanel *inputPanel() const;
-
- DataDeviceManager *dataDeviceManager() const;
-
- bool isDragging() const;
- void sendDragMoveEvent(const QPoint &global, const QPoint &local, QWaylandSurface *surface);
- void sendDragEndEvent();
-
- void setRetainedSelectionEnabled(bool enabled);
- bool retainedSelectionEnabled() const;
- void overrideSelection(const QMimeData *data);
- void feedRetainedSelectionData(QMimeData *data);
-
- void unregisterSurface(QWaylandSurface *surface);
-
- QWaylandPointer *callCreatePointerDevice(QWaylandInputDevice *inputDevice)
- { return m_qt_compositor->createPointerDevice(inputDevice); }
- QWaylandKeyboard *callCreateKeyboardDevice(QWaylandInputDevice *inputDevice)
- { return m_qt_compositor->createKeyboardDevice(inputDevice); }
- QWaylandTouch *callCreateTouchDevice(QWaylandInputDevice *inputDevice)
- { return m_qt_compositor->createTouchDevice(inputDevice); }
-
-public Q_SLOTS:
- void cleanupGraphicsResources();
-
-protected:
- void compositor_create_surface(Resource *resource, uint32_t id) Q_DECL_OVERRIDE;
- void compositor_create_region(Resource *resource, uint32_t id) Q_DECL_OVERRIDE;
-
-private Q_SLOTS:
- void processWaylandEvents();
-
-protected:
- void loadClientBufferIntegration();
- void loadServerBufferIntegration();
-
- QWaylandCompositor::ExtensionFlags m_extensions;
-
- Display *m_display;
- QByteArray m_socket_name;
-
- /* Input */
- QWaylandInputDevice *m_default_wayland_input_device;
-
- QList<QWaylandInputDevice *> m_inputDevices;
-
- /* Output */
- QList<QWaylandOutputSpace *> m_outputSpaces;
-
- QList<QWaylandSurface *> m_all_surfaces;
-
- DataDeviceManager *m_data_device_manager;
-
- QElapsedTimer m_timer;
- QSet<QWaylandSurface *> m_destroyed_surfaces;
-
- /* Render state */
- uint32_t m_current_frame;
- int m_last_queued_buf;
-
- wl_event_loop *m_loop;
-
- QWaylandCompositor *m_qt_compositor;
- Qt::ScreenOrientation m_orientation;
- QList<QWaylandClient *> m_clients;
-
-#ifdef QT_COMPOSITOR_WAYLAND_GL
- QScopedPointer<HardwareIntegration> m_hw_integration;
- QScopedPointer<ClientBufferIntegration> m_client_buffer_integration;
- QScopedPointer<ServerBufferIntegration> m_server_buffer_integration;
-#endif
-
- QScopedPointer<QWindowSystemEventHandler> m_eventHandler;
-
- static void bind_func(struct wl_client *client, void *data,
- uint32_t version, uint32_t id);
-
- bool m_retainSelection;
- bool m_initialized;
-
- friend class QT_PREPEND_NAMESPACE(QWaylandCompositor);
- friend class QT_PREPEND_NAMESPACE(QWaylandClient);
- friend class QT_PREPEND_NAMESPACE(QWaylandClientPrivate);
-};
-
-}
-
-QT_END_NAMESPACE
-
-#endif //WL_COMPOSITOR_H
diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp
index 8dd33d3b0..a7cb3bd9c 100644
--- a/src/compositor/wayland_wrapper/qwldatadevice.cpp
+++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp
@@ -36,7 +36,6 @@
#include "qwldatadevice_p.h"
-#include "qwlcompositor_p.h"
#include "qwldatasource_p.h"
#include "qwldataoffer_p.h"
#include "qwlinputdevice_p.h"
@@ -49,6 +48,7 @@
#include "qwaylanddrag.h"
#include "qwaylandview.h"
#include <QtCompositor/QWaylandClient>
+#include <QtCompositor/private/qwaylandcompositor_p.h>
#include <QtCore/QPointF>
#include <QDebug>
@@ -105,7 +105,7 @@ void DataDevice::setDragFocus(QWaylandView *focus, const QPointF &localPosition)
if (!resource)
return;
- uint32_t serial = wl_display_next_serial(m_compositor->waylandDisplay());
+ uint32_t serial = m_compositor->nextSerial();
DataOffer *offer = m_dragDataSource ? new DataOffer(m_dragDataSource, resource) : 0;
@@ -208,7 +208,7 @@ void DataDevice::data_device_set_selection(Resource *, struct ::wl_resource *sou
m_selectionSource->cancel();
m_selectionSource = dataSource;
- m_compositor->handle()->dataDeviceManager()->setCurrentSelectionSource(m_selectionSource);
+ QWaylandCompositorPrivate::get(m_compositor)->dataDeviceManager()->setCurrentSelectionSource(m_selectionSource);
if (m_selectionSource)
m_selectionSource->setDevice(this);
diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp
index affc17d72..23e85813a 100644
--- a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp
+++ b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp
@@ -36,15 +36,15 @@
#include "qwldatadevicemanager_p.h"
+#include <QtCompositor/QWaylandCompositor>
+
+#include <QtCompositor/private/qwaylandcompositor_p.h>
#include "qwldatadevice_p.h"
#include "qwldatasource_p.h"
#include "qwlinputdevice_p.h"
-#include "qwlcompositor_p.h"
#include "qwldataoffer_p.h"
#include "qwaylandmimehelper.h"
-#include <QtCompositor/private/qwaylandsurface_p.h>
-
#include <QtCore/QDebug>
#include <QtCore/QSocketNotifier>
#include <fcntl.h>
@@ -55,9 +55,9 @@ QT_BEGIN_NAMESPACE
namespace QtWayland {
-DataDeviceManager::DataDeviceManager(Compositor *compositor)
+DataDeviceManager::DataDeviceManager(QWaylandCompositor *compositor)
: QObject(0)
- , wl_data_device_manager(compositor->wl_display(), 1)
+ , wl_data_device_manager(compositor->display(), 1)
, m_compositor(compositor)
, m_current_selection_source(0)
, m_retainedReadNotifier(0)
@@ -105,7 +105,7 @@ void DataDeviceManager::retain()
QList<QString> offers = m_current_selection_source->mimeTypes();
finishReadFromClient();
if (m_retainedReadIndex >= offers.count()) {
- m_compositor->feedRetainedSelectionData(&m_retainedData);
+ QWaylandCompositorPrivate::get(m_compositor)->feedRetainedSelectionData(&m_retainedData);
return;
}
QString mimeType = offers.at(m_retainedReadIndex);
@@ -182,7 +182,7 @@ DataSource *DataDeviceManager::currentSelectionSource()
struct wl_display *DataDeviceManager::display() const
{
- return m_compositor->wl_display();
+ return m_compositor->display();
}
void DataDeviceManager::overrideSelection(const QMimeData &mimeData)
@@ -195,7 +195,7 @@ void DataDeviceManager::overrideSelection(const QMimeData &mimeData)
foreach (const QString &format, formats)
m_retainedData.setData(format, mimeData.data(format));
- m_compositor->feedRetainedSelectionData(&m_retainedData);
+ QWaylandCompositorPrivate::get(m_compositor)->feedRetainedSelectionData(&m_retainedData);
m_compositorOwnsSelection = true;
diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h b/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h
index 5fbd45f6f..3bc50f64e 100644
--- a/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h
+++ b/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h
@@ -37,13 +37,13 @@
#ifndef WLDATADEVICEMANAGER_H
#define WLDATADEVICEMANAGER_H
-#include <private/qwlcompositor_p.h>
-
#include <QtCore/QList>
#include <QtCore/QMap>
#include <QtGui/QClipboard>
#include <QtCore/QMimeData>
+#include <QtCompositor/QWaylandCompositor>
+
#include <QtCompositor/private/qwayland-server-wayland.h>
QT_BEGIN_NAMESPACE
@@ -52,8 +52,6 @@ class QSocketNotifier;
namespace QtWayland {
-class Compositor;
-
class DataDevice;
class DataSource;
@@ -62,7 +60,7 @@ class DataDeviceManager : public QObject, public QtWaylandServer::wl_data_device
Q_OBJECT
public:
- DataDeviceManager(Compositor *compositor);
+ DataDeviceManager(QWaylandCompositor *compositor);
void setCurrentSelectionSource(DataSource *source);
DataSource *currentSelectionSource();
@@ -86,7 +84,7 @@ private:
void retain();
void finishReadFromClient(bool exhausted = false);
- Compositor *m_compositor;
+ QWaylandCompositor *m_compositor;
QList<DataDevice *> m_data_device_list;
DataSource *m_current_selection_source;
diff --git a/src/compositor/wayland_wrapper/qwldatasource.cpp b/src/compositor/wayland_wrapper/qwldatasource.cpp
index 552fda3a5..641b63b0d 100644
--- a/src/compositor/wayland_wrapper/qwldatasource.cpp
+++ b/src/compositor/wayland_wrapper/qwldatasource.cpp
@@ -38,7 +38,6 @@
#include "qwldataoffer_p.h"
#include "qwldatadevice_p.h"
#include "qwldatadevicemanager_p.h"
-#include "qwlcompositor_p.h"
#include <unistd.h>
#include <QtCompositor/private/wayland-wayland-server-protocol.h>
diff --git a/src/compositor/wayland_wrapper/qwldisplay.cpp b/src/compositor/wayland_wrapper/qwldisplay.cpp
deleted file mode 100644
index 47279cca0..000000000
--- a/src/compositor/wayland_wrapper/qwldisplay.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtWaylandCompositor module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** 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 The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later 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 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwldisplay_p.h"
-
-#include <QtCore/QDebug>
-
-#include <QtCompositor/private/wayland-wayland-server-protocol.h>
-
-QT_BEGIN_NAMESPACE
-
-namespace QtWayland {
-
-Display::Display()
-{
- m_display = wl_display_create();
-
- Q_ASSERT(m_display);
-}
-
-Display::~Display()
-{
- wl_display_destroy(m_display);
-}
-
-}
-
-QT_END_NAMESPACE
diff --git a/src/compositor/wayland_wrapper/qwldisplay_p.h b/src/compositor/wayland_wrapper/qwldisplay_p.h
deleted file mode 100644
index 9409316ea..000000000
--- a/src/compositor/wayland_wrapper/qwldisplay_p.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtWaylandCompositor module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** 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 The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later 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 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef WL_DISPLAY_H
-#define WL_DISPLAY_H
-
-#include <wayland-server.h>
-#include <QtCompositor/qwaylandexport.h>
-
-QT_BEGIN_NAMESPACE
-
-namespace QtWayland {
-
-class Display
-{
-public:
- Display();
- ~Display();
-
- struct wl_display *handle() const { return m_display; }
- struct wl_display *handle() { return m_display; }
-
-private:
- struct wl_display *m_display;
-};
-
-}
-
-QT_END_NAMESPACE
-
-#endif //WL_DISPLAY_H
diff --git a/src/compositor/wayland_wrapper/qwlinputdevice.cpp b/src/compositor/wayland_wrapper/qwlinputdevice.cpp
index 2849a2373..12c38bf83 100644
--- a/src/compositor/wayland_wrapper/qwlinputdevice.cpp
+++ b/src/compositor/wayland_wrapper/qwlinputdevice.cpp
@@ -36,12 +36,12 @@
#include "qwlinputdevice_p.h"
-#include "qwlcompositor_p.h"
+#include <QtCompositor/QWaylandCompositor>
+#include <QtCompositor/private/qwaylandcompositor_p.h>
#include "qwldatadevice_p.h"
#include "qwlinputmethod_p.h"
#include "qwlqttouch_p.h"
#include "qwlqtkey_p.h"
-#include "qwaylandcompositor.h"
#include "qwaylanddrag.h"
#include "qwlpointer_p.h"
#include "qwlkeyboard_p.h"
@@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE
QWaylandInputDevicePrivate::QWaylandInputDevicePrivate(QWaylandInputDevice *inputdevice, QWaylandCompositor *compositor)
: QObjectPrivate()
- , QtWaylandServer::wl_seat(compositor->waylandDisplay(), 3)
+ , QtWaylandServer::wl_seat(compositor->display(), 3)
, m_dragHandle(new QWaylandDrag(inputdevice))
, m_compositor(compositor)
, m_outputSpace(compositor->primaryOutputSpace())
@@ -109,15 +109,15 @@ void QWaylandInputDevicePrivate::setCapabilities(QWaylandInputDevice::Capability
QWaylandInputDevice::CapabilityFlags changed = caps ^ m_capabilities;
if (changed & QWaylandInputDevice::Pointer) {
- m_pointer.reset(m_pointer.isNull() ? compositor()->handle()->callCreatePointerDevice(q) : 0);
+ m_pointer.reset(m_pointer.isNull() ? QWaylandCompositorPrivate::get(compositor())->callCreatePointerDevice(q) : 0);
}
if (changed & QWaylandInputDevice::Keyboard) {
- m_keyboard.reset(m_keyboard.isNull() ? compositor()->handle()->callCreateKeyboardDevice(q) : 0);
+ m_keyboard.reset(m_keyboard.isNull() ? QWaylandCompositorPrivate::get(compositor())->callCreateKeyboardDevice(q) : 0);
}
if (changed & QWaylandInputDevice::Touch) {
- m_touch.reset(m_touch.isNull() ? compositor()->handle()->callCreateTouchDevice(q) : 0);
+ m_touch.reset(m_touch.isNull() ? QWaylandCompositorPrivate::get(compositor())->callCreateTouchDevice(q) : 0);
}
m_capabilities = caps;
diff --git a/src/compositor/wayland_wrapper/qwlinputmethod.cpp b/src/compositor/wayland_wrapper/qwlinputmethod.cpp
index 59f01c666..59b23cdd3 100644
--- a/src/compositor/wayland_wrapper/qwlinputmethod.cpp
+++ b/src/compositor/wayland_wrapper/qwlinputmethod.cpp
@@ -36,7 +36,7 @@
#include "qwlinputmethod_p.h"
-#include "qwlcompositor_p.h"
+#include <QtCompositor/QWaylandCompositor>
#include "qwlinputdevice_p.h"
#include "qwlinputmethodcontext_p.h"
#include "qwlinputpanel_p.h"
@@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
namespace QtWayland {
InputMethod::InputMethod(QWaylandCompositor *compositor, QWaylandInputDevice *seat)
- : QtWaylandServer::wl_input_method(seat->compositor()->waylandDisplay(), 1)
+ : QtWaylandServer::wl_input_method(compositor->display(), 1)
, m_compositor(compositor)
, m_seat(seat)
, m_resource(0)
diff --git a/src/compositor/wayland_wrapper/qwlkeyboard.cpp b/src/compositor/wayland_wrapper/qwlkeyboard.cpp
index c22b0cb26..4977ce014 100644
--- a/src/compositor/wayland_wrapper/qwlkeyboard.cpp
+++ b/src/compositor/wayland_wrapper/qwlkeyboard.cpp
@@ -37,12 +37,12 @@
#include "qwlkeyboard_p.h"
#include "qwlshellsurface_p.h"
+
#include <QFile>
#include <QStandardPaths>
#include <QtCompositor/QWaylandClient>
-
-#include "qwlcompositor_p.h"
+#include <QtCompositor/QWaylandCompositor>
#include <fcntl.h>
#include <unistd.h>
@@ -115,7 +115,7 @@ void QWaylandKeyboardPrivate::focused(QWaylandSurface *surface)
if (surface && surface->isCursorSurface())
surface = Q_NULLPTR;
if (m_focusResource && m_focus != surface) {
- uint32_t serial = wl_display_next_serial(compositor()->waylandDisplay());
+ uint32_t serial = compositor()->nextSerial();
send_leave(m_focusResource->handle, serial, m_focus->resource());
m_focusDestroyListener.reset();
}
@@ -123,7 +123,7 @@ void QWaylandKeyboardPrivate::focused(QWaylandSurface *surface)
Resource *resource = surface ? resourceMap().value(surface->waylandClient()) : 0;
if (resource && (m_focus != surface || m_focusResource != resource)) {
- uint32_t serial = wl_display_next_serial(compositor()->waylandDisplay());
+ uint32_t serial = compositor()->nextSerial();
send_modifiers(resource->handle, serial, m_modsDepressed, m_modsLatched, m_modsLocked, m_group);
send_enter(resource->handle, serial, surface->resource(), QByteArray::fromRawData((char *)m_keys.data(), m_keys.size() * sizeof(uint32_t)));
m_focusDestroyListener.listenForDestruction(surface->resource());
@@ -227,7 +227,7 @@ void QWaylandKeyboardPrivate::keyEvent(uint code, uint32_t state)
void QWaylandKeyboardPrivate::sendKeyEvent(uint code, uint32_t state)
{
uint32_t time = compositor()->currentTimeMsecs();
- uint32_t serial = wl_display_next_serial(compositor()->waylandDisplay());
+ uint32_t serial = compositor()->nextSerial();
uint key = code - 8;
m_grab->key(serial, time, key, state);
}
@@ -264,7 +264,7 @@ void QWaylandKeyboardPrivate::updateModifierState(uint code, uint32_t state)
m_modsLocked = modsLocked;
m_group = group;
- m_grab->modifiers(wl_display_next_serial(compositor()->waylandDisplay()), m_modsDepressed, m_modsLatched, m_modsLocked, m_group);
+ m_grab->modifiers(compositor()->nextSerial(), m_modsDepressed, m_modsLatched, m_modsLocked, m_group);
#else
Q_UNUSED(code);
Q_UNUSED(state);
@@ -290,7 +290,7 @@ void QWaylandKeyboardPrivate::updateKeymap()
xkb_state_update_mask(m_state, 0, m_modsLatched, m_modsLocked, 0, 0, 0);
if (m_focusResource)
- sendKeyModifiers(m_focusResource, wl_display_next_serial(compositor()->waylandDisplay()));
+ sendKeyModifiers(m_focusResource, compositor()->nextSerial());
#endif
}
diff --git a/src/compositor/wayland_wrapper/qwloutput.cpp b/src/compositor/wayland_wrapper/qwloutput.cpp
index 82278f301..d11d91ea4 100644
--- a/src/compositor/wayland_wrapper/qwloutput.cpp
+++ b/src/compositor/wayland_wrapper/qwloutput.cpp
@@ -36,10 +36,10 @@
****************************************************************************/
#include "qwloutput_p.h"
-#include "qwlcompositor_p.h"
#include <QtGui/QWindow>
#include <QRect>
+#include <QtCompositor/QWaylandCompositor>
#include <QtCompositor/QWaylandSurface>
#include <QtCompositor/QWaylandOutput>
@@ -101,7 +101,7 @@ static QtWaylandServer::wl_output::transform toWlTransform(const QWaylandOutput:
}
Output::Output(QWaylandOutput *output, QWaylandOutputSpace *outputSpace, QWindow *window)
- : QtWaylandServer::wl_output(outputSpace->compositor()->waylandDisplay(), 2)
+ : QtWaylandServer::wl_output(outputSpace->compositor()->display(), 2)
, m_window(window)
, m_output(output)
, m_outputSpace(Q_NULLPTR)
@@ -349,7 +349,7 @@ void Output::sendFrameCallbacks()
QWaylandSurfacePrivate::get(surfacemapper.surface)->sendFrameCallback();
}
}
- wl_display_flush_clients(compositor()->waylandDisplay());
+ wl_display_flush_clients(compositor()->display());
}
void Output::surfaceEnter(QWaylandSurface *surface)
diff --git a/src/compositor/wayland_wrapper/qwlpointer.cpp b/src/compositor/wayland_wrapper/qwlpointer.cpp
index 9e66f4636..28a72b76e 100644
--- a/src/compositor/wayland_wrapper/qwlpointer.cpp
+++ b/src/compositor/wayland_wrapper/qwlpointer.cpp
@@ -37,7 +37,6 @@
#include "qwlpointer_p.h"
-#include "qwlcompositor_p.h"
#include "qwlinputdevice_p.h"
#include "qwlkeyboard_p.h"
#include "qwaylandcompositor.h"
@@ -125,7 +124,7 @@ void QWaylandPointerPrivate::sendMousePressEvent(Qt::MouseButton button)
m_grab->button(time, button, WL_POINTER_BUTTON_STATE_PRESSED);
if (m_buttonCount == 1) {
- m_grabSerial = wl_display_get_serial(compositor()->waylandDisplay());
+ m_grabSerial = compositor()->nextSerial();
q->buttonPressedChanged();
}
}
@@ -138,7 +137,7 @@ void QWaylandPointerPrivate::sendMouseReleaseEvent(Qt::MouseButton button)
m_grab->button(time, button, WL_POINTER_BUTTON_STATE_RELEASED);
if (m_buttonCount == 1)
- m_grabSerial = wl_display_get_serial(compositor()->waylandDisplay());
+ m_grabSerial = compositor()->nextSerial();
if (m_buttonCount == 0)
q->buttonPressedChanged();
}
diff --git a/src/compositor/wayland_wrapper/qwlregion.cpp b/src/compositor/wayland_wrapper/qwlregion.cpp
index 14a749afb..9f55980e8 100644
--- a/src/compositor/wayland_wrapper/qwlregion.cpp
+++ b/src/compositor/wayland_wrapper/qwlregion.cpp
@@ -36,8 +36,6 @@
#include "qwlregion_p.h"
-#include "qwlcompositor_p.h"
-
QT_BEGIN_NAMESPACE
namespace QtWayland {
diff --git a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp
index 9c7671855..d65cbc567 100644
--- a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp
+++ b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp
@@ -36,8 +36,6 @@
#include "qwlsurfacebuffer_p.h"
-#include "qwlcompositor_p.h"
-
#ifdef QT_COMPOSITOR_WAYLAND_GL
#include "hardware_integration/qwlclientbufferintegration_p.h"
#include <qpa/qplatformopenglcontext.h>
@@ -48,6 +46,8 @@
#include <wayland-server-protocol.h>
#include "qwaylandshmformathelper.h"
+#include <QtCompositor/private/qwaylandcompositor_p.h>
+
QT_BEGIN_NAMESPACE
namespace QtWayland {
@@ -160,7 +160,7 @@ QSize SurfaceBuffer::size() const
int height = wl_shm_buffer_get_height(shmBuffer);
return QSize(width, height);
}
- if (ClientBufferIntegration *integration = m_compositor->handle()->clientBufferIntegration()) {
+ if (ClientBufferIntegration *integration = QWaylandCompositorPrivate::get(m_compositor)->clientBufferIntegration()) {
return integration->bufferSize(m_buffer);
}
@@ -173,7 +173,7 @@ QWaylandSurface::Origin SurfaceBuffer::origin() const
return QWaylandSurface::OriginTopLeft;
}
- if (ClientBufferIntegration *integration = m_compositor->handle()->clientBufferIntegration()) {
+ if (ClientBufferIntegration *integration = QWaylandCompositorPrivate::get(m_compositor)->clientBufferIntegration()) {
return integration->origin(m_buffer);
}
return QWaylandSurface::OriginTopLeft;
@@ -209,7 +209,7 @@ void SurfaceBuffer::bindToTexture() const
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image.width(), image.height(), 0, GL_RGB, GL_UNSIGNED_BYTE, image.constBits());
}
} else {
- if (QtWayland::ClientBufferIntegration *clientInt = m_compositor->handle()->clientBufferIntegration()) {
+ if (QtWayland::ClientBufferIntegration *clientInt = QWaylandCompositorPrivate::get(m_compositor)->clientBufferIntegration()) {
clientInt->bindTextureToBuffer(m_buffer);
}
}
diff --git a/src/compositor/wayland_wrapper/qwltouch.cpp b/src/compositor/wayland_wrapper/qwltouch.cpp
index 85675a624..226f68b6a 100644
--- a/src/compositor/wayland_wrapper/qwltouch.cpp
+++ b/src/compositor/wayland_wrapper/qwltouch.cpp
@@ -37,7 +37,7 @@
#include "qwltouch_p.h"
-#include "qwlcompositor_p.h"
+#include <QtCompositor/QWaylandCompositor>
#include "qwaylandview.h"
#include "qwlqttouch_p.h"
diff --git a/src/compositor/wayland_wrapper/wayland_wrapper.pri b/src/compositor/wayland_wrapper/wayland_wrapper.pri
index cf7194fe6..b32bf4cbb 100644
--- a/src/compositor/wayland_wrapper/wayland_wrapper.pri
+++ b/src/compositor/wayland_wrapper/wayland_wrapper.pri
@@ -5,12 +5,10 @@ WAYLANDSERVERSOURCES += \
../3rdparty/protocol/text.xml
HEADERS += \
- wayland_wrapper/qwlcompositor_p.h \
wayland_wrapper/qwldatadevice_p.h \
wayland_wrapper/qwldatadevicemanager_p.h \
wayland_wrapper/qwldataoffer_p.h \
wayland_wrapper/qwldatasource_p.h \
- wayland_wrapper/qwldisplay_p.h \
wayland_wrapper/qwlinputdevice_p.h \
wayland_wrapper/qwlinputmethod_p.h \
wayland_wrapper/qwlinputmethodcontext_p.h \
@@ -23,12 +21,10 @@ HEADERS += \
../shared/qwaylandxkb.h \
SOURCES += \
- wayland_wrapper/qwlcompositor.cpp \
wayland_wrapper/qwldatadevice.cpp \
wayland_wrapper/qwldatadevicemanager.cpp \
wayland_wrapper/qwldataoffer.cpp \
wayland_wrapper/qwldatasource.cpp \
- wayland_wrapper/qwldisplay.cpp \
wayland_wrapper/qwlinputdevice.cpp \
wayland_wrapper/qwlinputmethod.cpp \
wayland_wrapper/qwlinputmethodcontext.cpp \