File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -142,10 +142,18 @@ struct SFloatCache {
142142 size_t hash;
143143
144144 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 );
145+ // Base hash from class/title
146+ size_t baseHash = initial ? (std::hash<std::string>{}(window->m_initialClass ) ^ (std::hash<std::string>{}(window->m_initialTitle ) << 1 )) :
147+ (std::hash<std::string>{}(window->m_class ) ^ (std::hash<std::string>{}(window->m_title ) << 1 ));
148+
149+ // Use empty string as default tag value
150+ std::string tagValue = " " ;
151+ if (auto xdgTag = window->xdgTag ()) {
152+ tagValue = xdgTag.value ();
153+ }
154+
155+ // Combine hashes
156+ hash = baseHash ^ (std::hash<std::string>{}(tagValue) << 2 );
149157 }
150158
151159 bool operator ==(const SFloatCache& other) const {
You can’t perform that action at this time.
0 commit comments