Changeset View
Changeset View
Standalone View
Standalone View
src/server/seat_interface.cpp
Show First 20 Lines • Show All 203 Lines • ▼ Show 20 Line(s) | 203 | for (auto it = interfaces.begin(); it != interfaces.end(); ++it) { | |||
---|---|---|---|---|---|
204 | if ((*it)->client() == surface->client() && (*it)->resource()) { | 204 | if ((*it)->client() == surface->client() && (*it)->resource()) { | ||
205 | ret << *it; | 205 | ret << *it; | ||
206 | } | 206 | } | ||
207 | } | 207 | } | ||
208 | return ret; | 208 | return ret; | ||
209 | } | 209 | } | ||
210 | } | 210 | } | ||
211 | 211 | | |||
212 | PointerInterface *SeatInterface::Private::pointerForSurface(SurfaceInterface *surface) const | 212 | QVector<PointerInterface *> SeatInterface::Private::pointersForSurface(SurfaceInterface *surface) const | ||
213 | { | 213 | { | ||
214 | return interfaceForSurface(surface, pointers); | 214 | return interfacesForSurface(surface, pointers); | ||
215 | } | 215 | } | ||
216 | 216 | | |||
217 | QVector<KeyboardInterface *> SeatInterface::Private::keyboardsForSurface(SurfaceInterface *surface) const | 217 | QVector<KeyboardInterface *> SeatInterface::Private::keyboardsForSurface(SurfaceInterface *surface) const | ||
218 | { | 218 | { | ||
219 | return interfacesForSurface(surface, keyboards); | 219 | return interfacesForSurface(surface, keyboards); | ||
220 | } | 220 | } | ||
221 | 221 | | |||
222 | TouchInterface *SeatInterface::Private::touchForSurface(SurfaceInterface *surface) const | 222 | TouchInterface *SeatInterface::Private::touchForSurface(SurfaceInterface *surface) const | ||
▲ Show 20 Lines • Show All 205 Lines • ▼ Show 20 Line(s) | 423 | { | |||
428 | if (!pointer->resource()) { | 428 | if (!pointer->resource()) { | ||
429 | wl_resource_post_no_memory(resource); | 429 | wl_resource_post_no_memory(resource); | ||
430 | delete pointer; | 430 | delete pointer; | ||
431 | return; | 431 | return; | ||
432 | } | 432 | } | ||
433 | pointers << pointer; | 433 | pointers << pointer; | ||
434 | if (globalPointer.focus.surface && globalPointer.focus.surface->client() == clientConnection) { | 434 | if (globalPointer.focus.surface && globalPointer.focus.surface->client() == clientConnection) { | ||
435 | // this is a pointer for the currently focused pointer surface | 435 | // this is a pointer for the currently focused pointer surface | ||
436 | if (!globalPointer.focus.pointer) { | 436 | globalPointer.focus.pointers << pointer; | ||
437 | globalPointer.focus.pointer = pointer; | | |||
438 | pointer->setFocusedSurface(globalPointer.focus.surface, globalPointer.focus.serial); | 437 | pointer->setFocusedSurface(globalPointer.focus.surface, globalPointer.focus.serial); | ||
438 | if (globalPointer.focus.pointers.count() == 1) { | ||||
439 | // got a new pointer | ||||
439 | emit q->focusedPointerChanged(pointer); | 440 | emit q->focusedPointerChanged(pointer); | ||
440 | } | 441 | } | ||
441 | } | 442 | } | ||
442 | QObject::connect(pointer, &QObject::destroyed, q, | 443 | QObject::connect(pointer, &QObject::destroyed, q, | ||
443 | [pointer,this] { | 444 | [pointer,this] { | ||
444 | pointers.removeAt(pointers.indexOf(pointer)); | 445 | pointers.removeAt(pointers.indexOf(pointer)); | ||
445 | if (globalPointer.focus.pointer == pointer) { | 446 | if (globalPointer.focus.pointers.removeOne(pointer)) { | ||
446 | globalPointer.focus.pointer = nullptr; | 447 | if (globalPointer.focus.pointers.isEmpty()) { | ||
447 | emit q->focusedPointerChanged(nullptr); | 448 | emit q->focusedPointerChanged(nullptr); | ||
448 | } | 449 | } | ||
449 | } | 450 | } | ||
451 | } | ||||
450 | ); | 452 | ); | ||
451 | emit q->pointerCreated(pointer); | 453 | emit q->pointerCreated(pointer); | ||
452 | } | 454 | } | ||
453 | 455 | | |||
454 | void SeatInterface::Private::getKeyboardCallback(wl_client *client, wl_resource *resource, uint32_t id) | 456 | void SeatInterface::Private::getKeyboardCallback(wl_client *client, wl_resource *resource, uint32_t id) | ||
455 | { | 457 | { | ||
456 | cast(resource)->getKeyboard(client, resource, id); | 458 | cast(resource)->getKeyboard(client, resource, id); | ||
457 | } | 459 | } | ||
▲ Show 20 Lines • Show All 184 Lines • ▼ Show 20 Line(s) | |||||
642 | void SeatInterface::setFocusedPointerSurface(SurfaceInterface *surface, const QMatrix4x4 &transformation) | 644 | void SeatInterface::setFocusedPointerSurface(SurfaceInterface *surface, const QMatrix4x4 &transformation) | ||
643 | { | 645 | { | ||
644 | Q_D(); | 646 | Q_D(); | ||
645 | if (d->drag.mode == Private::Drag::Mode::Pointer) { | 647 | if (d->drag.mode == Private::Drag::Mode::Pointer) { | ||
646 | // ignore | 648 | // ignore | ||
647 | return; | 649 | return; | ||
648 | } | 650 | } | ||
649 | const quint32 serial = d->display->nextSerial(); | 651 | const quint32 serial = d->display->nextSerial(); | ||
650 | if (d->globalPointer.focus.pointer) { | 652 | for (auto it = d->globalPointer.focus.pointers.constBegin(), end = d->globalPointer.focus.pointers.constEnd(); it != end; ++it) { | ||
651 | d->globalPointer.focus.pointer->setFocusedSurface(nullptr, serial); | 653 | (*it)->setFocusedSurface(nullptr, serial); | ||
652 | } | 654 | } | ||
653 | if (d->globalPointer.focus.surface) { | 655 | if (d->globalPointer.focus.surface) { | ||
654 | disconnect(d->globalPointer.focus.destroyConnection); | 656 | disconnect(d->globalPointer.focus.destroyConnection); | ||
655 | } | 657 | } | ||
656 | d->globalPointer.focus = Private::Pointer::Focus(); | 658 | d->globalPointer.focus = Private::Pointer::Focus(); | ||
657 | d->globalPointer.focus.surface = surface; | 659 | d->globalPointer.focus.surface = surface; | ||
658 | PointerInterface *p = d->pointerForSurface(surface); | 660 | auto p = d->pointersForSurface(surface); | ||
659 | if (p && !p->resource()) { | 661 | d->globalPointer.focus.pointers = p; | ||
660 | p = nullptr; | | |||
661 | } | | |||
662 | d->globalPointer.focus.pointer = p; | | |||
663 | if (d->globalPointer.focus.surface) { | 662 | if (d->globalPointer.focus.surface) { | ||
664 | d->globalPointer.focus.destroyConnection = connect(surface, &QObject::destroyed, this, | 663 | d->globalPointer.focus.destroyConnection = connect(surface, &QObject::destroyed, this, | ||
665 | [this] { | 664 | [this] { | ||
666 | Q_D(); | 665 | Q_D(); | ||
667 | d->globalPointer.focus = Private::Pointer::Focus(); | 666 | d->globalPointer.focus = Private::Pointer::Focus(); | ||
668 | emit focusedPointerChanged(nullptr); | 667 | emit focusedPointerChanged(nullptr); | ||
669 | } | 668 | } | ||
670 | ); | 669 | ); | ||
671 | d->globalPointer.focus.offset = QPointF(); | 670 | d->globalPointer.focus.offset = QPointF(); | ||
672 | d->globalPointer.focus.transformation = transformation; | 671 | d->globalPointer.focus.transformation = transformation; | ||
673 | d->globalPointer.focus.serial = serial; | 672 | d->globalPointer.focus.serial = serial; | ||
674 | } | 673 | } | ||
675 | emit focusedPointerChanged(p); | 674 | if (p.isEmpty()) { | ||
676 | if (!p) { | 675 | emit focusedPointerChanged(nullptr); | ||
677 | return; | 676 | return; | ||
678 | } | 677 | } | ||
679 | p->setFocusedSurface(surface, serial); | 678 | // TODO: signal with all pointers | ||
679 | emit focusedPointerChanged(p.first()); | ||||
680 | for (auto it = p.constBegin(), end = p.constEnd(); it != end; ++it) { | ||||
681 | (*it)->setFocusedSurface(surface, serial); | ||||
682 | } | ||||
680 | } | 683 | } | ||
681 | 684 | | |||
682 | PointerInterface *SeatInterface::focusedPointer() const | 685 | PointerInterface *SeatInterface::focusedPointer() const | ||
683 | { | 686 | { | ||
684 | Q_D(); | 687 | Q_D(); | ||
685 | return d->globalPointer.focus.pointer; | 688 | if (d->globalPointer.focus.pointers.isEmpty()) { | ||
689 | return nullptr; | ||||
690 | } | ||||
691 | return d->globalPointer.focus.pointers.first(); | ||||
686 | } | 692 | } | ||
687 | 693 | | |||
688 | void SeatInterface::setFocusedPointerSurfacePosition(const QPointF &surfacePosition) | 694 | void SeatInterface::setFocusedPointerSurfacePosition(const QPointF &surfacePosition) | ||
689 | { | 695 | { | ||
690 | Q_D(); | 696 | Q_D(); | ||
691 | if (d->globalPointer.focus.surface) { | 697 | if (d->globalPointer.focus.surface) { | ||
692 | d->globalPointer.focus.offset = surfacePosition; | 698 | d->globalPointer.focus.offset = surfacePosition; | ||
693 | d->globalPointer.focus.transformation = QMatrix4x4(); | 699 | d->globalPointer.focus.transformation = QMatrix4x4(); | ||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | |||||
762 | 768 | | |||
763 | void SeatInterface::pointerAxis(Qt::Orientation orientation, quint32 delta) | 769 | void SeatInterface::pointerAxis(Qt::Orientation orientation, quint32 delta) | ||
764 | { | 770 | { | ||
765 | Q_D(); | 771 | Q_D(); | ||
766 | if (d->drag.mode == Private::Drag::Mode::Pointer) { | 772 | if (d->drag.mode == Private::Drag::Mode::Pointer) { | ||
767 | // ignore | 773 | // ignore | ||
768 | return; | 774 | return; | ||
769 | } | 775 | } | ||
770 | if (d->globalPointer.focus.pointer && d->globalPointer.focus.surface) { | 776 | if (d->globalPointer.focus.surface) { | ||
771 | d->globalPointer.focus.pointer->axis(orientation, delta); | 777 | for (auto it = d->globalPointer.focus.pointers.constBegin(), end = d->globalPointer.focus.pointers.constEnd(); it != end; ++it) { | ||
778 | (*it)->axis(orientation, delta); | ||||
779 | } | ||||
772 | } | 780 | } | ||
773 | } | 781 | } | ||
774 | 782 | | |||
775 | void SeatInterface::pointerButtonPressed(Qt::MouseButton button) | 783 | void SeatInterface::pointerButtonPressed(Qt::MouseButton button) | ||
776 | { | 784 | { | ||
777 | const quint32 nativeButton = qtToWaylandButton(button); | 785 | const quint32 nativeButton = qtToWaylandButton(button); | ||
778 | if (nativeButton == 0) { | 786 | if (nativeButton == 0) { | ||
779 | return; | 787 | return; | ||
780 | } | 788 | } | ||
781 | pointerButtonPressed(nativeButton); | 789 | pointerButtonPressed(nativeButton); | ||
782 | } | 790 | } | ||
783 | 791 | | |||
784 | void SeatInterface::pointerButtonPressed(quint32 button) | 792 | void SeatInterface::pointerButtonPressed(quint32 button) | ||
785 | { | 793 | { | ||
786 | Q_D(); | 794 | Q_D(); | ||
787 | const quint32 serial = d->display->nextSerial(); | 795 | const quint32 serial = d->display->nextSerial(); | ||
788 | d->updatePointerButtonSerial(button, serial); | 796 | d->updatePointerButtonSerial(button, serial); | ||
789 | d->updatePointerButtonState(button, Private::Pointer::State::Pressed); | 797 | d->updatePointerButtonState(button, Private::Pointer::State::Pressed); | ||
790 | if (d->drag.mode == Private::Drag::Mode::Pointer) { | 798 | if (d->drag.mode == Private::Drag::Mode::Pointer) { | ||
791 | // ignore | 799 | // ignore | ||
792 | return; | 800 | return; | ||
793 | } | 801 | } | ||
794 | if (d->globalPointer.focus.pointer && d->globalPointer.focus.surface) { | 802 | if (d->globalPointer.focus.surface) { | ||
795 | d->globalPointer.focus.pointer->buttonPressed(button, serial); | 803 | for (auto it = d->globalPointer.focus.pointers.constBegin(), end = d->globalPointer.focus.pointers.constEnd(); it != end; ++it) { | ||
804 | (*it)->buttonPressed(button, serial); | ||||
805 | } | ||||
796 | if (d->globalPointer.focus.surface == d->keys.focus.surface) { | 806 | if (d->globalPointer.focus.surface == d->keys.focus.surface) { | ||
797 | // update the focused child surface | 807 | // update the focused child surface | ||
808 | auto p = focusedPointer(); | ||||
809 | if (p) { | ||||
798 | for (auto it = d->keys.focus.keyboards.constBegin(), end = d->keys.focus.keyboards.constEnd(); it != end; ++it) { | 810 | for (auto it = d->keys.focus.keyboards.constBegin(), end = d->keys.focus.keyboards.constEnd(); it != end; ++it) { | ||
799 | (*it)->d_func()->focusChildSurface(d->globalPointer.focus.pointer->d_func()->focusedChildSurface, serial); | 811 | (*it)->d_func()->focusChildSurface(p->d_func()->focusedChildSurface, serial); | ||
812 | } | ||||
800 | } | 813 | } | ||
801 | } | 814 | } | ||
802 | } | 815 | } | ||
803 | } | 816 | } | ||
804 | 817 | | |||
805 | void SeatInterface::pointerButtonReleased(Qt::MouseButton button) | 818 | void SeatInterface::pointerButtonReleased(Qt::MouseButton button) | ||
806 | { | 819 | { | ||
807 | const quint32 nativeButton = qtToWaylandButton(button); | 820 | const quint32 nativeButton = qtToWaylandButton(button); | ||
Show All 13 Lines | 828 | { | |||
821 | if (d->drag.mode == Private::Drag::Mode::Pointer) { | 834 | if (d->drag.mode == Private::Drag::Mode::Pointer) { | ||
822 | if (d->drag.source->dragImplicitGrabSerial() != currentButtonSerial) { | 835 | if (d->drag.source->dragImplicitGrabSerial() != currentButtonSerial) { | ||
823 | // not our drag button - ignore | 836 | // not our drag button - ignore | ||
824 | return; | 837 | return; | ||
825 | } | 838 | } | ||
826 | d->endDrag(serial); | 839 | d->endDrag(serial); | ||
827 | return; | 840 | return; | ||
828 | } | 841 | } | ||
829 | if (d->globalPointer.focus.pointer && d->globalPointer.focus.surface) { | 842 | if (d->globalPointer.focus.surface) { | ||
830 | d->globalPointer.focus.pointer->buttonReleased(button, serial); | 843 | for (auto it = d->globalPointer.focus.pointers.constBegin(), end = d->globalPointer.focus.pointers.constEnd(); it != end; ++it) { | ||
844 | (*it)->buttonReleased(button, serial); | ||||
845 | } | ||||
831 | } | 846 | } | ||
832 | } | 847 | } | ||
833 | 848 | | |||
834 | quint32 SeatInterface::pointerButtonSerial(Qt::MouseButton button) const | 849 | quint32 SeatInterface::pointerButtonSerial(Qt::MouseButton button) const | ||
835 | { | 850 | { | ||
836 | return pointerButtonSerial(qtToWaylandButton(button)); | 851 | return pointerButtonSerial(qtToWaylandButton(button)); | ||
837 | } | 852 | } | ||
838 | 853 | | |||
839 | quint32 SeatInterface::pointerButtonSerial(quint32 button) const | 854 | quint32 SeatInterface::pointerButtonSerial(quint32 button) const | ||
840 | { | 855 | { | ||
841 | Q_D(); | 856 | Q_D(); | ||
842 | auto it = d->globalPointer.buttonSerials.constFind(button); | 857 | auto it = d->globalPointer.buttonSerials.constFind(button); | ||
843 | if (it == d->globalPointer.buttonSerials.constEnd()) { | 858 | if (it == d->globalPointer.buttonSerials.constEnd()) { | ||
844 | return 0; | 859 | return 0; | ||
845 | } | 860 | } | ||
846 | return it.value(); | 861 | return it.value(); | ||
847 | } | 862 | } | ||
848 | 863 | | |||
849 | void SeatInterface::relativePointerMotion(const QSizeF &delta, const QSizeF &deltaNonAccelerated, quint64 microseconds) | 864 | void SeatInterface::relativePointerMotion(const QSizeF &delta, const QSizeF &deltaNonAccelerated, quint64 microseconds) | ||
850 | { | 865 | { | ||
851 | Q_D(); | 866 | Q_D(); | ||
852 | if (d->globalPointer.focus.pointer && d->globalPointer.focus.surface) { | 867 | if (d->globalPointer.focus.surface) { | ||
853 | d->globalPointer.focus.pointer->relativeMotion(delta, deltaNonAccelerated, microseconds); | 868 | for (auto it = d->globalPointer.focus.pointers.constBegin(), end = d->globalPointer.focus.pointers.constEnd(); it != end; ++it) { | ||
869 | (*it)->relativeMotion(delta, deltaNonAccelerated, microseconds); | ||||
870 | } | ||||
854 | } | 871 | } | ||
855 | } | 872 | } | ||
856 | 873 | | |||
857 | void SeatInterface::keyPressed(quint32 key) | 874 | void SeatInterface::keyPressed(quint32 key) | ||
858 | { | 875 | { | ||
859 | Q_D(); | 876 | Q_D(); | ||
860 | d->keys.lastStateSerial = d->display->nextSerial(); | 877 | d->keys.lastStateSerial = d->display->nextSerial(); | ||
861 | if (!d->updateKey(key, Private::Keyboard::State::Pressed)) { | 878 | if (!d->updateKey(key, Private::Keyboard::State::Pressed)) { | ||
▲ Show 20 Lines • Show All 268 Lines • ▼ Show 20 Line(s) | |||||
1130 | { | 1147 | { | ||
1131 | Q_D(); | 1148 | Q_D(); | ||
1132 | const qint32 id = d->touchInterface.ids.isEmpty() ? 0 : d->touchInterface.ids.last() + 1; | 1149 | const qint32 id = d->touchInterface.ids.isEmpty() ? 0 : d->touchInterface.ids.last() + 1; | ||
1133 | const quint32 serial = display()->nextSerial(); | 1150 | const quint32 serial = display()->nextSerial(); | ||
1134 | if (d->touchInterface.focus.touch && d->touchInterface.focus.surface) { | 1151 | if (d->touchInterface.focus.touch && d->touchInterface.focus.surface) { | ||
1135 | d->touchInterface.focus.touch->down(id, serial, globalPosition - d->touchInterface.focus.offset); | 1152 | d->touchInterface.focus.touch->down(id, serial, globalPosition - d->touchInterface.focus.offset); | ||
1136 | } else if (id == 0 && focusedTouchSurface()) { | 1153 | } else if (id == 0 && focusedTouchSurface()) { | ||
1137 | #if HAVE_LINUX_INPUT_H | 1154 | #if HAVE_LINUX_INPUT_H | ||
1138 | auto p = d->pointerForSurface(focusedTouchSurface()); | 1155 | auto p = d->pointersForSurface(focusedTouchSurface()); | ||
1139 | if (!p) { | 1156 | if (p.isEmpty()) { | ||
1140 | return id; | 1157 | return id; | ||
1141 | } | 1158 | } | ||
1142 | const QPointF pos = globalPosition - d->touchInterface.focus.offset; | 1159 | const QPointF pos = globalPosition - d->touchInterface.focus.offset; | ||
1143 | wl_pointer_send_enter(p->resource(), serial, | 1160 | for (auto it = p.constBegin(), end = p.constEnd(); it != end; ++it) { | ||
1161 | wl_pointer_send_enter((*it)->resource(), serial, | ||||
1144 | focusedTouchSurface()->resource(), | 1162 | focusedTouchSurface()->resource(), | ||
1145 | wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y())); | 1163 | wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y())); | ||
1146 | wl_pointer_send_motion(p->resource(), timestamp(), | 1164 | wl_pointer_send_motion((*it)->resource(), timestamp(), | ||
1147 | wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y())); | 1165 | wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y())); | ||
1148 | 1166 | | |||
1149 | wl_pointer_send_button(p->resource(), serial, timestamp(), BTN_LEFT, WL_POINTER_BUTTON_STATE_PRESSED); | 1167 | wl_pointer_send_button((*it)->resource(), serial, timestamp(), BTN_LEFT, WL_POINTER_BUTTON_STATE_PRESSED); | ||
1168 | } | ||||
1150 | #endif | 1169 | #endif | ||
1151 | } | 1170 | } | ||
1152 | 1171 | | |||
1153 | d->touchInterface.ids << id; | 1172 | d->touchInterface.ids << id; | ||
1154 | return id; | 1173 | return id; | ||
1155 | } | 1174 | } | ||
1156 | 1175 | | |||
1157 | void SeatInterface::touchMove(qint32 id, const QPointF &globalPosition) | 1176 | void SeatInterface::touchMove(qint32 id, const QPointF &globalPosition) | ||
1158 | { | 1177 | { | ||
1159 | Q_D(); | 1178 | Q_D(); | ||
1160 | if (d->touchInterface.focus.touch && d->touchInterface.focus.surface) { | 1179 | if (d->touchInterface.focus.touch && d->touchInterface.focus.surface) { | ||
1161 | d->touchInterface.focus.touch->move(id, globalPosition - d->touchInterface.focus.offset); | 1180 | d->touchInterface.focus.touch->move(id, globalPosition - d->touchInterface.focus.offset); | ||
1162 | } else if (id == 0 && focusedTouchSurface()) { | 1181 | } else if (id == 0 && focusedTouchSurface()) { | ||
1163 | auto p = d->pointerForSurface(focusedTouchSurface()); | 1182 | auto p = d->pointersForSurface(focusedTouchSurface()); | ||
1164 | if (!p) { | 1183 | if (p.isEmpty()) { | ||
1165 | return; | 1184 | return; | ||
1166 | } | 1185 | } | ||
1167 | 1186 | | |||
1168 | const QPointF pos = globalPosition - d->touchInterface.focus.offset; | 1187 | const QPointF pos = globalPosition - d->touchInterface.focus.offset; | ||
1169 | wl_pointer_send_motion(p->resource(), timestamp(), | 1188 | for (auto it = p.constBegin(), end = p.constEnd(); it != end; ++it) { | ||
1189 | wl_pointer_send_motion((*it)->resource(), timestamp(), | ||||
1170 | wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y())); | 1190 | wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y())); | ||
1171 | } | 1191 | } | ||
1172 | } | 1192 | } | ||
1193 | } | ||||
1173 | 1194 | | |||
1174 | void SeatInterface::touchUp(qint32 id) | 1195 | void SeatInterface::touchUp(qint32 id) | ||
1175 | { | 1196 | { | ||
1176 | Q_D(); | 1197 | Q_D(); | ||
1177 | Q_ASSERT(d->touchInterface.ids.contains(id)); | 1198 | Q_ASSERT(d->touchInterface.ids.contains(id)); | ||
1178 | if (d->touchInterface.focus.touch && d->touchInterface.focus.surface) { | 1199 | if (d->touchInterface.focus.touch && d->touchInterface.focus.surface) { | ||
1179 | d->touchInterface.focus.touch->up(id, display()->nextSerial()); | 1200 | d->touchInterface.focus.touch->up(id, display()->nextSerial()); | ||
1180 | } else if (id == 0 && focusedTouchSurface()) { | 1201 | } else if (id == 0 && focusedTouchSurface()) { | ||
1181 | #if HAVE_LINUX_INPUT_H | 1202 | #if HAVE_LINUX_INPUT_H | ||
1182 | const quint32 serial = display()->nextSerial(); | 1203 | const quint32 serial = display()->nextSerial(); | ||
1183 | auto p = d->pointerForSurface(focusedTouchSurface()); | 1204 | auto p = d->pointersForSurface(focusedTouchSurface()); | ||
1184 | if (!p) { | 1205 | if (p.isEmpty()) { | ||
1185 | return; | 1206 | return; | ||
1186 | } | 1207 | } | ||
1187 | 1208 | | |||
1188 | wl_pointer_send_button(p->resource(), serial, timestamp(), BTN_LEFT, WL_POINTER_BUTTON_STATE_RELEASED); | 1209 | for (auto it = p.constBegin(), end = p.constEnd(); it != end; ++it) { | ||
1210 | wl_pointer_send_button((*it)->resource(), serial, timestamp(), BTN_LEFT, WL_POINTER_BUTTON_STATE_RELEASED); | ||||
1211 | } | ||||
1189 | #endif | 1212 | #endif | ||
1190 | } | 1213 | } | ||
1191 | d->touchInterface.ids.removeAll(id); | 1214 | d->touchInterface.ids.removeAll(id); | ||
1192 | } | 1215 | } | ||
1193 | 1216 | | |||
1194 | void SeatInterface::touchFrame() | 1217 | void SeatInterface::touchFrame() | ||
1195 | { | 1218 | { | ||
1196 | Q_D(); | 1219 | Q_D(); | ||
▲ Show 20 Lines • Show All 137 Lines • Show Last 20 Lines |