Skip to content

Commit

Permalink
Fix session crash when taking screenshots with mutter 3.38
Browse files Browse the repository at this point in the history
  • Loading branch information
bobby285271 authored and tintou committed Sep 29, 2021
1 parent e9b59ca commit fe45c2d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/ScreenshotManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion vapi/mutter-clutter.vapi
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down

0 comments on commit fe45c2d

Please sign in to comment.