MCPcopy Create free account
hub / github.com/KDE/kwin / focusUpdate

Method focusUpdate

src/pointer_input.cpp:628–659  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

626}
627
628void 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
661void PointerInputRedirection::breakPointerConstraints(SurfaceInterface *surface)
662{

Callers

nothing calls this directly

Calls 12

waylandServerFunction · 0.85
workspaceFunction · 0.85
notifyPointerLeaveMethod · 0.80
notifyPointerEnterMethod · 0.80
inputTransformationMethod · 0.80
ConnectionClass · 0.50
isClientMethod · 0.45
pointerLeaveEventMethod · 0.45
surfaceMethod · 0.45
pointerEnterEventMethod · 0.45
seatMethod · 0.45

Tested by

no test coverage detected