I also would like to add that the relative events should be consumed when the compositor confirms that the pointer is locked or confined.
zwp_confined_pointer_v1_listener and zwp_locked_pointer_v1_listener should be used to listen for events, because the protocol does not guarantee immediate locking. Compositor may never lock the pointer or may unlock it at will, so there is a little sense in relative events without confirmed locks.
However, maybe this is a task for another patch.