client: Provide seatname for multi-seat

In a multi-seat configuration the seat name can be used by clients
to help identify which physical devices the seat represents.

Change-Id: Id704ad289fe861c2170380f1575d298e8db03964
Reviewed-by: David Edmundson <davidedmundson@kde.org>
This commit is contained in:
Lu YaNing 2023-10-11 19:47:32 +08:00
parent e258b7345c
commit c16f6d4051
2 changed files with 8 additions and 0 deletions

View File

@ -473,6 +473,11 @@ void QWaylandInputDevice::seat_capabilities(uint32_t caps)
}
}
void QWaylandInputDevice::seat_name(const QString &name)
{
mSeatName = name;
}
QWaylandInputDevice::Keyboard *QWaylandInputDevice::createKeyboard(QWaylandInputDevice *device)
{
return new Keyboard(device);

View File

@ -84,6 +84,7 @@ public:
~QWaylandInputDevice() override;
uint32_t capabilities() const { return mCaps; }
QString seatname() const { return mSeatName; }
QWaylandDisplay *display() const { return mQDisplay; }
struct ::wl_seat *wl_seat() { return QtWayland::wl_seat::object(); }
@ -143,6 +144,7 @@ protected:
struct wl_display *mDisplay = nullptr;
uint32_t mCaps = 0;
QString mSeatName;
#if QT_CONFIG(cursor)
struct CursorState {
@ -179,6 +181,7 @@ protected:
uint32_t mSerial = 0;
void seat_capabilities(uint32_t caps) override;
void seat_name(const QString &name) override;
void handleTouchPoint(int id, QEventPoint::State state, const QPointF &surfacePosition = QPoint());
QPointingDevice *mTouchDevice = nullptr;