Move pointer position into the Pointer struct in SeatInterface::Private
This commit is contained in:
parent
ce07100383
commit
c6281ac64e
1 changed files with 4 additions and 4 deletions
|
@ -69,7 +69,6 @@ public:
|
||||||
QVector<PointerInterface*> pointers;
|
QVector<PointerInterface*> pointers;
|
||||||
|
|
||||||
// Pointer related members
|
// Pointer related members
|
||||||
QPointF pointerPos;
|
|
||||||
struct Pointer {
|
struct Pointer {
|
||||||
enum class ButtonState {
|
enum class ButtonState {
|
||||||
Released,
|
Released,
|
||||||
|
@ -77,6 +76,7 @@ public:
|
||||||
};
|
};
|
||||||
QHash<quint32, quint32> buttonSerials;
|
QHash<quint32, quint32> buttonSerials;
|
||||||
QHash<quint32, ButtonState> buttonStates;
|
QHash<quint32, ButtonState> buttonStates;
|
||||||
|
QPointF pos;
|
||||||
};
|
};
|
||||||
Pointer globalPointer;
|
Pointer globalPointer;
|
||||||
void updatePointerButtonSerial(quint32 button, quint32 serial);
|
void updatePointerButtonSerial(quint32 button, quint32 serial);
|
||||||
|
@ -354,16 +354,16 @@ SeatInterface::Private *SeatInterface::d_func() const
|
||||||
QPointF SeatInterface::pointerPos() const
|
QPointF SeatInterface::pointerPos() const
|
||||||
{
|
{
|
||||||
Q_D();
|
Q_D();
|
||||||
return d->pointerPos;
|
return d->globalPointer.pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SeatInterface::setPointerPos(const QPointF &pos)
|
void SeatInterface::setPointerPos(const QPointF &pos)
|
||||||
{
|
{
|
||||||
Q_D();
|
Q_D();
|
||||||
if (d->pointerPos == pos) {
|
if (d->globalPointer.pos == pos) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
d->pointerPos = pos;
|
d->globalPointer.pos = pos;
|
||||||
emit pointerPosChanged(pos);
|
emit pointerPosChanged(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue