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
Provide a configuration mechanism for enabling the supported Wayland extensions #538
Conversation
Is this intended to include a WLCS sync? |
Oops! No. Let me fix... |
072c301
to
d3ecfb5
Compare
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.
Minor stuff, non blocking.
std::set<std::string> selected_extension; | ||
auto extensions_ = extensions + ':'; | ||
|
||
for (char const* start = extensions_.c_str(); char const* end = strchr(start, ':'); start = end+1) |
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.
Not a problem, but seems a bit hacky to do this with C strings and strchr
, instead of std::string::find
.
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.
Sometimes the C API leads to clearer code. IMO the C++ version is too verbose.
protected: | ||
virtual void custom_extensions( | ||
wl_display* display, | ||
std::shared_ptr<mf::Shell> const& shell, | ||
mf::WlSeat* seat, | ||
mf::OutputManager* const output_manager) | ||
{ | ||
if (!getenv("MIR_DISABLE_XDG_SHELL_V6_UNSTABLE")) | ||
add_extension("zxdg_shell_v6", std::make_shared<mf::XdgShellV6>(display, shell, *seat, output_manager)); | ||
if (extension.find(wl_shell) != extension.end()) |
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.
Another extension could, theoretically, have a name that contains "wl_shell"
.
if ((":" + extension + ":").find(":" + wl_shel +":") != extension.end())
Would be uglier, but more technically correct IMO
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.
There's probably also a leaner way to do this.
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.
@wmww That code is looking for a value "wl_shell" in a set. It doesn't match a value containing "wl_shell".
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, oops. I thought I read that carefully.
bors r+ |
Merge conflict |
bors r+ |
538: Provide a configuration mechanism for enabling the supported Wayland extensions r=wmww a=AlanGriffiths This provides a foundation for future development. But this is likely to gain complexity over time: * A shell may want to validate the selected extensions. * Some extensions may be mutually incompatible. * We may want to change the default from "enable everything". Co-authored-by: Alan Griffiths <alan@octopull.co.uk> Co-authored-by: William Wold <9331264+wmww@users.noreply.github.com>
Build failed |
3rd times the charm |
538: Provide a configuration mechanism for enabling the supported Wayland extensions r=wmww a=AlanGriffiths This provides a foundation for future development. But this is likely to gain complexity over time: * A shell may want to validate the selected extensions. * Some extensions may be mutually incompatible. * We may want to change the default from "enable everything". Co-authored-by: Alan Griffiths <alan@octopull.co.uk> Co-authored-by: William Wold <9331264+wmww@users.noreply.github.com>
Build succeeded |
This provides a foundation for future development.
But this is likely to gain complexity over time: