mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-09-23 03:38:29 +00:00
protocols: Support content-type-v1 proto (#9226)
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user