Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@PolyMeilex
Copy link
Member

@PolyMeilex PolyMeilex commented Apr 25, 2025

No description provided.

@PolyMeilex PolyMeilex added this to the v0.7 milestone Apr 25, 2025
@ids1024
Copy link
Member

ids1024 commented Apr 28, 2025

This should be unblocked now that the new wayland-rs release is up on crates.io.

@PolyMeilex PolyMeilex marked this pull request as ready for review April 29, 2025 22:27
Comment on lines 92 to 98
/// 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) {}
Copy link
Member

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.

Copy link
Member Author

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.

Comment on lines 150 to 153
states
.data_map
.insert_if_missing_threadsafe(XdgToplevelTagSurfaceData::default);
let data = states.data_map.get::<XdgToplevelTagSurfaceData>().unwrap();
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

@Drakulix Drakulix left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks :)

@Drakulix Drakulix merged commit a05e608 into Smithay:master May 22, 2025
13 checks passed
@PolyMeilex PolyMeilex deleted the xdg-toplevel-tag branch May 22, 2025 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants