Skip to content

cursor: refactor CustomCursor to be dyn#4163

Merged
kchibisov merged 2 commits intomasterfrom
kchibisov/dyn-cursor
Mar 13, 2025
Merged

cursor: refactor CustomCursor to be dyn#4163
kchibisov merged 2 commits intomasterfrom
kchibisov/dyn-cursor

Conversation

@kchibisov
Copy link
Copy Markdown
Member

@kchibisov kchibisov commented Mar 11, 2025

Same as for MonitorHandle, the source was changed to support all kinds of sources.

Part of #3433.

@kchibisov kchibisov force-pushed the kchibisov/dyn-cursor branch 6 times, most recently from 064d689 to 7ef88ff Compare March 11, 2025 14:57
Copy link
Copy Markdown
Member

@madsmtm madsmtm left a comment

Choose a reason for hiding this comment

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

I suspect we'll want to remove CustomCursorSource altogether, and provide ActiveEventLoop::create_custom_cursor_from_[rgba|animation|url](...) instead.

But that can (and should) be done in a follow-up, happy with this for now!

@kchibisov
Copy link
Copy Markdown
Member Author

kchibisov commented Mar 12, 2025

I suspect we'll want to remove CustomCursorSource altogether, and provide ActiveEventLoop::create_custom_cursor_from_rgba|animation|url instead.

No, it doesn't require anything running and should be loadable without event loop. The CustomCursor on the other side, is a handle to what you've loaded before, while source is a raw data.

@madsmtm
Copy link
Copy Markdown
Member

madsmtm commented Mar 12, 2025

I suspect we'll want to remove CustomCursorSource altogether, and provide ActiveEventLoop::create_custom_cursor_from_rgba|animation|url instead.

No, it doesn't require anything running and should be loadable without event loop. The CustomCursor on the other side, is a handle to what you've loaded before, while source is a raw data.

I meant for these proposed methods to directly return CustomCursor (which isn't loadable without the event loop (as that doesn't work on WASM)).

@kchibisov
Copy link
Copy Markdown
Member Author

Our custom cursors work in a way that we create a source and then load into the event loop so cursor is not slow. The methods like from_rgba, etc, are needed to do initial data sanitation and prepare the assets ahead of time, like we do in the app example.

So I don't see how we'd move away from it or what for. We may eventually figure out how to merge source and cursor so the loading is transparent, but that's a different matter, if that's what you've asked about, indeed.

@madsmtm
Copy link
Copy Markdown
Member

madsmtm commented Mar 12, 2025

We may eventually figure out how to merge source and cursor so the loading is transparent, but that's a different matter, if that's what you've asked about, indeed.

Yeah, that's what I was discussing, and it's indeed a different matter.

@kchibisov kchibisov requested a review from madsmtm March 13, 2025 12:39
Same as for `MonitorHandle`, the source was changed to support
all kinds of sources.
@kchibisov kchibisov force-pushed the kchibisov/dyn-cursor branch from 7ef88ff to 17ea40f Compare March 13, 2025 14:09
@kchibisov kchibisov requested review from madsmtm and removed request for madsmtm March 13, 2025 14:13
@kchibisov kchibisov merged commit ae28eea into master Mar 13, 2025
57 checks passed
@kchibisov kchibisov deleted the kchibisov/dyn-cursor branch March 13, 2025 14:18
@madsmtm madsmtm added the S - api Design and usability label Mar 13, 2025
@madsmtm madsmtm mentioned this pull request May 15, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S - api Design and usability

Development

Successfully merging this pull request may close these issues.

2 participants