Skip to content

Commit 2289ec0

Browse files
committed
Untwisting logic
1 parent 9f247ce commit 2289ec0

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

src/background_client.cpp

+4-15
Original file line numberDiff line numberDiff line change
@@ -398,21 +398,10 @@ void BackgroundClient::Self::draw_screen(SurfaceInfo& info, bool draws_crash) co
398398
file_exists = false;
399399
}
400400

401-
if (!wallpaper_enabled)
401+
bool should_draw_crash = draws_crash && file_exists;
402+
if (!wallpaper_enabled && !should_draw_crash)
402403
{
403-
if (draws_crash)
404-
{
405-
if (!file_exists)
406-
{
407-
// If we're drawing a crash but the diagnostic file doesn't
408-
// exist, continue to not show the background.
409-
return;
410-
}
411-
}
412-
else
413-
{
414-
return;
415-
}
404+
return;
416405
}
417406

418407
bool const rotated = info.output->transform & WL_OUTPUT_TRANSFORM_90;
@@ -456,7 +445,7 @@ void BackgroundClient::Self::draw_screen(SurfaceInfo& info, bool draws_crash) co
456445

457446
auto buffer = static_cast<unsigned char*>(info.content_area);
458447

459-
if (draws_crash && file_exists)
448+
if (should_draw_crash)
460449
{
461450
render_background(width, height, buffer, crash_background_colour);
462451
render_text(width, height, buffer);

0 commit comments

Comments
 (0)