-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
protocol: add cursor_shape #32
Conversation
dcc1e4f
to
cf98302
Compare
@YaLTeR should probably work now. |
80318ee
to
db00be8
Compare
Okay, I believe I got everything working now. |
Oh, looks like I accidentally erased the commit author. How do I get it back easily? |
static FALLBACK_CURSOR_DATA: &[u8] = include_bytes!("../resources/cursor.rgba"); | ||
|
||
type CursorCache = HashMap<i32, (TextureBuffer<GlesTexture>, Point<i32, Physical>)>; | ||
type XCursorCache = HashMap<(CursorIcon, i32), Option<Rc<XCursor>>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason it's being stored in Rc
? It's not like using references won't really work when providing the cached item, given that it worked just fine before.
The only benefit of Rc
which you're not using is to spread the default cursor into other variants.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I needed &self
in get()
signature, so I need this inside a RefCell
. So the get()
would need to return a Ref
or RefMut
. But I couldn't map RefMut<HashMap>
into a RefMut<Option<&XCursor>>
, only a RefMut<Option<XCursor>>
, which is not what I wanted. So I changed it to an Rc
. Basically, battle lost with the borrow checker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you see, RefCell
is evil, could just have &mut
and it'll be more or less fine...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it's fine then.
Thanks |
No description provided.