Skip to content
Commit 8e304963 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Make pointer focus handling less error prone

Currently, if the pointer surface has to change between two surfaces,
the compositor must do the following

    seat->setFocusedPointerSurface(nullptr);
    seat->notifyPointerMotion(newPos);
    seat->setFocusedPointerSurface(focus);

The pointer motion is needed so the enter event has correct position,
setFocusedPointerSurface(nullptr) is needed to avoid sending a bad
motion event before the leave event.

This change makes the pointer focus api less error prone by splitting
setFocusedPointerSurface() in two functions - notifyPointerEnter() and
notifyPointerLeave().

notifyPointerEnter() takes new focus surface as well as the position
where the pointer has entered the surface so the focus update can be
atomic and without any corner cases.

notifyPointerLeave() is used to clear pointer focus.
parent fccbe4e0
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment