-
Notifications
You must be signed in to change notification settings - Fork 8
backend/pointer: only update shape when needed #78
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
Conversation
|
I've also removed the call to pls correct me if I'm misunderstanding this |
| if let Err(err) = pointer.set_cursor(conn, icon) { | ||
| warn!("Failed to set cursor icon: {}", err); | ||
| } | ||
| this.current_pointer_shape = Some(icon); |
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 think this can be improved? Should be part of the else block? Cache is updated even when set_cursor fails?
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.
Yea I see your point
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.
fixed
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.
Some not so important, but still related things to consider.
https://github.com/EvilLary/wayscriber/blob/774e938c9dfc0512c70d69caddcbf78290eec4b1/src/backend/wayland/handlers/seat.rs#L32 - pointer is created, but current_pointer_shape isn't cleared?
Ok(pointer) => {
debug!("Pointer initialized with theme");
self.themed_pointer = Some(pointer);
self.current_pointer_shape = None;
}
Also, similar, line 74:
if capability == Capability::Pointer {
info!("Pointer capability removed");
self.themed_pointer = None;
self.current_pointer_shape = None;
}
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.
added those
Thanks for the PR! |
That seems good to me, unless I am missing something. |
|
Sorry about clippy and the formatter, not too friendly for first PR. But regardless of that, it looks good to me. |
|
oh mb, updated |
|
Thanks! |
|
oh maybe I should've squashed these commits :( |
Currently cursor shape is updated on every pointer event. While I've not found any issues, it just seemed wasteful.
This updates cursor shape only if it doesn't match the previous one