-
Notifications
You must be signed in to change notification settings - Fork 103
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
Demonstrate using the window decoration strategy #3459
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3459 +/- ##
=======================================
Coverage 77.36% 77.36%
=======================================
Files 1076 1076
Lines 68911 68911
=======================================
+ Hits 53311 53313 +2
+ Misses 15600 15598 -2 ☔ View full report in Codecov by Sentry. |
f3109d4
to
8b31e69
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.
A question!
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.
Working well for me! I tried all of the different configurations and it seemed to work.
miral::Decorations const decorations{[] | ||
{ | ||
if (auto const strategy = getenv("MIRAL_SHELL_DECORATIONS")) | ||
{ | ||
if (strcmp(strategy, "always-ssd") == 0) return miral::Decorations::always_ssd(); | ||
if (strcmp(strategy, "prefer-ssd") == 0) return miral::Decorations::prefer_ssd(); | ||
if (strcmp(strategy, "always-csd") == 0) return miral::Decorations::always_csd(); | ||
} | ||
return miral::Decorations::prefer_csd(); | ||
}()}; |
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.
This is quite neat!
I would've done it like so:
ConfigureDecorations()
: decorations{init_decorations()}
{
}
// somewhere private
static auto init_decorations() -> miral::Decorations
{
// lambda code
}
I'll definitely add this to my arsenal though
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, immediately-executed lambdas are a way of turning C++ into an expression language. It can be particularly useful for const
initialisation.
mw::MirShellV1::interface_name, | ||
mw::XdgDecorationManagerV1::interface_name}; |
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.
Looks like I forgot this one in my original PR, thanks for fixing it :)
Needs symbols fixes |
I think main has that. Will rebase when back at keyboard |
8b31e69
to
965736d
Compare
No description provided.