1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:27:45 +00:00

WindowServer: Don't crash on wallpapers smaller than the desktop with fill mode 'simple'

blit() calls draw_scaled_bitmap() behind the scenes in scaled contexts,
and that doesn't  like src_rect to be outside of the source bitmap's
bounds. Implicitly clip with the source rect, like the non-scaled
codepath already does.

Fixes #5017 even more.
This commit is contained in:
Nico Weber 2021-01-22 18:56:01 -05:00 committed by Andreas Kling
parent dcc967d1ad
commit 345909c009
3 changed files with 8 additions and 6 deletions

View file

@ -246,7 +246,7 @@ void Compositor::compose()
auto temp_painter = *m_temp_painter;
auto paint_wallpaper = [&](Gfx::Painter& painter, const Gfx::IntRect& rect) {
// FIXME: If the wallpaper is opaque, no need to fill with color!
// FIXME: If the wallpaper is opaque and covers the whole rect, no need to fill with color!
painter.fill_rect(rect, background_color);
if (m_wallpaper) {
if (m_wallpaper_mode == WallpaperMode::Simple) {