screencopy: add force 8 bit to fix 10b screensharing (#11623)

ref https://github.com/hyprwm/xdg-desktop-portal-hyprland/issues/270
This commit is contained in:
Vaxry 2025-09-08 11:07:04 +02:00 committed by GitHub
parent bce43f74eb
commit 02bb350bb3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 22 additions and 3 deletions

View file

@ -60,7 +60,7 @@ CScreencopyFrame::CScreencopyFrame(SP<CZwlrScreencopyFrameV1> resource_, int32_t
return;
}
m_dmabufFormat = m_monitor->m_output->state->state().drmFormat;
m_dmabufFormat = g_pHyprOpenGL->getPreferredReadFormat(m_monitor.lock());
if (box_.width == 0 && box_.height == 0)
m_box = {0, 0, sc<int>(m_monitor->m_size.x), sc<int>(m_monitor->m_size.y)};

View file

@ -108,6 +108,8 @@ class CScreencopyProtocol : public IWaylandProtocol {
bool copyFrameDmabuf(CScreencopyFrame* frame);
bool copyFrameShm(CScreencopyFrame* frame, const Time::steady_tp& now);
uint32_t drmFormatForMonitor(PHLMONITOR pMonitor);
friend class CScreencopyFrame;
friend class CScreencopyClient;
};

View file

@ -114,7 +114,7 @@ CToplevelExportFrame::CToplevelExportFrame(SP<CHyprlandToplevelExportFrameV1> re
return;
}
m_dmabufFormat = PMONITOR->m_output->state->state().drmFormat;
m_dmabufFormat = g_pHyprOpenGL->getPreferredReadFormat(PMONITOR);
m_box = {0, 0, sc<int>(m_window->m_realSize->value().x * PMONITOR->m_scale), sc<int>(m_window->m_realSize->value().y * PMONITOR->m_scale)};