-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add a --wallpaper argument to optionally disable wallpaper draws #157
Conversation
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.
@mattkae were you able to confirm this DTRT as far as smooth boot is concerned?
If I leave plymouth running and deactivate
it, then start Frame without the wallpaper on tty1, I get black immediately, until the timeout passes and we're back to the wallpaper. We want the splash screen to stay until we draw the client / wallpaper / diagnostic. Do we need to bring in some of #3033 for this?
That said, mir_demo_server behaves similarly - it goes to black straight up.
I'm on qemu, mind you, and see this warning, so maybe that's why?
< -warning- > gbm-kms: Unable to determine the current display mode.
I'd probably go for just --wallpaper=<true|false>
, BTW.
I don't think this can be to address seamless boot directly: that needs the server to defer compositing until content from the client app is available. This just means that compositing will start without a background (as you say, just like mir_demo_server, or miriway without swaybg). The idea might be to simplify detecting whether there's an app providing content by preventing the "wallpaper client" from providing content. But I'm not convinced that's necessary, or a good idea. |
@Saviq @AlanGriffiths Alan is right on this one. The compositor itself is going to clear the screen once it is ready to start drawing surfaces. As Alan said, we could make it not do anything until it first has a "renderable" to render. Otherwise, we could do the tougher task of reading in the plymouth buffer and rendering that ourselves until the user has supplied another renderable. |
Yeah that's what I think we should be doing. Off the top I can't think of why it couldn't be the default behaviour?
Do you have another approach in mind? Why / how would we want to treat the background client in a special way? In truth, we could probably (when this, or similar, option is engaged) just delay the background client altogether by
That wouldn't change much compared to the above, would it? I mean, not until we start doing something more with the buffer. |
OK so this, together with canonical/mir#3086 looks exactly like what we need :) I'm just trying to think about what's the best user experience. A But do we really need another timeout? The behaviour here, I think, is mostly correct - the first thing we see (with If someone disabled the wallpaper, and does not have the diagnostic set up - maybe the splash screen should stay on screen? |
Maybe if there isn't any diagnostic text but there is some error, then we show some default diagnostic text? I agree that it feels weird to show the background out of nowhere when there's an error. I'm up for either some default text or just keeping the splash on screen. Although, leaving the splash on screen makes it a bit trickier to debug from a user's perspective |
It's not that there is an error, necessarily. And even if there is - Frame can't know what it is.
Well, that's exactly what the diagnostic is for. The "user" in the case of Frame shouldn't be doing any debugging, just call the number that's on screen :) And just to confirm we're DTRT: The before: Nagranie.ekranu.z.2023-10-24.16-10-07.webmAnd the after: Nagranie.ekranu.z.2023-10-24.16-02-07.webmThe white flash is rendered by Flutter, so it's in the application author's hands now. |
@mattkae so personally I'm erring on @AlanGriffiths thoughts? |
That makes sense to me! So if they fail to set up the diagnostic and the wallpaper is turned off, then we keep showing the splash. Does that sound right?
And yup, that's what I would expect. The splash is shown all the way up to the first render of the app. |
Yeah exactly.
Oh I wasn't asking ;D |
@Saviq I have implemented + tested only showing the diagnostic screen when we have diagnostic info 👍 |
@mattkae that if/else dance looks like it could use some rework? |
As in its too verbose, or is it incorrect? |
I mean this: and then this: The control flow got quite twisted? |
6c67cc4
to
2289ec0
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.
Looks good to me!
@AlanGriffiths would like your ACK in case I'm not thinking of something here…
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 small const
cleanup and some (non blocking) bikeshedding about the naming
src/background_client.cpp
Outdated
@@ -398,21 +398,10 @@ void BackgroundClient::Self::draw_screen(SurfaceInfo& info, bool draws_crash) co | |||
file_exists = false; | |||
} | |||
|
|||
if (!wallpaper_enabled) | |||
bool should_draw_crash = draws_crash && file_exists; |
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.
bool should_draw_crash = draws_crash && file_exists; | |
bool const should_draw_crash = draws_crash && file_exists; |
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.
Maybe the variable should be should_show_diagnostic
?
src/background_client.cpp
Outdated
@@ -105,6 +106,7 @@ struct BackgroundClient::Self : egmde::FullscreenClient | |||
|
|||
void render_text(uint32_t width, uint32_t height, unsigned char* buffer) const; | |||
|
|||
bool wallpaper_enabled; |
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 never updated after initialization, so should be const
.
src/background_client.cpp
Outdated
bool file_exists; | ||
if (fs::exists(diagnostic_path.value_or(""))) | ||
{ | ||
file_exists = fs::file_size(diagnostic_path.value()); | ||
} | ||
else | ||
{ | ||
file_exists = false; | ||
} |
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.
bool file_exists; | |
if (fs::exists(diagnostic_path.value_or(""))) | |
{ | |
file_exists = fs::file_size(diagnostic_path.value()); | |
} | |
else | |
{ | |
file_exists = false; | |
} | |
bool const file_exists = diagnostic_path && fs::exists(diagnostic_path.value()) && fs::file_size(diagnostic_path.value()); |
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.
Although, maybe the variable should be have_diagnostic
- the "file" is an implementation detail.
cf3cbed
to
a8f0b2c
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.
LGTM
Depends on
To test
sudo make install
The splash should still be on the screen
4. Run frame:
What's new?
wallpaper_enabled
flag that is set to true by defaultBackgroundClient::Self::draw_screen
if we have errors or the wallpaper is enabled