mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-02 10:45:59 +01:00
remove damage_entire_on_snapshot
This commit is contained in:
parent
563835404f
commit
974739457f
2 changed files with 21 additions and 32 deletions
|
@ -52,7 +52,6 @@ void CConfigManager::setDefaultVars() {
|
|||
configValues["misc:disable_hyprland_logo"].intValue = 0;
|
||||
configValues["misc:disable_splash_rendering"].intValue = 0;
|
||||
configValues["misc:no_vfr"].intValue = 1;
|
||||
configValues["misc:damage_entire_on_snapshot"].intValue = 0;
|
||||
configValues["misc:mouse_move_enables_dpms"].intValue = 0;
|
||||
configValues["misc:always_follow_on_dnd"].intValue = 1;
|
||||
configValues["misc:layers_hog_keyboard_focus"].intValue = 1;
|
||||
|
@ -261,8 +260,8 @@ void CConfigManager::init() {
|
|||
|
||||
const std::string CONFIGPATH = ENVHOME + (ISDEBUG ? (std::string) "/.config/hypr/hyprlandd.conf" : (std::string) "/.config/hypr/hyprland.conf");
|
||||
|
||||
struct stat fileStat;
|
||||
int err = stat(CONFIGPATH.c_str(), &fileStat);
|
||||
struct stat fileStat;
|
||||
int err = stat(CONFIGPATH.c_str(), &fileStat);
|
||||
if (err != 0) {
|
||||
Debug::log(WARN, "Error at statting config, error %i", errno);
|
||||
}
|
||||
|
@ -353,7 +352,7 @@ void CConfigManager::configSetValueSafe(const std::string& COMMAND, const std::s
|
|||
switch (CONFIGENTRY->data->getDataType()) {
|
||||
case CVD_TYPE_GRADIENT: {
|
||||
|
||||
CVarList varlist(VALUE, 0, ' ');
|
||||
CVarList varlist(VALUE, 0, ' ');
|
||||
|
||||
CGradientValueData* data = (CGradientValueData*)CONFIGENTRY->data.get();
|
||||
data->m_vColors.clear();
|
||||
|
@ -426,7 +425,7 @@ void CConfigManager::handleMonitor(const std::string& command, const std::string
|
|||
// get the monitor config
|
||||
SMonitorRule newrule;
|
||||
|
||||
const auto ARGS = CVarList(args);
|
||||
const auto ARGS = CVarList(args);
|
||||
|
||||
newrule.name = ARGS[0];
|
||||
|
||||
|
@ -530,7 +529,7 @@ void CConfigManager::handleMonitor(const std::string& command, const std::string
|
|||
}
|
||||
|
||||
void CConfigManager::handleBezier(const std::string& command, const std::string& args) {
|
||||
const auto ARGS = CVarList(args);
|
||||
const auto ARGS = CVarList(args);
|
||||
|
||||
std::string bezierName = ARGS[0];
|
||||
|
||||
|
@ -678,7 +677,7 @@ void CConfigManager::handleBind(const std::string& command, const std::string& v
|
|||
|
||||
const auto KEY = ARGS[1];
|
||||
|
||||
auto HANDLER = ARGS[2];
|
||||
auto HANDLER = ARGS[2];
|
||||
|
||||
const auto COMMAND = mouse ? HANDLER : ARGS[3];
|
||||
|
||||
|
@ -1149,7 +1148,7 @@ void CConfigManager::loadConfigLoadVars() {
|
|||
// paths
|
||||
configPaths.clear();
|
||||
|
||||
std::string CONFIGPATH;
|
||||
std::string CONFIGPATH;
|
||||
|
||||
static const char* const ENVHOME = getenv("HOME");
|
||||
const std::string CONFIGPARENTPATH = ENVHOME + (std::string) "/.config/hypr/";
|
||||
|
@ -1279,7 +1278,7 @@ void CConfigManager::loadConfigLoadVars() {
|
|||
void CConfigManager::tick() {
|
||||
static const char* const ENVHOME = getenv("HOME");
|
||||
|
||||
const std::string CONFIGPATH = ENVHOME + (ISDEBUG ? (std::string) "/.config/hypr/hyprlandd.conf" : (std::string) "/.config/hypr/hyprland.conf");
|
||||
const std::string CONFIGPATH = ENVHOME + (ISDEBUG ? (std::string) "/.config/hypr/hyprlandd.conf" : (std::string) "/.config/hypr/hyprland.conf");
|
||||
|
||||
if (!std::filesystem::exists(CONFIGPATH)) {
|
||||
Debug::log(ERR, "Config doesn't exist??");
|
||||
|
@ -1314,7 +1313,7 @@ std::mutex configmtx;
|
|||
SConfigValue CConfigManager::getConfigValueSafe(const std::string& val) {
|
||||
std::lock_guard<std::mutex> lg(configmtx);
|
||||
|
||||
SConfigValue copy = configValues[val];
|
||||
SConfigValue copy = configValues[val];
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
@ -1322,7 +1321,7 @@ SConfigValue CConfigManager::getConfigValueSafe(const std::string& val) {
|
|||
SConfigValue CConfigManager::getConfigValueSafeDevice(const std::string& dev, const std::string& val) {
|
||||
std::lock_guard<std::mutex> lg(configmtx);
|
||||
|
||||
const auto it = deviceConfigs.find(dev);
|
||||
const auto it = deviceConfigs.find(dev);
|
||||
|
||||
if (it == deviceConfigs.end()) {
|
||||
Debug::log(ERR, "getConfigValueSafeDevice: No device config for %s found???", dev.c_str());
|
||||
|
@ -1431,8 +1430,8 @@ std::vector<SWindowRule> CConfigManager::getMatchingRules(CWindow* pWindow) {
|
|||
|
||||
std::vector<SWindowRule> returns;
|
||||
|
||||
std::string title = g_pXWaylandManager->getTitle(pWindow);
|
||||
std::string appidclass = g_pXWaylandManager->getAppIDClass(pWindow);
|
||||
std::string title = g_pXWaylandManager->getTitle(pWindow);
|
||||
std::string appidclass = g_pXWaylandManager->getAppIDClass(pWindow);
|
||||
|
||||
Debug::log(LOG, "Searching for matching rules for %s (title: %s)", appidclass.c_str(), title.c_str());
|
||||
|
||||
|
@ -1615,7 +1614,7 @@ void CConfigManager::ensureDPMS() {
|
|||
void CConfigManager::ensureVRR(CMonitor* pMonitor) {
|
||||
static auto* const PNOVRR = &getConfigValuePtr("misc:no_vfr")->intValue;
|
||||
|
||||
auto ensureVRRForDisplay = [&](CMonitor* m) -> void {
|
||||
auto ensureVRRForDisplay = [&](CMonitor* m) -> void {
|
||||
if (!*PNOVRR && !m->vrrActive) {
|
||||
// Adaptive sync (VRR)
|
||||
wlr_output_enable_adaptive_sync(m->output, 1);
|
||||
|
|
|
@ -467,8 +467,8 @@ void CHyprOpenGLImpl::renderTextureInternalWithDamage(const CTexture& tex, wlr_b
|
|||
static auto* const PDIMINACTIVE = &g_pConfigManager->getConfigValuePtr("decoration:dim_inactive")->intValue;
|
||||
|
||||
// get transform
|
||||
const auto TRANSFORM = wlr_output_transform_invert(!m_bEndFrame ? WL_OUTPUT_TRANSFORM_NORMAL : m_RenderData.pMonitor->transform);
|
||||
float matrix[9];
|
||||
const auto TRANSFORM = wlr_output_transform_invert(!m_bEndFrame ? WL_OUTPUT_TRANSFORM_NORMAL : m_RenderData.pMonitor->transform);
|
||||
float matrix[9];
|
||||
wlr_matrix_project_box(matrix, pBox, TRANSFORM, 0, m_RenderData.pMonitor->output->transform_matrix);
|
||||
|
||||
float glMatrix[9];
|
||||
|
@ -605,7 +605,7 @@ CFramebuffer* CHyprOpenGLImpl::blurMainFramebufferWithDamage(float a, wlr_box* p
|
|||
static auto* const PBLURPASSES = &g_pConfigManager->getConfigValuePtr("decoration:blur_passes")->intValue;
|
||||
|
||||
// prep damage
|
||||
pixman_region32_t damage;
|
||||
pixman_region32_t damage;
|
||||
pixman_region32_init(&damage);
|
||||
pixman_region32_copy(&damage, originalDamage);
|
||||
wlr_region_transform(&damage, &damage, wlr_output_transform_invert(m_RenderData.pMonitor->transform), m_RenderData.pMonitor->vecTransformedSize.x,
|
||||
|
@ -619,7 +619,7 @@ CFramebuffer* CHyprOpenGLImpl::blurMainFramebufferWithDamage(float a, wlr_box* p
|
|||
CFramebuffer* currentRenderToFB = &m_RenderData.pCurrentMonData->primaryFB;
|
||||
|
||||
// declare the draw func
|
||||
auto drawPass = [&](CShader* pShader, pixman_region32_t* pDamage) {
|
||||
auto drawPass = [&](CShader* pShader, pixman_region32_t* pDamage) {
|
||||
if (currentRenderToFB == PMIRRORFB)
|
||||
PMIRRORSWAPFB->bind();
|
||||
else
|
||||
|
@ -829,7 +829,7 @@ void CHyprOpenGLImpl::renderTextureWithBlur(const CTexture& tex, wlr_box* pBox,
|
|||
static auto* const PBLURXRAY = &g_pConfigManager->getConfigValuePtr("decoration:blur_xray")->intValue;
|
||||
|
||||
// make a damage region for this window
|
||||
pixman_region32_t damage;
|
||||
pixman_region32_t damage;
|
||||
pixman_region32_init(&damage);
|
||||
pixman_region32_intersect_rect(&damage, m_RenderData.pDamage, pBox->x, pBox->y, pBox->width, pBox->height); // clip it to the box
|
||||
|
||||
|
@ -908,7 +908,7 @@ void CHyprOpenGLImpl::renderTextureWithBlur(const CTexture& tex, wlr_box* pBox,
|
|||
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
|
||||
|
||||
// stencil done. Render everything.
|
||||
wlr_box MONITORBOX = {0, 0, m_RenderData.pMonitor->vecTransformedSize.x, m_RenderData.pMonitor->vecTransformedSize.y};
|
||||
wlr_box MONITORBOX = {0, 0, m_RenderData.pMonitor->vecTransformedSize.x, m_RenderData.pMonitor->vecTransformedSize.y};
|
||||
// render our great blurred FB
|
||||
static auto* const PBLURIGNOREOPACITY = &g_pConfigManager->getConfigValuePtr("decoration:blur_ignore_opacity")->intValue;
|
||||
m_bEndFrame = true; // fix transformed
|
||||
|
@ -1225,7 +1225,7 @@ void CHyprOpenGLImpl::renderSnapshot(CWindow** pWindow) {
|
|||
wlr_box windowBox;
|
||||
// some mafs to figure out the correct box
|
||||
// the originalClosedPos is relative to the monitor's pos
|
||||
Vector2D scaleXY = Vector2D((PMONITOR->scale * PWINDOW->m_vRealSize.vec().x / (PWINDOW->m_vOriginalClosedSize.x * PMONITOR->scale)),
|
||||
Vector2D scaleXY = Vector2D((PMONITOR->scale * PWINDOW->m_vRealSize.vec().x / (PWINDOW->m_vOriginalClosedSize.x * PMONITOR->scale)),
|
||||
(PMONITOR->scale * PWINDOW->m_vRealSize.vec().y / (PWINDOW->m_vOriginalClosedSize.y * PMONITOR->scale)));
|
||||
|
||||
windowBox.width = PMONITOR->vecTransformedSize.x * scaleXY.x;
|
||||
|
@ -1243,11 +1243,6 @@ void CHyprOpenGLImpl::renderSnapshot(CWindow** pWindow) {
|
|||
m_bEndFrame = false;
|
||||
|
||||
pixman_region32_fini(&fakeDamage);
|
||||
|
||||
static auto* const PDAMAGEMON = &g_pConfigManager->getConfigValuePtr("misc:damage_entire_on_snapshot")->intValue;
|
||||
|
||||
if (*PDAMAGEMON)
|
||||
PMONITOR->forceFullFrames += 1;
|
||||
}
|
||||
|
||||
void CHyprOpenGLImpl::renderSnapshot(SLayerSurface** pLayer) {
|
||||
|
@ -1278,11 +1273,6 @@ void CHyprOpenGLImpl::renderSnapshot(SLayerSurface** pLayer) {
|
|||
m_bEndFrame = false;
|
||||
|
||||
pixman_region32_fini(&fakeDamage);
|
||||
|
||||
static auto* const PDAMAGEMON = &g_pConfigManager->getConfigValuePtr("misc:damage_entire_on_snapshot")->intValue;
|
||||
|
||||
if (*PDAMAGEMON)
|
||||
PMONITOR->forceFullFrames += 1;
|
||||
}
|
||||
|
||||
void CHyprOpenGLImpl::renderRoundedShadow(wlr_box* box, int round, int range, float a) {
|
||||
|
@ -1410,7 +1400,7 @@ void CHyprOpenGLImpl::createBGTextureForMonitor(CMonitor* pMonitor) {
|
|||
static auto* const PNOSPLASH = &g_pConfigManager->getConfigValuePtr("misc:disable_splash_rendering")->intValue;
|
||||
|
||||
// release the last tex if exists
|
||||
const auto PTEX = &m_mMonitorBGTextures[pMonitor];
|
||||
const auto PTEX = &m_mMonitorBGTextures[pMonitor];
|
||||
PTEX->destroyTexture();
|
||||
|
||||
PTEX->allocate();
|
||||
|
|
Loading…
Reference in a new issue