Skip to content

Commit

Permalink
nomaximizehints
Browse files Browse the repository at this point in the history
  • Loading branch information
nnyyxxxx committed Feb 24, 2025
1 parent 7e15672 commit 5f95671
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/desktop/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -795,8 +795,8 @@ void CWindow::applyDynamicRule(const SP<CWindowRule>& r) {
}
break;
}
case CWindowRule::RULE_DISABLEMAXIMIZEDHINTS: {
m_sWindowData.disableMaximizedHints = CWindowOverridableVar(true, PRIORITY_WINDOW_RULE);
case CWindowRule::RULE_NOMAXIMIZEHINTS: {
m_sWindowData.noMaximizeHints = CWindowOverridableVar(true, PRIORITY_WINDOW_RULE);
break;
}
default: break;
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> disableMaximizedHints;
CWindowOverridableVar<bool> noMaximizeHints;
};

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", "disablemaximizedhints", "noinitialfocus", "pin", "stayfocused", "tile", "renderunfocused",
"float", "fullscreen", "maximize", "nomaximizehints", "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 == "disablemaximizedhints")
ruleType = RULE_DISABLEMAXIMIZEDHINTS;
else if (rule == "nomaximizehints")
ruleType = RULE_NOMAXIMIZEHINTS;
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_DISABLEMAXIMIZEDHINTS,
RULE_NOMAXIMIZEHINTS,
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 HASDISABLEMAXHINTS =
std::any_of(pWindow->m_vMatchedRules.begin(), pWindow->m_vMatchedRules.end(), [](const auto& rule) { return rule->ruleType == CWindowRule::RULE_DISABLEMAXIMIZEDHINTS; });
const bool HASNOMAXIMIZEHINTS =
std::any_of(pWindow->m_vMatchedRules.begin(), pWindow->m_vMatchedRules.end(), [](const auto& rule) { return rule->ruleType == CWindowRule::RULE_NOMAXIMIZEHINTS; });

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

if (STOREDSIZE.has_value())
pWindow->m_vLastFloatingSize = STOREDSIZE.value();
Expand Down

0 comments on commit 5f95671

Please sign in to comment.