Skip to content

Commit e8f74ed

Browse files
committed
fix: add xdgTag as a new indicator
1 parent b28fd1a commit e8f74ed

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/config/ConfigManager.hpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22

33
#include <hyprutils/animation/AnimationConfig.hpp>
4+
#include <string>
45
#define CONFIG_MANAGER_H
56

67
#include <map>
@@ -142,10 +143,18 @@ struct SFloatCache {
142143
size_t hash;
143144

144145
SFloatCache(PHLWINDOW window, bool initial) {
145-
if (initial)
146-
hash = std::hash<std::string>{}(window->m_initialClass) ^ (std::hash<std::string>{}(window->m_initialTitle) << 1);
147-
else
148-
hash = std::hash<std::string>{}(window->m_class) ^ (std::hash<std::string>{}(window->m_title) << 1);
146+
// Base hash from class/title
147+
size_t baseHash = initial ? (std::hash<std::string>{}(window->m_initialClass) ^ (std::hash<std::string>{}(window->m_initialTitle) << 1)) :
148+
(std::hash<std::string>{}(window->m_class) ^ (std::hash<std::string>{}(window->m_title) << 1));
149+
150+
// Use empty string as default tag value
151+
std::string tagValue = "";
152+
if (auto xdgTag = window->xdgTag()) {
153+
tagValue = xdgTag.value();
154+
}
155+
156+
// Combine hashes
157+
hash = baseHash ^ (std::hash<std::string>{}(tagValue) << 2);
149158
}
150159

151160
bool operator==(const SFloatCache& other) const {

src/layout/IHyprLayout.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,9 @@ Vector2D IHyprLayout::predictSizeForNewWindowFloating(PHLWINDOW pWindow) { // ge
891891
// If `persistentsize` is set, use the stored size if available.
892892
const bool HASPERSISTENTSIZE = std::ranges::any_of(pWindow->m_matchedRules, [](const auto& rule) { return rule->m_ruleType == CWindowRule::RULE_PERSISTENTSIZE; });
893893

894+
if (HASPERSISTENTSIZE)
895+
Debug::log(LOG, "HASPERSISTENTSIZE!");
896+
894897
const auto STOREDSIZE = HASPERSISTENTSIZE ? g_pConfigManager->getStoredFloatingSize(pWindow) : std::nullopt;
895898

896899
if (STOREDSIZE.has_value()) {

0 commit comments

Comments
 (0)