summaryrefslogtreecommitdiff
path: root/src/protocols/ToplevelExport.cpp
diff options
context:
space:
mode:
authorDavid De Sousa <davidesousa@gmail.com>2024-07-13 12:53:53 +0200
committerGitHub <noreply@github.com>2024-07-13 12:53:53 +0200
commita770a88e0962f37c0b6f36f1876cbf27db4cf3c9 (patch)
tree00379c97bf4aa19b8898f401c89e51720d51ad1e /src/protocols/ToplevelExport.cpp
parent1f6466895326defef370a378f9d7b61a7e246df7 (diff)
toplevelexport: fix flipped r/b channels when sharing windows (#6861)
fixes #6823
Diffstat (limited to 'src/protocols/ToplevelExport.cpp')
-rw-r--r--src/protocols/ToplevelExport.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/protocols/ToplevelExport.cpp b/src/protocols/ToplevelExport.cpp
index 287538b5..d4c66c3b 100644
--- a/src/protocols/ToplevelExport.cpp
+++ b/src/protocols/ToplevelExport.cpp
@@ -409,7 +409,8 @@ bool CToplevelExportProtocolManager::copyFrameShm(SScreencopyFrame* frame, times
glPixelStorei(GL_PACK_ALIGNMENT, 1);
- glReadPixels(0, 0, frame->box.width, frame->box.height, PFORMAT->glFormat, PFORMAT->glType, pixelData);
+ auto glFormat = PFORMAT->flipRB ? GL_BGRA_EXT : GL_RGBA;
+ glReadPixels(0, 0, frame->box.width, frame->box.height, glFormat, PFORMAT->glType, pixelData);
if (frame->overlayCursor) {
g_pPointerManager->unlockSoftwareForMonitor(PMONITOR->self.lock());