summaryrefslogtreecommitdiff
path: root/src/plugins/platforms/wayland/qwaylanddisplay.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-05-06 18:36:43 +0200
committerJørgen Lind <jorgen.lind@nokia.com>2011-05-30 17:23:24 +0200
commitbc800ea78418061bc379bfb206a99f64c2ee1ed9 (patch)
treece472b50194ff87e201a76c92e9b68a3a882d33b /src/plugins/platforms/wayland/qwaylanddisplay.cpp
parent93bce7874721de905af0181da95c58fe13a2e015 (diff)
downloadqt4-tools-bc800ea78418061bc379bfb206a99f64c2ee1ed9.tar.gz
Added Wayland selection support.
Diffstat (limited to 'src/plugins/platforms/wayland/qwaylanddisplay.cpp')
-rw-r--r--src/plugins/platforms/wayland/qwaylanddisplay.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.cpp b/src/plugins/platforms/wayland/qwaylanddisplay.cpp
index da908fb44c..c3eb7f4da6 100644
--- a/src/plugins/platforms/wayland/qwaylanddisplay.cpp
+++ b/src/plugins/platforms/wayland/qwaylanddisplay.cpp
@@ -45,6 +45,7 @@
#include "qwaylandscreen.h"
#include "qwaylandcursor.h"
#include "qwaylandinputdevice.h"
+#include "qwaylandclipboard.h"
#ifdef QT_WAYLAND_GL_SUPPORT
#include "gl_integration/qwaylandglintegration.h"
@@ -56,6 +57,7 @@
#include <QtCore/QAbstractEventDispatcher>
#include <QtGui/QApplication>
+#include <QtGui/private/qapplication_p.h>
#include <unistd.h>
#include <fcntl.h>
@@ -265,7 +267,6 @@ void QWaylandDisplay::displayHandleGlobal(uint32_t id,
uint32_t version)
{
Q_UNUSED(version);
-
if (interface == "wl_output") {
struct wl_output *output = wl_output_create(mDisplay, id, 1);
wl_output_add_listener(output, &outputListener, this);
@@ -280,5 +281,9 @@ void QWaylandDisplay::displayHandleGlobal(uint32_t id,
QWaylandInputDevice *inputDevice =
new QWaylandInputDevice(mDisplay, id);
mInputDevices.append(inputDevice);
+ } else if (interface == "wl_selection_offer") {
+ QPlatformIntegration *plat = QApplicationPrivate::platformIntegration();
+ QWaylandClipboard *clipboard = static_cast<QWaylandClipboard *>(plat->clipboard());
+ clipboard->createSelectionOffer(id);
}
}