Skip to content

Conversation

@tgrushka
Copy link
Contributor

Fixes #157.

  1. Adds impl Drop for Device to call Device::ungrab() on drop.

  2. Adds Device::is_grabbed() -> bool and RawDevice::is_grabbed() -> bool to allow inspection of current grab state.

  3. Derives Debug for Device.

…or Device; expose is_grabbed() on Device and RawDevice
Copy link
Collaborator

@coolreader18 coolreader18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems very reasonable, thank you!

@coolreader18 coolreader18 merged commit c4fadbe into emberian:main Apr 1, 2025
5 checks passed
@SludgePhD
Copy link

  1. Adds impl Drop for Device to call Device::ungrab() on drop.

Are you sure this is necessary? In my testing the input subsystem will ungrab the device automatically when the fd is closed (which already happened on drop).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancements: Device should ungrab on Drop, derive Debug, and expose is_grabbed()

3 participants