Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error handling and resource cleanup in linux/x11/window.rs #21079

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

mgsloan
Copy link
Contributor

@mgsloan mgsloan commented Nov 22, 2024

  • Fixes registration of event handler for xinput-2 device changes, revealed by this improvement.

  • Pushes .unwrap() panic-ing outwards to callers.

  • Includes a description of what the X11 call was doing when a failure was encountered.

  • Fixes a variety of places where the X11 reply wasn't being inspected for failures.

  • Destroys windows on failure during setup. New structure makes it possible for the caller of open_window to carry on despite failures, and so partially initialized window should be removed (though all calls I looked at also panic currently).

Considered pushing this through linux/x11/client.rs too but figured it'd be nice to minimize merge conflicts with #20853.

Release Notes:

  • N/A

@mgsloan mgsloan force-pushed the improve-x11-error-handling-in-window-rs branch 2 times, most recently from 8381c5c to 0a7495d Compare November 22, 2024 21:43
* Fixes registration of event handler for xinput-2 device changes,
revealed by this improvement.

* Pushes `.unwrap()` panic-ing outwards to callers.

* Includes a description of what the X11 call was doing when a failure
was encountered.

* Fixes a variety of places where the X11 reply wasn't being inspected
for failures.

* Destroys windows on failure during setup. New structure makes it
possible for the caller of `open_window` to carry on despite failures,
and so partially initialized window should be removed (though all
calls I looked at also panic currently).

Considered pushing this through `linux/x11/client.rs` too but figured it'd be nice to minimize merge conflicts with #20853.
@mgsloan mgsloan force-pushed the improve-x11-error-handling-in-window-rs branch from 0a7495d to ed01141 Compare November 22, 2024 22:41
@mgsloan mgsloan merged commit c9f2c27 into main Nov 22, 2024
12 checks passed
@mgsloan mgsloan deleted the improve-x11-error-handling-in-window-rs branch November 22, 2024 23:03
@notpeter notpeter added the cla-signed The user has signed the Contributor License Agreement label Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants