Skip to content

Commit

Permalink
Add new_with_connector_id constructor to DrmWindowHandle
Browse files Browse the repository at this point in the history
  • Loading branch information
morr0ne committed Jul 13, 2024
1 parent 1eb46ad commit e51370e
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,28 @@ impl DrmWindowHandle {
connector_id: None,
}
}

/// Create a new handle to a plane and associated connector_id.
///
///
/// # Example
///
/// ```
/// # use raw_window_handle::DrmWindowHandle;
/// # use core::num::NonZeroU32;
/// #
/// let plane: u32;
/// # plane = 0;
/// let connector_id: NonZeroU32;
/// # connect_id = unsafe { NonZeroU32::new_unchecked(1) };
/// let handle = DrmWindowHandle::new_with_connector_id(plane, connector_id);

Check failure on line 279 in src/unix.rs

View workflow job for this annotation

GitHub Actions / Tests (stable)

cannot find value `connect_id` in this scope

Check failure on line 279 in src/unix.rs

View workflow job for this annotation

GitHub Actions / Tests (nightly)

cannot find value `connect_id` in this scope
/// ```
pub fn new_with_connector_id(plane: u32, connector_id: NonZeroU32) -> Self {
Self {
plane,
connector_id: Some(connector_id),
}
}
}

/// Raw display handle for the Linux Generic Buffer Manager.
Expand Down

0 comments on commit e51370e

Please sign in to comment.