@@ -106,7 +106,7 @@ struct BackgroundClient::Self : egmde::FullscreenClient
106
106
107
107
void render_text (uint32_t width, uint32_t height, unsigned char * buffer) const ;
108
108
109
- bool wallpaper_enabled;
109
+ bool const wallpaper_enabled;
110
110
Colour const & wallpaper_top_colour;
111
111
Colour const & wallpaper_bottom_colour;
112
112
Colour const & crash_background_colour;
@@ -388,18 +388,9 @@ void BackgroundClient::Self::draw_screen(SurfaceInfo& info, bool draws_crash) co
388
388
std::lock_guard lock{buffer_mutex};
389
389
390
390
// Don't draw diagnostic background if file is empty or font not found
391
- bool file_exists;
392
- if (fs::exists (diagnostic_path.value_or (" " )))
393
- {
394
- file_exists = fs::file_size (diagnostic_path.value ());
395
- }
396
- else
397
- {
398
- file_exists = false ;
399
- }
400
-
401
- bool should_draw_crash = draws_crash && file_exists;
402
- if (!wallpaper_enabled && !should_draw_crash)
391
+ bool const have_diagnostic = diagnostic_path && fs::exists (diagnostic_path.value ()) && fs::file_size (diagnostic_path.value ());
392
+ bool const should_show_diagnostic = draws_crash && have_diagnostic;
393
+ if (!wallpaper_enabled && !should_show_diagnostic)
403
394
{
404
395
return ;
405
396
}
@@ -445,7 +436,7 @@ void BackgroundClient::Self::draw_screen(SurfaceInfo& info, bool draws_crash) co
445
436
446
437
auto buffer = static_cast <unsigned char *>(info.content_area );
447
438
448
- if (should_draw_crash )
439
+ if (should_show_diagnostic )
449
440
{
450
441
render_background (width, height, buffer, crash_background_colour);
451
442
render_text (width, height, buffer);
0 commit comments