···256256 bool position_tracking;
257257 bool hand_tracking;
258258 bool eye_gaze;
259259+ bool presence;
259260 bool force_feedback;
260261 bool ref_space_usage;
261262 bool form_factor_check;
···450451 * @param[out] limits The returned limits.
451452 */
452453 xrt_result_t (*get_output_limits)(struct xrt_device *xdev, struct xrt_output_limits *limits);
454454+455455+ /*!
456456+ * @brief Get current presence status of the device.
457457+ *
458458+ * @param[in] xdev The device.
459459+ * @param[out] presence The returned presence status.
460460+ */
461461+ xrt_result_t (*get_presence)(struct xrt_device *xdev, bool *presence);
453462454463 /*!
455464 * Begin a plane detection request
···753762{
754763 if (xdev->get_output_limits) {
755764 return xdev->get_output_limits(xdev, limits);
765765+ } else {
766766+ return XRT_ERROR_NOT_IMPLEMENTED;
767767+ }
768768+}
769769+770770+/*!
771771+ * Helper function for @ref xrt_device::get_presence.
772772+ *
773773+ * @copydoc xrt_device::get_presence
774774+ *
775775+ * @public @memberof xrt_device
776776+ */
777777+static inline xrt_result_t
778778+xrt_device_get_presence(struct xrt_device *xdev, bool *presence)
779779+{
780780+ if (xdev->get_presence) {
781781+ return xdev->get_presence(xdev, presence);
756782 } else {
757783 return XRT_ERROR_NOT_IMPLEMENTED;
758784 }
+14-1
src/xrt/include/xrt/xrt_session.h
···6363 XRT_SESSION_EVENT_PASSTHRU_STATE_CHANGE = 8,
64646565 // ! The visibility mask of given view has changed
6666- XRT_SESSION_EVENT_VISIBILITY_MASK_CHANGE = 9
6666+ XRT_SESSION_EVENT_VISIBILITY_MASK_CHANGE = 9,
6767+6868+ //! User presence has changed (hmd may have been put on or removed)
6969+ XRT_SESSION_EVENT_USER_PRESENCE_CHANGE = 10,
6770};
68716972/*!
···177180};
178181179182/*!
183183+ * User presence changed event
184184+ */
185185+struct xrt_session_event_user_presence_change
186186+{
187187+ enum xrt_session_event_type type;
188188+ bool is_user_present;
189189+};
190190+191191+/*!
180192 * Union of all session events, used to return multiple events through one call.
181193 * Each event struct must start with a @ref xrt_session_event_type field.
182194 *
···194206 struct xrt_session_event_perf_change performance;
195207 struct xrt_session_event_passthrough_state_change passthru;
196208 struct xrt_session_event_visibility_mask_change mask_change;
209209+ struct xrt_session_event_user_presence_change presence_change;
197210};
198211199212/*!