Skip to content

Commit

Permalink
rebrand
Browse files Browse the repository at this point in the history
oops

camel

forgor

forgor
  • Loading branch information
nnyyxxxx committed Feb 25, 2025
1 parent 28cd72b commit 369547c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/desktop/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -792,8 +792,8 @@ void CWindow::applyDynamicRule(const SP<CWindowRule>& r) {
}
break;
}
case CWindowRule::RULE_NOMAXIMIZEHINTS: {
m_sWindowData.noMaximizeHints = CWindowOverridableVar(true, PRIORITY_WINDOW_RULE);
case CWindowRule::RULE_PERSISTENTSIZE: {
m_sWindowData.persistentSize = CWindowOverridableVar(true, PRIORITY_WINDOW_RULE);
break;
}
default: break;
Expand Down Expand Up @@ -1329,8 +1329,8 @@ void CWindow::clampWindowSize(const std::optional<Vector2D> minSize, const std::
*m_vRealPosition = m_vRealPosition->goal() + DELTA / 2.0;
*m_vRealSize = NEWSIZE;

if (m_bIsFloating && !m_bIsX11 && std::any_of(m_vMatchedRules.begin(), m_vMatchedRules.end(), [](const auto& r) { return r->ruleType == CWindowRule::RULE_NOMAXIMIZEHINTS; })) {
Debug::log(LOG, "clamped window {}::{} to {}x{} (nomaximizehints)", m_szClass, m_szTitle, m_vRealSize->value().x, m_vRealSize->value().y);
if (m_bIsFloating && !m_bIsX11 && std::any_of(m_vMatchedRules.begin(), m_vMatchedRules.end(), [](const auto& r) { return r->ruleType == CWindowRule::RULE_PERSISTENTSIZE; })) {
Debug::log(LOG, "clamped window {}::{} to {}x{} (persistentsize)", m_szClass, m_szTitle, m_vRealSize->value().x, m_vRealSize->value().y);
g_pConfigManager->storeFloatingSize(m_szClass, m_szTitle, m_vRealSize->value());
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/desktop/Window.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ struct SWindowData {
CWindowOverridableVar<CGradientValueData> activeBorderColor;
CWindowOverridableVar<CGradientValueData> inactiveBorderColor;

CWindowOverridableVar<bool> noMaximizeHints;
CWindowOverridableVar<bool> persistentSize;
};

struct SInitialWorkspaceToken {
Expand Down
6 changes: 3 additions & 3 deletions src/desktop/WindowRule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "../config/ConfigManager.hpp"

static const auto RULES = std::unordered_set<std::string>{
"float", "fullscreen", "maximize", "nomaximizehints", "noinitialfocus", "pin", "stayfocused", "tile", "renderunfocused",
"float", "fullscreen", "maximize", "persistentsize", "noinitialfocus", "pin", "stayfocused", "tile", "renderunfocused",
};
static const auto RULES_PREFIX = std::unordered_set<std::string>{
"animation", "bordercolor", "bordersize", "center", "content", "fullscreenstate", "group", "idleinhibit", "maxsize", "minsize",
Expand All @@ -29,8 +29,8 @@ CWindowRule::CWindowRule(const std::string& rule, const std::string& value, bool
ruleType = RULE_FULLSCREEN;
else if (rule == "maximize")
ruleType = RULE_MAXIMIZE;
else if (rule == "nomaximizehints")
ruleType = RULE_NOMAXIMIZEHINTS;
else if (rule == "persistentsize")
ruleType = RULE_PERSISTENTSIZE;
else if (rule == "noinitialfocus")
ruleType = RULE_NOINITIALFOCUS;
else if (rule == "pin")
Expand Down
2 changes: 1 addition & 1 deletion src/desktop/WindowRule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CWindowRule {
RULE_FLOAT,
RULE_FULLSCREEN,
RULE_MAXIMIZE,
RULE_NOMAXIMIZEHINTS,
RULE_PERSISTENTSIZE,
RULE_NOINITIALFOCUS,
RULE_PIN,
RULE_STAYFOCUSED,
Expand Down
6 changes: 3 additions & 3 deletions src/layout/IHyprLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
void IHyprLayout::onWindowCreated(PHLWINDOW pWindow, eDirection direction) {
CBox desiredGeometry = g_pXWaylandManager->getGeometryForWindow(pWindow);

const bool HASNOMAXIMIZEHINTS =
std::any_of(pWindow->m_vMatchedRules.begin(), pWindow->m_vMatchedRules.end(), [](const auto& rule) { return rule->ruleType == CWindowRule::RULE_NOMAXIMIZEHINTS; });
const bool HASPERSISTENTSIZE =
std::any_of(pWindow->m_vMatchedRules.begin(), pWindow->m_vMatchedRules.end(), [](const auto& rule) { return rule->ruleType == CWindowRule::RULE_PERSISTENTSIZE; });

const auto STOREDSIZE = HASNOMAXIMIZEHINTS ? g_pConfigManager->getStoredFloatingSize(pWindow->m_szClass, pWindow->m_szTitle) : std::nullopt;
const auto STOREDSIZE = HASPERSISTENTSIZE ? g_pConfigManager->getStoredFloatingSize(pWindow->m_szClass, pWindow->m_szTitle) : std::nullopt;

if (STOREDSIZE.has_value()) {
Debug::log(LOG, "using stored size {}x{} for new window {}::{}", STOREDSIZE->x, STOREDSIZE->y, pWindow->m_szClass, pWindow->m_szTitle);
Expand Down

0 comments on commit 369547c

Please sign in to comment.