protocols: Support content-type-v1 proto (#9226)

This commit is contained in:
UjinT34
2025-02-02 22:25:29 +03:00
committed by GitHub
parent 70d94fec13
commit 31431a9271
20 changed files with 386 additions and 94 deletions

View File

@@ -33,10 +33,14 @@
#include "pass/SurfacePassElement.hpp"
#include "debug/Log.hpp"
#include "protocols/ColorManagement.hpp"
#if AQUAMARINE_VERSION_NUMBER > 702 // >0.7.2
#include "protocols/types/ContentType.hpp"
#endif
#include <hyprutils/utils/ScopeGuard.hpp>
using namespace Hyprutils::Utils;
using namespace Hyprutils::OS;
using enum NContentType::eContentType;
extern "C" {
#include <xf86drm.h>
@@ -1192,7 +1196,7 @@ void CHyprRenderer::renderMonitor(PHLMONITOR pMonitor) {
pMonitor->tearingState.activelyTearing = shouldTear;
if (*PDIRECTSCANOUT && !shouldTear) {
if ((*PDIRECTSCANOUT == 1 || (*PDIRECTSCANOUT == 2 && pMonitor->activeWorkspace->getFullscreenWindow()->getContentType() == CONTENT_TYPE_GAME)) && !shouldTear) {
if (pMonitor->attemptDirectScanout()) {
return;
} else if (!pMonitor->lastScanout.expired()) {
@@ -1509,6 +1513,14 @@ bool CHyprRenderer::commitPendingAndDoExplicitSync(PHLMONITOR pMonitor) {
}
}
#if AQUAMARINE_VERSION_NUMBER > 702 // >0.7.2
if (pMonitor->activeWorkspace && pMonitor->activeWorkspace->m_bHasFullscreenWindow && pMonitor->activeWorkspace->m_efFullscreenMode == FSMODE_FULLSCREEN) {
const auto WINDOW = pMonitor->activeWorkspace->getFullscreenWindow();
pMonitor->output->state->setContentType(NContentType::toDRM(WINDOW->getContentType()));
} else
pMonitor->output->state->setContentType(NContentType::toDRM(CONTENT_TYPE_NONE));
#endif
if (pMonitor->ctmUpdated) {
pMonitor->ctmUpdated = false;
pMonitor->output->state->setCTM(pMonitor->ctm);