summaryrefslogtreecommitdiffstats
path: root/src/compositor/extensions/qwaylandxdgshell.cpp
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 /src/compositor/extensions/qwaylandxdgshell.cpp
parent00dd433430b7c2849642aefcd3d826dd4b9bf28f (diff)
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 'src/compositor/extensions/qwaylandxdgshell.cpp')
-rw-r--r--src/compositor/extensions/qwaylandxdgshell.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/compositor/extensions/qwaylandxdgshell.cpp b/src/compositor/extensions/qwaylandxdgshell.cpp
index d818736ff..93944fb32 100644
--- a/src/compositor/extensions/qwaylandxdgshell.cpp
+++ b/src/compositor/extensions/qwaylandxdgshell.cpp
@@ -45,7 +45,7 @@
#include <QtWaylandCompositor/QWaylandSurface>
#include <QtWaylandCompositor/QWaylandSurfaceRole>
#include <QtWaylandCompositor/QWaylandResource>
-#include <QtWaylandCompositor/QWaylandInputDevice>
+#include <QtWaylandCompositor/QWaylandSeat>
#include <QtCore/QObject>
@@ -174,7 +174,7 @@ void QWaylandXdgShellPrivate::xdg_shell_use_unstable_version(Resource *resource,
void QWaylandXdgShellPrivate::xdg_shell_get_xdg_popup(Resource *resource, uint32_t id,
wl_resource *surface_res, wl_resource *parent,
- wl_resource *seat, uint32_t serial,
+ wl_resource *seatResource, uint32_t serial,
int32_t x, int32_t y)
{
Q_UNUSED(serial);
@@ -194,9 +194,9 @@ void QWaylandXdgShellPrivate::xdg_shell_get_xdg_popup(Resource *resource, uint32
QWaylandResource xdgPopupResource (wl_resource_create(resource->client(), &xdg_popup_interface,
wl_resource_get_version(resource->handle), id));
- QWaylandInputDevice *inputDevice = QWaylandInputDevice::fromSeatResource(seat);
+ QWaylandSeat *seat = QWaylandSeat::fromSeatResource(seatResource);
QPoint position(x, y);
- emit q->xdgPopupRequested(surface, parentSurface, inputDevice, position, xdgPopupResource);
+ emit q->xdgPopupRequested(surface, parentSurface, seat, position, xdgPopupResource);
QWaylandXdgPopup *xdgPopup = QWaylandXdgPopup::fromResource(xdgPopupResource.resource());
if (!xdgPopup) {
@@ -290,7 +290,7 @@ void QWaylandXdgSurfacePrivate::xdg_surface_move(Resource *resource, wl_resource
Q_UNUSED(serial);
Q_Q(QWaylandXdgSurface);
- QWaylandInputDevice *input_device = QWaylandInputDevice::fromSeatResource(seat);
+ QWaylandSeat *input_device = QWaylandSeat::fromSeatResource(seat);
emit q->startMove(input_device);
}
@@ -301,7 +301,7 @@ void QWaylandXdgSurfacePrivate::xdg_surface_resize(Resource *resource, wl_resour
Q_UNUSED(serial);
Q_Q(QWaylandXdgSurface);
- QWaylandInputDevice *input_device = QWaylandInputDevice::fromSeatResource(seat);
+ QWaylandSeat *input_device = QWaylandSeat::fromSeatResource(seat);
emit q->startResize(input_device, QWaylandXdgSurface::ResizeEdge(edges));
}
@@ -378,15 +378,15 @@ void QWaylandXdgSurfacePrivate::xdg_surface_set_app_id(Resource *resource, const
emit q->appIdChanged();
}
-void QWaylandXdgSurfacePrivate::xdg_surface_show_window_menu(Resource *resource, wl_resource *seat,
+void QWaylandXdgSurfacePrivate::xdg_surface_show_window_menu(Resource *resource, wl_resource *seatResource,
uint32_t serial, int32_t x, int32_t y)
{
Q_UNUSED(resource);
Q_UNUSED(serial);
QPoint position(x, y);
- auto inputDevice = QWaylandInputDevice::fromSeatResource(seat);
+ auto seat = QWaylandSeat::fromSeatResource(seatResource);
Q_Q(QWaylandXdgSurface);
- emit q->showWindowMenu(inputDevice, position);
+ emit q->showWindowMenu(seat, position);
}
void QWaylandXdgSurfacePrivate::xdg_surface_ack_configure(Resource *resource, uint32_t serial)
@@ -525,10 +525,10 @@ void QWaylandXdgShell::initialize()
}
d->init(compositor->display(), 1);
- handleDefaultInputDeviceChanged(compositor->defaultInputDevice(), nullptr);
+ handleSeatChanged(compositor->defaultSeat(), nullptr);
- connect(compositor, &QWaylandCompositor::defaultInputDeviceChanged,
- this, &QWaylandXdgShell::handleDefaultInputDeviceChanged);
+ connect(compositor, &QWaylandCompositor::defaultSeatChanged,
+ this, &QWaylandXdgShell::handleSeatChanged);
}
/*!
@@ -583,15 +583,15 @@ void QWaylandXdgShell::closeAllPopups()
}
}
-void QWaylandXdgShell::handleDefaultInputDeviceChanged(QWaylandInputDevice *newDevice, QWaylandInputDevice *oldDevice)
+void QWaylandXdgShell::handleSeatChanged(QWaylandSeat *newSeat, QWaylandSeat *oldSeat)
{
- if (oldDevice != nullptr) {
- disconnect(oldDevice, &QWaylandInputDevice::keyboardFocusChanged,
+ if (oldSeat != nullptr) {
+ disconnect(oldSeat, &QWaylandSeat::keyboardFocusChanged,
this, &QWaylandXdgShell::handleFocusChanged);
}
- if (newDevice != nullptr) {
- connect(newDevice, &QWaylandInputDevice::keyboardFocusChanged,
+ if (newSeat != nullptr) {
+ connect(newSeat, &QWaylandSeat::keyboardFocusChanged,
this, &QWaylandXdgShell::handleFocusChanged);
}
}