Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix session crash when taking screenshots with mutter 3.38 #1259

Merged
merged 2 commits into from
Sep 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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