summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-06-17 15:35:02 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-06-17 15:35:02 +0200
commit152cc52d89123f11724f0a5d3252309ba9ff314e (patch)
tree88d91dc2735f6fea62db204d96eca7739c3e7451
parent58016cf2191cd9031fe9dffa17f3999f3ce6a878 (diff)
Wayland: capture window titlebar as depth-4 image
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
index c4587cf07..139ba2ea9 100644
--- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
@@ -321,7 +321,7 @@ void Fl_Wayland_Window_Driver::capture_titlebar_and_borders(Fl_RGB_Image*& top,
int width, height, stride;
uchar *cairo_data = fl_libdecor_titlebar_buffer(wwin->frame, &width, &height, &stride);
if (!cairo_data) return;
- uchar *data = new uchar[width * height * 3];
+ uchar *data = new uchar[width * height * 4];
uchar *p = data;
for (int j = 0; j < height; j++) {
uchar *q = cairo_data + j * stride;
@@ -329,10 +329,11 @@ void Fl_Wayland_Window_Driver::capture_titlebar_and_borders(Fl_RGB_Image*& top,
*p++ = *(q+2); // R
*p++ = *(q+1); // G
*p++ = *q; // B
+ *p++ = *(q+3); // A
q += 4;
}
}
- top = new Fl_RGB_Image(data, width, height, 3);
+ top = new Fl_RGB_Image(data, width, height, 4);
top->alloc_array = 1;
top->scale(pWindow->w(), htop);
}