Skip to content

Commit

Permalink
Move connector_id to DrmWindowHandle
Browse files Browse the repository at this point in the history
  • Loading branch information
morr0ne committed Jul 5, 2024
1 parent 332ee85 commit 2c43a16
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ pub struct DrmDisplayHandle {
/// The drm file descriptor.
// TODO: Use `std::os::fd::RawFd`?
pub fd: i32,
pub connector_id: u32,
}

impl DrmDisplayHandle {
Expand All @@ -226,13 +225,11 @@ impl DrmDisplayHandle {
/// # use raw_window_handle::DrmDisplayHandle;
/// #
/// let fd: i32;
/// let connector_id: u32;
/// # fd = 0;
/// # connector_id = 0;
/// let handle = DrmDisplayHandle::new(fd, connector_id);
/// let handle = DrmDisplayHandle::new(fd);
/// ```
pub fn new(fd: i32, connector_id: u32) -> Self {
Self { fd, connector_id }
pub fn new(fd: i32) -> Self {
Self { fd }
}
}

Expand All @@ -242,6 +239,7 @@ impl DrmDisplayHandle {
pub struct DrmWindowHandle {
/// The primary drm plane handle.
pub plane: u32,
pub connector_id: Option<NonZeroU32>,
}

impl DrmWindowHandle {
Expand All @@ -258,7 +256,10 @@ impl DrmWindowHandle {
/// let handle = DrmWindowHandle::new(plane);
/// ```
pub fn new(plane: u32) -> Self {
Self { plane }
Self {
plane,
connector_id: None,
}
}
}

Expand Down

0 comments on commit 2c43a16

Please sign in to comment.