Fix session crash when taking screenshots with mutter 3.38

This commit is contained in:
Bobby Rong 2021-09-25 23:21:01 +08:00 committed by Corentin Noël
parent e9b59ca5c4
commit fe45c2d07e
2 changed files with 3 additions and 4 deletions

View File

@ -354,12 +354,11 @@ namespace Gala {
paint_flags |= Clutter.PaintFlag.FORCE_CURSORS;
}
unowned var data = image.get_data ();
if (GLib.ByteOrder.HOST == GLib.ByteOrder.LITTLE_ENDIAN) {
wm.stage.paint_to_buffer (
{x, y, width, height},
scale,
ref data,
image.get_data (),
image.get_stride (),
Cogl.PixelFormat.BGRA_8888_PRE,
paint_flags
@ -368,7 +367,7 @@ namespace Gala {
wm.stage.paint_to_buffer (
{x, y, width, height},
scale,
ref data,
image.get_data (),
image.get_stride (),
Cogl.PixelFormat.ARGB_8888_PRE,
paint_flags

View File

@ -7336,7 +7336,7 @@ namespace Clutter {
[Version (since = "1.2")]
public bool get_use_alpha ();
#if HAS_MUTTER338
public bool paint_to_buffer (Cairo.RectangleInt rect, float scale, [CCode (array_length = false)] ref unowned uint8[] data, int stride, Cogl.PixelFormat format, Clutter.PaintFlag paint_flags) throws GLib.Error;
public bool paint_to_buffer (Cairo.RectangleInt rect, float scale, [CCode (array_length = false, type = "uint8_t*")] uint8[] data, int stride, Cogl.PixelFormat format, Clutter.PaintFlag paint_flags) throws GLib.Error;
public void paint_to_framebuffer (Cogl.Framebuffer framebuffer, Cairo.RectangleInt rect, float scale, Clutter.PaintFlag paint_flags);
#else
[Version (since = "0.4")]