@@ -1,50 +0,0 @@
1−From fa3c39331d4ef56a13019f45d811bde1fc755c21 Mon Sep 17 00:00:00 2001
2−From: Bobby Rong <rjl931189261@126.com>
3−Date: Sat, 25 Sep 2021 23:21:01 +0800
4−Subject: [PATCH] Fix session crash when taking screenshots with mutter 3.38
5−
6−---
7− src/ScreenshotManager.vala | 5 ++---
8− vapi/mutter-clutter.vapi | 2 +-
9− 2 files changed, 3 insertions(+), 4 deletions(-)
10−
11−diff --git a/src/ScreenshotManager.vala b/src/ScreenshotManager.vala
12−index 3ffb0123..388fee1a 100644
13−--- a/src/ScreenshotManager.vala
14−+++ b/src/ScreenshotManager.vala
15−@@ -354,12 +354,11 @@ namespace Gala {
16− paint_flags |= Clutter.PaintFlag.FORCE_CURSORS;
17− }
18−
19−- unowned var data = image.get_data ();
20− if (GLib.ByteOrder.HOST == GLib.ByteOrder.LITTLE_ENDIAN) {
21− wm.stage.paint_to_buffer (
22− {x, y, width, height},
23− scale,
24−- ref data,
25−+ image.get_data (),
26− image.get_stride (),
27− Cogl.PixelFormat.BGRA_8888_PRE,
28− paint_flags
29−@@ -368,7 +367,7 @@ namespace Gala {
30− wm.stage.paint_to_buffer (
31− {x, y, width, height},
32− scale,
33−- ref data,
34−+ image.get_data (),
35− image.get_stride (),
36− Cogl.PixelFormat.ARGB_8888_PRE,
37− paint_flags
38−diff --git a/vapi/mutter-clutter.vapi b/vapi/mutter-clutter.vapi
39−index 5b778cb2..95de24be 100644
40−--- a/vapi/mutter-clutter.vapi
41−+++ b/vapi/mutter-clutter.vapi
42−@@ -7336,7 +7336,7 @@ namespace Clutter {
43− [Version (since = "1.2")]
44− public bool get_use_alpha ();
45− #if HAS_MUTTER338
46−- 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;
47−+ 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;
48− public void paint_to_framebuffer (Cogl.Framebuffer framebuffer, Cairo.RectangleInt rect, float scale, Clutter.PaintFlag paint_flags);
49− #else
50− [Version (since = "0.4")]