summaryrefslogtreecommitdiff
path: root/src/render/OpenGL.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/OpenGL.cpp')
-rw-r--r--src/render/OpenGL.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp
index 0780adf9..d7ea5842 100644
--- a/src/render/OpenGL.cpp
+++ b/src/render/OpenGL.cpp
@@ -3113,7 +3113,17 @@ void CHyprOpenGLImpl::setCapStatus(int cap, bool status) {
}
uint32_t CHyprOpenGLImpl::getPreferredReadFormat(PHLMONITOR pMonitor) {
- return pMonitor->m_output->state->state().drmFormat;
+ static const auto PFORCE8BIT = CConfigValue<Hyprlang::INT>("misc:screencopy_force_8b");
+
+ if (!*PFORCE8BIT)
+ return pMonitor->m_output->state->state().drmFormat;
+
+ auto fmt = pMonitor->m_output->state->state().drmFormat;
+
+ if (fmt == DRM_FORMAT_BGRA1010102 || fmt == DRM_FORMAT_ARGB2101010 || fmt == DRM_FORMAT_XRGB2101010 || fmt == DRM_FORMAT_BGRX1010102)
+ return DRM_FORMAT_XRGB8888;
+
+ return fmt;
}
bool CHyprOpenGLImpl::explicitSyncSupported() {