diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2023-09-28 21:48:33 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-28 21:48:33 +0100 |
| commit | 88b63a00b68350d6d001445357a2582ab5975f9c (patch) | |
| tree | a730d59c70e5987eae8006fd5b0eb4ef531113dc /src/Window.cpp | |
| parent | 1e513e25d5645260a2ebdfbe8dbf3b8df487339c (diff) | |
renderer: Tearing implementation (#3441)
Diffstat (limited to 'src/Window.cpp')
| -rw-r--r-- | src/Window.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Window.cpp b/src/Window.cpp index 4ee40dff..9055101e 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -414,6 +414,11 @@ void CWindow::onUnmap() { if (PMONITOR && PMONITOR->specialWorkspaceID == m_iWorkspaceID) PMONITOR->setSpecialWorkspace(nullptr); } + + const auto PMONITOR = g_pCompositor->getMonitorFromID(m_iMonitorID); + + if (PMONITOR && PMONITOR->solitaryClient == this) + PMONITOR->solitaryClient = nullptr; } void CWindow::onMap() { @@ -492,6 +497,8 @@ void CWindow::applyDynamicRule(const SWindowRule& r) { } else if (r.szRule == "opaque") { if (!m_sAdditionalConfigData.forceOpaqueOverridden) m_sAdditionalConfigData.forceOpaque = true; + } else if (r.szRule == "immediate") { + m_sAdditionalConfigData.forceTearing = true; } else if (r.szRule.find("rounding") == 0) { try { m_sAdditionalConfigData.rounding = std::stoi(r.szRule.substr(r.szRule.find_first_of(' ') + 1)); @@ -580,6 +587,7 @@ void CWindow::updateDynamicRules() { m_sAdditionalConfigData.borderSize = -1; m_sAdditionalConfigData.keepAspectRatio = false; m_sAdditionalConfigData.xray = -1; + m_sAdditionalConfigData.forceTearing = false; const auto WINDOWRULES = g_pConfigManager->getMatchingRules(this); for (auto& r : WINDOWRULES) { @@ -925,3 +933,7 @@ int CWindow::getRealBorderSize() { return g_pConfigManager->getConfigValuePtr("general:border_size")->intValue; } + +bool CWindow::canBeTorn() { + return (m_sAdditionalConfigData.forceTearing.toUnderlying() || m_bTearingHint) && g_pHyprRenderer->m_bTearingEnvSatisfied; +} |
