mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 17:27:35 +00:00
WindowServer: Blit backing bitmap with transparency for hung windows
We should respect the opacity of the window when painting the window content of a hung application.
This commit is contained in:
parent
130d48fa13
commit
e1333724ea
1 changed files with 12 additions and 3 deletions
|
@ -345,9 +345,18 @@ void Compositor::compose()
|
|||
auto dst = backing_rect.location().translated(dirty_rect_in_backing_coordinates.location());
|
||||
|
||||
if (window.client() && window.client()->is_unresponsive()) {
|
||||
painter.blit_filtered(dst, *backing_store, dirty_rect_in_backing_coordinates, [](Color src) {
|
||||
return src.to_grayscale().darkened(0.75f);
|
||||
});
|
||||
if (window.is_opaque()) {
|
||||
painter.blit_filtered(dst, *backing_store, dirty_rect_in_backing_coordinates, [](Color src) {
|
||||
return src.to_grayscale().darkened(0.75f);
|
||||
});
|
||||
} else {
|
||||
u8 alpha = 255 * window.opacity();
|
||||
painter.blit_filtered(dst, *backing_store, dirty_rect_in_backing_coordinates, [&](Color src) {
|
||||
auto color = src.to_grayscale().darkened(0.75f);
|
||||
color.set_alpha(alpha);
|
||||
return color;
|
||||
});
|
||||
}
|
||||
} else {
|
||||
painter.blit(dst, *backing_store, dirty_rect_in_backing_coordinates, window.opacity());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue