Make (Active)EventLoop::create_custom_cursor() return a Result<CustomCursor, ExternalError>#3844
Merged
daxpedda merged 1 commit intorust-windowing:masterfrom Aug 6, 2024
Conversation
5 tasks
2f20dac to
08a3734
Compare
MarijnS95
reviewed
Aug 6, 2024
(Active)EventLoop::create_custom_error() return a Result<CustomCursor, ExternalError>(Active)EventLoop::create_custom_cursor() return a Result<CustomCursor, ExternalError>
08a3734 to
e0f2d1a
Compare
MarijnS95
approved these changes
Aug 6, 2024
| &self, | ||
| _source: CustomCursorSource, | ||
| ) -> Result<CustomCursor, ExternalError> { | ||
| Err(ExternalError::NotSupported(NotSupportedError::new())) |
Member
There was a problem hiding this comment.
In the future, if we do more JNI wrapping, we can provide custom Bitmaps in the future using https://developer.android.com/reference/android/view/PointerIcon. Only when the user attaches a mouse to their Android device :)
kchibisov
approved these changes
Aug 6, 2024
Member
kchibisov
left a comment
There was a problem hiding this comment.
Should be fine, though, I'd probably change the type of error we return in the future.
e0f2d1a to
1bfa5ae
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR changes
(Active)EventLoop::create_custom_cursor()to return aResult<CustomCursor, ExternalError>.ExternalError::Unsupported.set_custom_cursor()instead, so it currently panics there.create_custom_cursor_async()to properly return an error.Related #3306.
Follow-up to #3749.