diff --git a/src/protocols/Screencopy.cpp b/src/protocols/Screencopy.cpp index cff84fc5..f0f0f69e 100644 --- a/src/protocols/Screencopy.cpp +++ b/src/protocols/Screencopy.cpp @@ -210,7 +210,7 @@ void CScreencopyProtocolManager::captureOutput(wl_client* client, wl_resource* r PFRAME->client = PCLIENT; PCLIENT->ref++; - PFRAME->shmFormat = wlr_output_preferred_read_format(PFRAME->pMonitor->output); + PFRAME->shmFormat = g_pHyprRenderer->isNvidia() ? DRM_FORMAT_XRGB8888 : wlr_output_preferred_read_format(PFRAME->pMonitor->output); if (PFRAME->shmFormat == DRM_FORMAT_INVALID) { Debug::log(ERR, "No format supported by renderer in capture output"); zwlr_screencopy_frame_v1_send_failed(PFRAME->resource); diff --git a/src/protocols/ToplevelExport.cpp b/src/protocols/ToplevelExport.cpp index db602396..6c626e87 100644 --- a/src/protocols/ToplevelExport.cpp +++ b/src/protocols/ToplevelExport.cpp @@ -177,7 +177,7 @@ void CToplevelExportProtocolManager::captureToplevel(wl_client* client, wl_resou const auto PMONITOR = g_pCompositor->getMonitorFromID(PFRAME->pWindow->m_iMonitorID); - PFRAME->shmFormat = wlr_output_preferred_read_format(PMONITOR->output); + PFRAME->shmFormat = g_pHyprRenderer->isNvidia() ? DRM_FORMAT_XRGB8888 : wlr_output_preferred_read_format(PMONITOR->output); if (PFRAME->shmFormat == DRM_FORMAT_INVALID) { Debug::log(ERR, "No format supported by renderer in capture toplevel"); hyprland_toplevel_export_frame_v1_send_failed(resource); diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 273bc1ca..bdf683e9 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -16,7 +16,7 @@ CHyprRenderer::CHyprRenderer() { if (g_pCompositor->m_sWLRSession) { wlr_device* dev; - wl_list_for_each(dev, &g_pCompositor->m_sWLRSession->devices, link) { + wl_list_for_each(dev, &g_pCompositor->m_sWLRSession->devices, link) { const auto DRMV = drmGetVersion(dev->fd); std::string name = std::string{DRMV->name, DRMV->name_len}; @@ -26,7 +26,7 @@ CHyprRenderer::CHyprRenderer() { m_bNvidia = true; Debug::log(LOG, "DRM driver information: {} v{}.{}.{} from {} description {}", name, DRMV->version_major, DRMV->version_minor, DRMV->version_patchlevel, - std::string{DRMV->date, DRMV->date_len}, std::string{DRMV->desc, DRMV->desc_len}); + std::string{DRMV->date, DRMV->date_len}, std::string{DRMV->desc, DRMV->desc_len}); drmFreeVersion(DRMV); } @@ -42,7 +42,7 @@ CHyprRenderer::CHyprRenderer() { m_bNvidia = true; Debug::log(LOG, "Primary DRM driver information: {} v{}.{}.{} from {} description {}", name, DRMV->version_major, DRMV->version_minor, DRMV->version_patchlevel, - std::string{DRMV->date, DRMV->date_len}, std::string{DRMV->desc, DRMV->desc_len}); + std::string{DRMV->date, DRMV->date_len}, std::string{DRMV->desc, DRMV->desc_len}); drmFreeVersion(DRMV); }