-
Notifications
You must be signed in to change notification settings - Fork 236
wayland: XDG toplevel tag protocol #1728
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
|
This should be unblocked now that the new |
1ffdd17 to
21b70fe
Compare
src/wayland/xdg_toplevel_tag.rs
Outdated
| /// Toplevel tag was set/updated. | ||
| #[allow(unused)] | ||
| fn on_set_tag(&mut self, toplevel: XdgToplevel, tag: String) {} | ||
|
|
||
| /// Toplevel description was set/updated. | ||
| #[allow(unused)] | ||
| fn on_set_description(&mut self, toplevel: XdgToplevel, description: String) {} |
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.
It doesn't look like any trait in smithay currently has methods named with on_*. So it might be more consistent to just call them set_tag and set_description?
Not sure about having empty default implementations, vs just making the functions mandatory. At least for the intended purpose of the protocol, every implementer should care about the tag, though maybe not the description.
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.
Yeah right, we don't do on_*. We have *_changed in xdg shell tho, so perhaps that's a more consistent choice. set_* is good as well as that does not indicate any deduplication logic which I don't do in this implementation.
The callbacks are optional, as you can still access the data without listening to those.
src/wayland/xdg_toplevel_tag.rs
Outdated
| states | ||
| .data_map | ||
| .insert_if_missing_threadsafe(XdgToplevelTagSurfaceData::default); | ||
| let data = states.data_map.get::<XdgToplevelTagSurfaceData>().unwrap(); |
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.
The insert_if_missing_threadsafe and get could be combined into a get_or_insert_threadsafe.
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.
Oh, that's a nice addition, replaced.
21b70fe to
3361925
Compare
Drakulix
left a comment
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.
LGTM! Thanks :)
No description provided.