screenshot: Fix notification

St.ImageContent.set_bytes() now has an additional Cogl.Context
parameter.

Fixes: 44b84e458a ("st/image-content: Take a CoglContext on set_bytes/set_data functions")
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8190
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3631>
This commit is contained in:
Florian Müllner 2025-02-07 12:22:03 +01:00 committed by Marge Bot
parent 3726161bfd
commit 4f5cd433b2

View File

@ -2308,10 +2308,12 @@ function _storeScreenshot(bytes, pixbuf) {
// Create a St.ImageContent icon for the notification. We want
// St.ImageContent specifically because it preserves the aspect ratio when
// shown in a notification.
const coglContext = global.stage.context.get_backend().get_cogl_context();
const pixels = pixbuf.read_pixel_bytes();
const content =
St.ImageContent.new_with_preferred_size(pixbuf.width, pixbuf.height);
content.set_bytes(
coglContext,
pixels,
Cogl.PixelFormat.RGBA_8888,
pixbuf.width,