summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2016-08-09 14:04:32 +0200
committerJohan Helsing <johan.helsing@qt.io>2016-08-11 07:53:36 +0000
commit5b222098649674042ca721583abcbee22ea60930 (patch)
tree6430046f63ebcf988829df79dc11c55815cae8b6 /examples
parent00dd433430b7c2849642aefcd3d826dd4b9bf28f (diff)
downloadqtwayland-5b222098649674042ca721583abcbee22ea60930.tar.gz
Compositor API: rename QWaylandInputDevice to QWaylandSeat
The name QWaylandInputDevice could be confusing and misleading: - A QWaylandInputDevice was not one input device, but a collection of many. - Classes that sounded like they should inherit from it did not, i.e: QWaylandKeyboard, QWaylandPointer and QWaylandTouch. - The Wayland protocol already has another term for this, which is seat. Change-Id: I9d9690d5b378075d9dddaeb8cf18395c7f47603e Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/wayland/custom-extension/compositor/qml/Screen.qml2
-rw-r--r--examples/wayland/multi-output/qml/ShellScreen.qml2
-rw-r--r--examples/wayland/pure-qml/qml/Screen.qml2
-rw-r--r--examples/wayland/qwindow-compositor/compositor.cpp30
-rw-r--r--examples/wayland/qwindow-compositor/compositor.h8
-rw-r--r--examples/wayland/qwindow-compositor/window.cpp6
6 files changed, 25 insertions, 25 deletions
diff --git a/examples/wayland/custom-extension/compositor/qml/Screen.qml b/examples/wayland/custom-extension/compositor/qml/Screen.qml
index a1e43a00..b6e4e12d 100644
--- a/examples/wayland/custom-extension/compositor/qml/Screen.qml
+++ b/examples/wayland/custom-extension/compositor/qml/Screen.qml
@@ -72,7 +72,7 @@ WaylandOutput {
x: mouseTracker.mouseX
y: mouseTracker.mouseY
- inputDevice: output.compositor.defaultInputDevice
+ seat: output.compositor.defaultSeat
}
Rectangle {
anchors.bottom: parent.bottom
diff --git a/examples/wayland/multi-output/qml/ShellScreen.qml b/examples/wayland/multi-output/qml/ShellScreen.qml
index 2ac22367..9a612211 100644
--- a/examples/wayland/multi-output/qml/ShellScreen.qml
+++ b/examples/wayland/multi-output/qml/ShellScreen.qml
@@ -69,7 +69,7 @@ WaylandOutput {
x: mouseTracker.mouseX
y: mouseTracker.mouseY
- inputDevice : output.compositor.defaultInputDevice
+ seat : output.compositor.defaultSeat
}
}
}
diff --git a/examples/wayland/pure-qml/qml/Screen.qml b/examples/wayland/pure-qml/qml/Screen.qml
index 968aad81..0920a8b9 100644
--- a/examples/wayland/pure-qml/qml/Screen.qml
+++ b/examples/wayland/pure-qml/qml/Screen.qml
@@ -76,7 +76,7 @@ WaylandOutput {
x: mouseTracker.mouseX
y: mouseTracker.mouseY
- inputDevice: output.compositor.defaultInputDevice
+ seat: output.compositor.defaultSeat
}
}
diff --git a/examples/wayland/qwindow-compositor/compositor.cpp b/examples/wayland/qwindow-compositor/compositor.cpp
index cff3df08..b7cdbbd9 100644
--- a/examples/wayland/qwindow-compositor/compositor.cpp
+++ b/examples/wayland/qwindow-compositor/compositor.cpp
@@ -46,7 +46,7 @@
#include <QtWaylandCompositor/QWaylandXdgShell>
#include <QtWaylandCompositor/QWaylandWlShellSurface>
-#include <QtWaylandCompositor/qwaylandinput.h>
+#include <QtWaylandCompositor/qwaylandseat.h>
#include <QtWaylandCompositor/qwaylanddrag.h>
#include <QDebug>
@@ -162,8 +162,8 @@ void Compositor::create()
QWaylandCompositor::create();
connect(this, &QWaylandCompositor::surfaceCreated, this, &Compositor::onSurfaceCreated);
- connect(defaultInputDevice(), &QWaylandInputDevice::cursorSurfaceRequest, this, &Compositor::adjustCursorSurface);
- connect(defaultInputDevice()->drag(), &QWaylandDrag::dragStarted, this, &Compositor::startDrag);
+ connect(defaultSeat(), &QWaylandSeat::cursorSurfaceRequest, this, &Compositor::adjustCursorSurface);
+ connect(defaultSeat()->drag(), &QWaylandDrag::dragStarted, this, &Compositor::startDrag);
connect(this, &QWaylandCompositor::subsurfaceChanged, this, &Compositor::onSubsurfaceChanged);
}
@@ -191,7 +191,7 @@ void Compositor::surfaceMappedChanged()
if (surface->role() == QWaylandWlShellSurface::role()
|| surface->role() == QWaylandXdgSurface::role()
|| surface->role() == QWaylandXdgPopup::role()) {
- defaultInputDevice()->setKeyboardFocus(surface);
+ defaultSeat()->setKeyboardFocus(surface);
}
} else if (popupActive()) {
for (int i = 0; i < m_popupViews.count(); i++) {
@@ -253,10 +253,10 @@ void Compositor::onXdgSurfaceCreated(QWaylandXdgSurface *xdgSurface)
}
void Compositor::onXdgPopupRequested(QWaylandSurface *surface, QWaylandSurface *parent,
- QWaylandInputDevice *inputDevice, const QPoint &position,
+ QWaylandSeat *seat, const QPoint &position,
const QWaylandResource &resource)
{
- Q_UNUSED(inputDevice);
+ Q_UNUSED(seat);
QWaylandXdgPopup *xdgPopup = new QWaylandXdgPopup(m_xdgShell, surface, parent, position, resource);
@@ -276,16 +276,16 @@ void Compositor::onStartMove()
emit startMove();
}
-void Compositor::onWlStartResize(QWaylandInputDevice *, QWaylandWlShellSurface::ResizeEdge edges)
+void Compositor::onWlStartResize(QWaylandSeat *, QWaylandWlShellSurface::ResizeEdge edges)
{
closePopups();
emit startResize(int(edges), false);
}
-void Compositor::onXdgStartResize(QWaylandInputDevice *inputDevice,
- QWaylandXdgSurface::ResizeEdge edges)
+void Compositor::onXdgStartResize(QWaylandSeat *seat,
+ QWaylandXdgSurface::ResizeEdge edges)
{
- Q_UNUSED(inputDevice);
+ Q_UNUSED(seat);
emit startResize(int(edges), true);
}
@@ -303,9 +303,9 @@ void Compositor::onSetTransient(QWaylandSurface *parent, const QPoint &relativeT
}
}
-void Compositor::onSetPopup(QWaylandInputDevice *inputDevice, QWaylandSurface *parent, const QPoint &relativeToParent)
+void Compositor::onSetPopup(QWaylandSeat *seat, QWaylandSurface *parent, const QPoint &relativeToParent)
{
- Q_UNUSED(inputDevice);
+ Q_UNUSED(seat);
QWaylandWlShellSurface *surface = qobject_cast<QWaylandWlShellSurface*>(sender());
View *view = findView(surface->surface());
m_popupViews << view;
@@ -395,7 +395,7 @@ void Compositor::handleMouseEvent(QWaylandView *target, QMouseEvent *me)
&& target->surface()->client() != m_popupViews.first()->surface()->client()) {
closePopups();
}
- QWaylandInputDevice *input = defaultInputDevice();
+ QWaylandSeat *input = defaultSeat();
QWaylandSurface *surface = target ? target->surface() : nullptr;
switch (me->type()) {
case QEvent::MouseButtonPress:
@@ -438,7 +438,7 @@ void Compositor::handleResize(View *target, const QSize &initialSize, const QPoi
void Compositor::startDrag()
{
- QWaylandDrag *currentDrag = defaultInputDevice()->drag();
+ QWaylandDrag *currentDrag = defaultSeat()->drag();
Q_ASSERT(currentDrag);
View *iconView = findView(currentDrag->icon());
iconView->setPosition(m_window->mapFromGlobal(QCursor::pos()));
@@ -454,7 +454,7 @@ void Compositor::handleDrag(View *target, QMouseEvent *me)
pos -= target->position();
surface = target->surface();
}
- QWaylandDrag *currentDrag = defaultInputDevice()->drag();
+ QWaylandDrag *currentDrag = defaultSeat()->drag();
currentDrag->dragMove(surface, pos);
if (me->buttons() == Qt::NoButton)
currentDrag->drop();
diff --git a/examples/wayland/qwindow-compositor/compositor.h b/examples/wayland/qwindow-compositor/compositor.h
index 3e25ea7d..243e5dbe 100644
--- a/examples/wayland/qwindow-compositor/compositor.h
+++ b/examples/wayland/qwindow-compositor/compositor.h
@@ -123,8 +123,8 @@ private slots:
void surfaceDestroyed();
void viewSurfaceDestroyed();
void onStartMove();
- void onWlStartResize(QWaylandInputDevice *inputDevice, QWaylandWlShellSurface::ResizeEdge edges);
- void onXdgStartResize(QWaylandInputDevice *inputDevice, QWaylandXdgSurface::ResizeEdge edges);
+ void onWlStartResize(QWaylandSeat *seat, QWaylandWlShellSurface::ResizeEdge edges);
+ void onXdgStartResize(QWaylandSeat *seat, QWaylandXdgSurface::ResizeEdge edges);
void startDrag();
@@ -133,10 +133,10 @@ private slots:
void onSurfaceCreated(QWaylandSurface *surface);
void onWlShellSurfaceCreated(QWaylandWlShellSurface *wlShellSurface);
void onXdgSurfaceCreated(QWaylandXdgSurface *xdgSurface);
- void onXdgPopupRequested(QWaylandSurface *surface, QWaylandSurface *parent, QWaylandInputDevice *inputDevice,
+ void onXdgPopupRequested(QWaylandSurface *surface, QWaylandSurface *parent, QWaylandSeat *seat,
const QPoint &position, const QWaylandResource &resource);
void onSetTransient(QWaylandSurface *parentSurface, const QPoint &relativeToParent, QWaylandWlShellSurface::FocusPolicy focusPolicy);
- void onSetPopup(QWaylandInputDevice *inputDevice, QWaylandSurface *parent, const QPoint &relativeToParent);
+ void onSetPopup(QWaylandSeat *seat, QWaylandSurface *parent, const QPoint &relativeToParent);
void onSubsurfaceChanged(QWaylandSurface *child, QWaylandSurface *parent);
void onSubsurfacePositionChanged(const QPoint &position);
diff --git a/examples/wayland/qwindow-compositor/window.cpp b/examples/wayland/qwindow-compositor/window.cpp
index c3fc9b7d..86a1f865 100644
--- a/examples/wayland/qwindow-compositor/window.cpp
+++ b/examples/wayland/qwindow-compositor/window.cpp
@@ -47,7 +47,7 @@
#include <QMatrix4x4>
#include "compositor.h"
-#include <QtWaylandCompositor/qwaylandinput.h>
+#include <QtWaylandCompositor/qwaylandseat.h>
Window::Window()
: m_backgroundTexture(0)
@@ -268,10 +268,10 @@ void Window::sendMouseEvent(QMouseEvent *e, View *target)
void Window::keyPressEvent(QKeyEvent *e)
{
- m_compositor->defaultInputDevice()->sendKeyPressEvent(e->nativeScanCode());
+ m_compositor->defaultSeat()->sendKeyPressEvent(e->nativeScanCode());
}
void Window::keyReleaseEvent(QKeyEvent *e)
{
- m_compositor->defaultInputDevice()->sendKeyReleaseEvent(e->nativeScanCode());
+ m_compositor->defaultSeat()->sendKeyReleaseEvent(e->nativeScanCode());
}