| 626 | } |
| 627 | |
| 628 | void PointerInputRedirection::focusUpdate(Window *focusOld, Window *focusNow) |
| 629 | { |
| 630 | if (focusOld && focusOld->isClient()) { |
| 631 | focusOld->pointerLeaveEvent(); |
| 632 | breakPointerConstraints(focusOld->surface()); |
| 633 | disconnectPointerConstraintsConnection(); |
| 634 | } |
| 635 | disconnect(m_focusGeometryConnection); |
| 636 | m_focusGeometryConnection = QMetaObject::Connection(); |
| 637 | |
| 638 | if (focusNow && focusNow->isClient()) { |
| 639 | focusNow->pointerEnterEvent(m_pos); |
| 640 | } |
| 641 | |
| 642 | auto seat = waylandServer()->seat(); |
| 643 | if (!focusNow || !focusNow->surface()) { |
| 644 | seat->notifyPointerLeave(); |
| 645 | return; |
| 646 | } |
| 647 | |
| 648 | seat->notifyPointerEnter(focusNow->surface(), m_pos, focusNow->inputTransformation()); |
| 649 | |
| 650 | m_focusGeometryConnection = connect(focusNow, &Window::inputTransformationChanged, this, [this]() { |
| 651 | waylandServer()->seat()->setFocusedPointerSurfaceTransformation(focus()->inputTransformation()); |
| 652 | }); |
| 653 | |
| 654 | m_constraintsConnection = connect(focusNow->surface(), &SurfaceInterface::pointerConstraintsChanged, |
| 655 | this, &PointerInputRedirection::updatePointerConstraints); |
| 656 | m_constraintsActivatedConnection = connect(workspace(), &Workspace::windowActivated, |
| 657 | this, &PointerInputRedirection::updatePointerConstraints); |
| 658 | updatePointerConstraints(); |
| 659 | } |
| 660 | |
| 661 | void PointerInputRedirection::breakPointerConstraints(SurfaceInterface *surface) |
| 662 | { |
nothing calls this directly
no test coverage detected