Skip to content

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

@tgrushka

Description

@tgrushka

Would be nice if Device had the following:

  1. Automatically call Device::ungrab() on Drop -- does not guarantee an ungrab if the app does not unwind or exit cleanly, but if users ensure that it does exit cleanly, guarantees the kernel grab release will be attempted on Drop.

  2. Expose Device::is_grabbed() that just returns the value of .grabbed (private field) so that users can inspect the grabbed state without having to call grab() or ungrab(), which still doesn't tell you the current state, and without having to keep track of it separately in simple cases.

  3. Derive Debug for Device -- small change, but a huge convenience to the annoyance of not being able to derive Debug on a struct with a Device field.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions